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