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