Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
CpSolverSolution.java
Go to the documentation of this file.
1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// NO CHECKED-IN PROTOBUF GENCODE
3// source: ortools/sat/cp_model.proto
4// Protobuf Java Version: 4.29.3
5
6package com.google.ortools.sat;
7
16public final class CpSolverSolution extends
17 com.google.protobuf.GeneratedMessage implements
18 // @@protoc_insertion_point(message_implements:operations_research.sat.CpSolverSolution)
20private static final long serialVersionUID = 0L;
21 static {
22 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
23 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
24 /* major= */ 4,
25 /* minor= */ 29,
26 /* patch= */ 3,
27 /* suffix= */ "",
28 CpSolverSolution.class.getName());
29 }
30 // Use CpSolverSolution.newBuilder() to construct.
31 private CpSolverSolution(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
32 super(builder);
33 }
34 private CpSolverSolution() {
35 values_ = emptyLongList();
36 }
37
38 public static final com.google.protobuf.Descriptors.Descriptor
40 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpSolverSolution_descriptor;
41 }
42
43 @java.lang.Override
44 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
46 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpSolverSolution_fieldAccessorTable
47 .ensureFieldAccessorsInitialized(
48 com.google.ortools.sat.CpSolverSolution.class, com.google.ortools.sat.CpSolverSolution.Builder.class);
49 }
50
51 public static final int VALUES_FIELD_NUMBER = 1;
52 @SuppressWarnings("serial")
53 private com.google.protobuf.Internal.LongList values_ =
54 emptyLongList();
59 @java.lang.Override
60 public java.util.List<java.lang.Long>
62 return values_;
63 }
64
68 public int getValuesCount() {
69 return values_.size();
70 }
71
76 public long getValues(int index) {
77 return values_.getLong(index);
78 }
79 private int valuesMemoizedSerializedSize = -1;
80
81 private byte memoizedIsInitialized = -1;
82 @java.lang.Override
83 public final boolean isInitialized() {
84 byte isInitialized = memoizedIsInitialized;
85 if (isInitialized == 1) return true;
86 if (isInitialized == 0) return false;
87
88 memoizedIsInitialized = 1;
89 return true;
90 }
91
92 @java.lang.Override
93 public void writeTo(com.google.protobuf.CodedOutputStream output)
94 throws java.io.IOException {
96 if (getValuesList().size() > 0) {
97 output.writeUInt32NoTag(10);
98 output.writeUInt32NoTag(valuesMemoizedSerializedSize);
99 }
100 for (int i = 0; i < values_.size(); i++) {
101 output.writeInt64NoTag(values_.getLong(i));
102 }
103 getUnknownFields().writeTo(output);
104 }
105
106 @java.lang.Override
107 public int getSerializedSize() {
108 int size = memoizedSize;
109 if (size != -1) return size;
110
111 size = 0;
112 {
113 int dataSize = 0;
114 for (int i = 0; i < values_.size(); i++) {
115 dataSize += com.google.protobuf.CodedOutputStream
116 .computeInt64SizeNoTag(values_.getLong(i));
117 }
118 size += dataSize;
119 if (!getValuesList().isEmpty()) {
120 size += 1;
121 size += com.google.protobuf.CodedOutputStream
122 .computeInt32SizeNoTag(dataSize);
123 }
124 valuesMemoizedSerializedSize = dataSize;
125 }
126 size += getUnknownFields().getSerializedSize();
127 memoizedSize = size;
128 return size;
129 }
130
131 @java.lang.Override
132 public boolean equals(final java.lang.Object obj) {
133 if (obj == this) {
134 return true;
135 }
136 if (!(obj instanceof com.google.ortools.sat.CpSolverSolution)) {
137 return super.equals(obj);
138 }
139 com.google.ortools.sat.CpSolverSolution other = (com.google.ortools.sat.CpSolverSolution) obj;
140
141 if (!getValuesList()
142 .equals(other.getValuesList())) return false;
143 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
144 return true;
145 }
146
147 @java.lang.Override
148 public int hashCode() {
149 if (memoizedHashCode != 0) {
150 return memoizedHashCode;
151 }
152 int hash = 41;
153 hash = (19 * hash) + getDescriptor().hashCode();
154 if (getValuesCount() > 0) {
155 hash = (37 * hash) + VALUES_FIELD_NUMBER;
156 hash = (53 * hash) + getValuesList().hashCode();
157 }
158 hash = (29 * hash) + getUnknownFields().hashCode();
159 memoizedHashCode = hash;
160 return hash;
161 }
162
164 java.nio.ByteBuffer data)
165 throws com.google.protobuf.InvalidProtocolBufferException {
166 return PARSER.parseFrom(data);
167 }
169 java.nio.ByteBuffer data,
170 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
171 throws com.google.protobuf.InvalidProtocolBufferException {
172 return PARSER.parseFrom(data, extensionRegistry);
173 }
175 com.google.protobuf.ByteString data)
176 throws com.google.protobuf.InvalidProtocolBufferException {
177 return PARSER.parseFrom(data);
178 }
180 com.google.protobuf.ByteString data,
181 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
182 throws com.google.protobuf.InvalidProtocolBufferException {
183 return PARSER.parseFrom(data, extensionRegistry);
184 }
186 throws com.google.protobuf.InvalidProtocolBufferException {
187 return PARSER.parseFrom(data);
188 }
190 byte[] data,
191 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
192 throws com.google.protobuf.InvalidProtocolBufferException {
193 return PARSER.parseFrom(data, extensionRegistry);
194 }
195 public static com.google.ortools.sat.CpSolverSolution parseFrom(java.io.InputStream input)
196 throws java.io.IOException {
197 return com.google.protobuf.GeneratedMessage
198 .parseWithIOException(PARSER, input);
199 }
201 java.io.InputStream input,
202 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
203 throws java.io.IOException {
204 return com.google.protobuf.GeneratedMessage
205 .parseWithIOException(PARSER, input, extensionRegistry);
206 }
207
208 public static com.google.ortools.sat.CpSolverSolution parseDelimitedFrom(java.io.InputStream input)
209 throws java.io.IOException {
210 return com.google.protobuf.GeneratedMessage
211 .parseDelimitedWithIOException(PARSER, input);
212 }
213
215 java.io.InputStream input,
216 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
217 throws java.io.IOException {
218 return com.google.protobuf.GeneratedMessage
219 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
220 }
222 com.google.protobuf.CodedInputStream input)
223 throws java.io.IOException {
224 return com.google.protobuf.GeneratedMessage
225 .parseWithIOException(PARSER, input);
226 }
228 com.google.protobuf.CodedInputStream input,
229 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
230 throws java.io.IOException {
231 return com.google.protobuf.GeneratedMessage
232 .parseWithIOException(PARSER, input, extensionRegistry);
233 }
234
235 @java.lang.Override
236 public Builder newBuilderForType() { return newBuilder(); }
237 public static Builder newBuilder() {
238 return DEFAULT_INSTANCE.toBuilder();
239 }
240 public static Builder newBuilder(com.google.ortools.sat.CpSolverSolution prototype) {
241 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
242 }
243 @java.lang.Override
245 return this == DEFAULT_INSTANCE
246 ? new Builder() : new Builder().mergeFrom(this);
247 }
248
249 @java.lang.Override
251 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
252 Builder builder = new Builder(parent);
253 return builder;
254 }
255
263 public static final class Builder extends
264 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
265 // @@protoc_insertion_point(builder_implements:operations_research.sat.CpSolverSolution)
267 public static final com.google.protobuf.Descriptors.Descriptor
269 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpSolverSolution_descriptor;
270 }
271
272 @java.lang.Override
273 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
275 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpSolverSolution_fieldAccessorTable
276 .ensureFieldAccessorsInitialized(
277 com.google.ortools.sat.CpSolverSolution.class, com.google.ortools.sat.CpSolverSolution.Builder.class);
278 }
279
280 // Construct using com.google.ortools.sat.CpSolverSolution.newBuilder()
281 private Builder() {
282
283 }
284
285 private Builder(
286 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
287 super(parent);
288
289 }
290 @java.lang.Override
291 public Builder clear() {
292 super.clear();
293 bitField0_ = 0;
294 values_ = emptyLongList();
295 return this;
296 }
297
298 @java.lang.Override
299 public com.google.protobuf.Descriptors.Descriptor
301 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CpSolverSolution_descriptor;
302 }
303
304 @java.lang.Override
306 return com.google.ortools.sat.CpSolverSolution.getDefaultInstance();
307 }
308
309 @java.lang.Override
312 if (!result.isInitialized()) {
313 throw newUninitializedMessageException(result);
314 }
315 return result;
316 }
317
318 @java.lang.Override
320 com.google.ortools.sat.CpSolverSolution result = new com.google.ortools.sat.CpSolverSolution(this);
321 if (bitField0_ != 0) { buildPartial0(result); }
322 onBuilt();
323 return result;
324 }
325
326 private void buildPartial0(com.google.ortools.sat.CpSolverSolution result) {
327 int from_bitField0_ = bitField0_;
328 if (((from_bitField0_ & 0x00000001) != 0)) {
329 values_.makeImmutable();
330 result.values_ = values_;
331 }
332 }
333
334 @java.lang.Override
335 public Builder mergeFrom(com.google.protobuf.Message other) {
336 if (other instanceof com.google.ortools.sat.CpSolverSolution) {
337 return mergeFrom((com.google.ortools.sat.CpSolverSolution)other);
338 } else {
339 super.mergeFrom(other);
340 return this;
341 }
342 }
343
344 public Builder mergeFrom(com.google.ortools.sat.CpSolverSolution other) {
345 if (other == com.google.ortools.sat.CpSolverSolution.getDefaultInstance()) return this;
346 if (!other.values_.isEmpty()) {
347 if (values_.isEmpty()) {
348 values_ = other.values_;
349 values_.makeImmutable();
350 bitField0_ |= 0x00000001;
351 } else {
352 ensureValuesIsMutable();
353 values_.addAll(other.values_);
354 }
355 onChanged();
356 }
357 this.mergeUnknownFields(other.getUnknownFields());
358 onChanged();
359 return this;
360 }
361
362 @java.lang.Override
363 public final boolean isInitialized() {
364 return true;
365 }
366
367 @java.lang.Override
368 public Builder mergeFrom(
369 com.google.protobuf.CodedInputStream input,
370 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
371 throws java.io.IOException {
372 if (extensionRegistry == null) {
373 throw new java.lang.NullPointerException();
374 }
375 try {
376 boolean done = false;
377 while (!done) {
378 int tag = input.readTag();
379 switch (tag) {
380 case 0:
381 done = true;
382 break;
383 case 8: {
384 long v = input.readInt64();
385 ensureValuesIsMutable();
386 values_.addLong(v);
387 break;
388 } // case 8
389 case 10: {
390 int length = input.readRawVarint32();
391 int limit = input.pushLimit(length);
392 ensureValuesIsMutable();
393 while (input.getBytesUntilLimit() > 0) {
394 values_.addLong(input.readInt64());
395 }
396 input.popLimit(limit);
397 break;
398 } // case 10
399 default: {
400 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
401 done = true; // was an endgroup tag
402 }
403 break;
404 } // default:
405 } // switch (tag)
406 } // while (!done)
407 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
408 throw e.unwrapIOException();
409 } finally {
410 onChanged();
411 } // finally
412 return this;
413 }
414 private int bitField0_;
415
416 private com.google.protobuf.Internal.LongList values_ = emptyLongList();
417 private void ensureValuesIsMutable() {
418 if (!values_.isModifiable()) {
419 values_ = makeMutableCopy(values_);
420 }
421 bitField0_ |= 0x00000001;
422 }
427 public java.util.List<java.lang.Long>
429 values_.makeImmutable();
430 return values_;
431 }
432
436 public int getValuesCount() {
437 return values_.size();
438 }
439
444 public long getValues(int index) {
445 return values_.getLong(index);
446 }
447
453 public Builder setValues(
454 int index, long value) {
455
456 ensureValuesIsMutable();
457 values_.setLong(index, value);
458 bitField0_ |= 0x00000001;
459 onChanged();
460 return this;
461 }
462
467 public Builder addValues(long value) {
468
469 ensureValuesIsMutable();
470 values_.addLong(value);
471 bitField0_ |= 0x00000001;
472 onChanged();
473 return this;
474 }
475
480 public Builder addAllValues(
481 java.lang.Iterable<? extends java.lang.Long> values) {
482 ensureValuesIsMutable();
483 com.google.protobuf.AbstractMessageLite.Builder.addAll(
484 values, values_);
485 bitField0_ |= 0x00000001;
486 onChanged();
487 return this;
488 }
489
493 public Builder clearValues() {
494 values_ = emptyLongList();
495 bitField0_ = (bitField0_ & ~0x00000001);
496 onChanged();
497 return this;
498 }
499
500 // @@protoc_insertion_point(builder_scope:operations_research.sat.CpSolverSolution)
501 }
502
503 // @@protoc_insertion_point(class_scope:operations_research.sat.CpSolverSolution)
504 private static final com.google.ortools.sat.CpSolverSolution DEFAULT_INSTANCE;
505 static {
506 DEFAULT_INSTANCE = new com.google.ortools.sat.CpSolverSolution();
507 }
508
510 return DEFAULT_INSTANCE;
511 }
512
513 private static final com.google.protobuf.Parser<CpSolverSolution>
514 PARSER = new com.google.protobuf.AbstractParser<CpSolverSolution>() {
515 @java.lang.Override
516 public CpSolverSolution parsePartialFrom(
517 com.google.protobuf.CodedInputStream input,
518 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
519 throws com.google.protobuf.InvalidProtocolBufferException {
520 Builder builder = newBuilder();
521 try {
522 builder.mergeFrom(input, extensionRegistry);
523 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
524 throw e.setUnfinishedMessage(builder.buildPartial());
525 } catch (com.google.protobuf.UninitializedMessageException e) {
526 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
527 } catch (java.io.IOException e) {
528 throw new com.google.protobuf.InvalidProtocolBufferException(e)
529 .setUnfinishedMessage(builder.buildPartial());
530 }
531 return builder.buildPartial();
532 }
533 };
534
535 public static com.google.protobuf.Parser<CpSolverSolution> parser() {
536 return PARSER;
537 }
538
539 @java.lang.Override
540 public com.google.protobuf.Parser<CpSolverSolution> getParserForType() {
541 return PARSER;
542 }
543
544 @java.lang.Override
546 return DEFAULT_INSTANCE;
547 }
548
549}
550
Builder mergeFrom(com.google.protobuf.Message other)
com.google.ortools.sat.CpSolverSolution getDefaultInstanceForType()
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
java.util.List< java.lang.Long > getValuesList()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
Builder mergeFrom(com.google.ortools.sat.CpSolverSolution other)
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
com.google.ortools.sat.CpSolverSolution buildPartial()
com.google.ortools.sat.CpSolverSolution build()
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Builder addAllValues(java.lang.Iterable<? extends java.lang.Long > values)
void writeTo(com.google.protobuf.CodedOutputStream output)
com.google.protobuf.Parser< CpSolverSolution > getParserForType()
static com.google.ortools.sat.CpSolverSolution parseFrom(byte[] data)
static com.google.ortools.sat.CpSolverSolution parseFrom(com.google.protobuf.CodedInputStream input)
static com.google.ortools.sat.CpSolverSolution parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
static com.google.ortools.sat.CpSolverSolution parseFrom(java.io.InputStream input)
static com.google.ortools.sat.CpSolverSolution getDefaultInstance()
static com.google.ortools.sat.CpSolverSolution parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
boolean equals(final java.lang.Object obj)
static com.google.ortools.sat.CpSolverSolution parseDelimitedFrom(java.io.InputStream input)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
java.util.List< java.lang.Long > getValuesList()
com.google.ortools.sat.CpSolverSolution getDefaultInstanceForType()
static com.google.ortools.sat.CpSolverSolution parseFrom(java.nio.ByteBuffer data)
static com.google.ortools.sat.CpSolverSolution parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static Builder newBuilder(com.google.ortools.sat.CpSolverSolution prototype)
static com.google.ortools.sat.CpSolverSolution parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.CpSolverSolution parseFrom(com.google.protobuf.ByteString data)
static com.google.ortools.sat.CpSolverSolution parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.CpSolverSolution parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.protobuf.Parser< CpSolverSolution > parser()
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)