Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
PartialVariableAssignment.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
16public final class PartialVariableAssignment extends
17 com.google.protobuf.GeneratedMessage implements
18 // @@protoc_insertion_point(message_implements:operations_research.sat.PartialVariableAssignment)
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= */ 26,
26 /* patch= */ 1,
27 /* suffix= */ "",
28 PartialVariableAssignment.class.getName());
29 }
30 // Use PartialVariableAssignment.newBuilder() to construct.
31 private PartialVariableAssignment(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
32 super(builder);
33 }
35 vars_ = emptyIntList();
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_PartialVariableAssignment_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_PartialVariableAssignment_fieldAccessorTable
48 .ensureFieldAccessorsInitialized(
49 com.google.ortools.sat.PartialVariableAssignment.class, com.google.ortools.sat.PartialVariableAssignment.Builder.class);
50 }
51
52 public static final int VARS_FIELD_NUMBER = 1;
53 @SuppressWarnings("serial")
54 private com.google.protobuf.Internal.IntList vars_ =
55 emptyIntList();
60 @java.lang.Override
61 public java.util.List<java.lang.Integer>
63 return vars_;
64 }
69 public int getVarsCount() {
70 return vars_.size();
71 }
77 public int getVars(int index) {
78 return vars_.getInt(index);
79 }
80 private int varsMemoizedSerializedSize = -1;
81
82 public static final int VALUES_FIELD_NUMBER = 2;
83 @SuppressWarnings("serial")
84 private com.google.protobuf.Internal.LongList values_ =
85 emptyLongList();
90 @java.lang.Override
91 public java.util.List<java.lang.Long>
93 return values_;
94 }
99 public int getValuesCount() {
100 return values_.size();
101 }
107 public long getValues(int index) {
108 return values_.getLong(index);
109 }
110 private int valuesMemoizedSerializedSize = -1;
111
112 private byte memoizedIsInitialized = -1;
113 @java.lang.Override
114 public final boolean isInitialized() {
115 byte isInitialized = memoizedIsInitialized;
116 if (isInitialized == 1) return true;
117 if (isInitialized == 0) return false;
118
119 memoizedIsInitialized = 1;
120 return true;
121 }
122
123 @java.lang.Override
124 public void writeTo(com.google.protobuf.CodedOutputStream output)
125 throws java.io.IOException {
127 if (getVarsList().size() > 0) {
128 output.writeUInt32NoTag(10);
129 output.writeUInt32NoTag(varsMemoizedSerializedSize);
130 }
131 for (int i = 0; i < vars_.size(); i++) {
132 output.writeInt32NoTag(vars_.getInt(i));
133 }
134 if (getValuesList().size() > 0) {
135 output.writeUInt32NoTag(18);
136 output.writeUInt32NoTag(valuesMemoizedSerializedSize);
137 }
138 for (int i = 0; i < values_.size(); i++) {
139 output.writeInt64NoTag(values_.getLong(i));
140 }
141 getUnknownFields().writeTo(output);
142 }
143
144 @java.lang.Override
145 public int getSerializedSize() {
146 int size = memoizedSize;
147 if (size != -1) return size;
148
149 size = 0;
150 {
151 int dataSize = 0;
152 for (int i = 0; i < vars_.size(); i++) {
153 dataSize += com.google.protobuf.CodedOutputStream
154 .computeInt32SizeNoTag(vars_.getInt(i));
155 }
156 size += dataSize;
157 if (!getVarsList().isEmpty()) {
158 size += 1;
159 size += com.google.protobuf.CodedOutputStream
160 .computeInt32SizeNoTag(dataSize);
161 }
162 varsMemoizedSerializedSize = dataSize;
163 }
164 {
165 int dataSize = 0;
166 for (int i = 0; i < values_.size(); i++) {
167 dataSize += com.google.protobuf.CodedOutputStream
168 .computeInt64SizeNoTag(values_.getLong(i));
169 }
170 size += dataSize;
171 if (!getValuesList().isEmpty()) {
172 size += 1;
173 size += com.google.protobuf.CodedOutputStream
174 .computeInt32SizeNoTag(dataSize);
175 }
176 valuesMemoizedSerializedSize = dataSize;
177 }
178 size += getUnknownFields().getSerializedSize();
179 memoizedSize = size;
180 return size;
181 }
182
183 @java.lang.Override
184 public boolean equals(final java.lang.Object obj) {
185 if (obj == this) {
186 return true;
187 }
188 if (!(obj instanceof com.google.ortools.sat.PartialVariableAssignment)) {
189 return super.equals(obj);
190 }
191 com.google.ortools.sat.PartialVariableAssignment other = (com.google.ortools.sat.PartialVariableAssignment) obj;
192
193 if (!getVarsList()
194 .equals(other.getVarsList())) return false;
195 if (!getValuesList()
196 .equals(other.getValuesList())) return false;
197 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
198 return true;
199 }
200
201 @java.lang.Override
202 public int hashCode() {
203 if (memoizedHashCode != 0) {
204 return memoizedHashCode;
205 }
206 int hash = 41;
207 hash = (19 * hash) + getDescriptor().hashCode();
208 if (getVarsCount() > 0) {
209 hash = (37 * hash) + VARS_FIELD_NUMBER;
210 hash = (53 * hash) + getVarsList().hashCode();
211 }
212 if (getValuesCount() > 0) {
213 hash = (37 * hash) + VALUES_FIELD_NUMBER;
214 hash = (53 * hash) + getValuesList().hashCode();
215 }
216 hash = (29 * hash) + getUnknownFields().hashCode();
217 memoizedHashCode = hash;
218 return hash;
219 }
220
222 java.nio.ByteBuffer data)
223 throws com.google.protobuf.InvalidProtocolBufferException {
224 return PARSER.parseFrom(data);
225 }
227 java.nio.ByteBuffer data,
228 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
229 throws com.google.protobuf.InvalidProtocolBufferException {
230 return PARSER.parseFrom(data, extensionRegistry);
231 }
233 com.google.protobuf.ByteString data)
234 throws com.google.protobuf.InvalidProtocolBufferException {
235 return PARSER.parseFrom(data);
236 }
238 com.google.protobuf.ByteString data,
239 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
240 throws com.google.protobuf.InvalidProtocolBufferException {
241 return PARSER.parseFrom(data, extensionRegistry);
242 }
244 throws com.google.protobuf.InvalidProtocolBufferException {
245 return PARSER.parseFrom(data);
246 }
248 byte[] data,
249 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
250 throws com.google.protobuf.InvalidProtocolBufferException {
251 return PARSER.parseFrom(data, extensionRegistry);
252 }
253 public static com.google.ortools.sat.PartialVariableAssignment parseFrom(java.io.InputStream input)
254 throws java.io.IOException {
255 return com.google.protobuf.GeneratedMessage
256 .parseWithIOException(PARSER, input);
257 }
259 java.io.InputStream input,
260 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
261 throws java.io.IOException {
262 return com.google.protobuf.GeneratedMessage
263 .parseWithIOException(PARSER, input, extensionRegistry);
264 }
265
267 throws java.io.IOException {
268 return com.google.protobuf.GeneratedMessage
269 .parseDelimitedWithIOException(PARSER, input);
270 }
271
273 java.io.InputStream input,
274 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
275 throws java.io.IOException {
276 return com.google.protobuf.GeneratedMessage
277 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
278 }
280 com.google.protobuf.CodedInputStream input)
281 throws java.io.IOException {
282 return com.google.protobuf.GeneratedMessage
283 .parseWithIOException(PARSER, input);
284 }
286 com.google.protobuf.CodedInputStream input,
287 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
288 throws java.io.IOException {
289 return com.google.protobuf.GeneratedMessage
290 .parseWithIOException(PARSER, input, extensionRegistry);
291 }
292
293 @java.lang.Override
294 public Builder newBuilderForType() { return newBuilder(); }
295 public static Builder newBuilder() {
296 return DEFAULT_INSTANCE.toBuilder();
297 }
298 public static Builder newBuilder(com.google.ortools.sat.PartialVariableAssignment prototype) {
299 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
300 }
301 @java.lang.Override
303 return this == DEFAULT_INSTANCE
304 ? new Builder() : new Builder().mergeFrom(this);
305 }
306
307 @java.lang.Override
309 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
310 Builder builder = new Builder(parent);
311 return builder;
312 }
322 public static final class Builder extends
323 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
324 // @@protoc_insertion_point(builder_implements:operations_research.sat.PartialVariableAssignment)
325 com.google.ortools.sat.PartialVariableAssignmentOrBuilder {
326 public static final com.google.protobuf.Descriptors.Descriptor
328 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_PartialVariableAssignment_descriptor;
329 }
330
331 @java.lang.Override
332 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
334 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_PartialVariableAssignment_fieldAccessorTable
335 .ensureFieldAccessorsInitialized(
336 com.google.ortools.sat.PartialVariableAssignment.class, com.google.ortools.sat.PartialVariableAssignment.Builder.class);
337 }
338
339 // Construct using com.google.ortools.sat.PartialVariableAssignment.newBuilder()
340 private Builder() {
341
342 }
343
344 private Builder(
345 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
346 super(parent);
347
348 }
349 @java.lang.Override
350 public Builder clear() {
351 super.clear();
352 bitField0_ = 0;
353 vars_ = emptyIntList();
354 values_ = emptyLongList();
355 return this;
356 }
357
358 @java.lang.Override
359 public com.google.protobuf.Descriptors.Descriptor
361 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_PartialVariableAssignment_descriptor;
362 }
363
364 @java.lang.Override
366 return com.google.ortools.sat.PartialVariableAssignment.getDefaultInstance();
367 }
368
369 @java.lang.Override
372 if (!result.isInitialized()) {
373 throw newUninitializedMessageException(result);
374 }
375 return result;
376 }
377
378 @java.lang.Override
380 com.google.ortools.sat.PartialVariableAssignment result = new com.google.ortools.sat.PartialVariableAssignment(this);
381 if (bitField0_ != 0) { buildPartial0(result); }
382 onBuilt();
383 return result;
384 }
385
386 private void buildPartial0(com.google.ortools.sat.PartialVariableAssignment result) {
387 int from_bitField0_ = bitField0_;
388 if (((from_bitField0_ & 0x00000001) != 0)) {
389 vars_.makeImmutable();
390 result.vars_ = vars_;
391 }
392 if (((from_bitField0_ & 0x00000002) != 0)) {
393 values_.makeImmutable();
394 result.values_ = values_;
395 }
396 }
397
398 @java.lang.Override
399 public Builder mergeFrom(com.google.protobuf.Message other) {
400 if (other instanceof com.google.ortools.sat.PartialVariableAssignment) {
401 return mergeFrom((com.google.ortools.sat.PartialVariableAssignment)other);
402 } else {
403 super.mergeFrom(other);
404 return this;
405 }
406 }
407
408 public Builder mergeFrom(com.google.ortools.sat.PartialVariableAssignment other) {
409 if (other == com.google.ortools.sat.PartialVariableAssignment.getDefaultInstance()) return this;
410 if (!other.vars_.isEmpty()) {
411 if (vars_.isEmpty()) {
412 vars_ = other.vars_;
413 vars_.makeImmutable();
414 bitField0_ |= 0x00000001;
415 } else {
416 ensureVarsIsMutable();
417 vars_.addAll(other.vars_);
418 }
419 onChanged();
420 }
421 if (!other.values_.isEmpty()) {
422 if (values_.isEmpty()) {
423 values_ = other.values_;
424 values_.makeImmutable();
425 bitField0_ |= 0x00000002;
426 } else {
427 ensureValuesIsMutable();
428 values_.addAll(other.values_);
429 }
430 onChanged();
431 }
432 this.mergeUnknownFields(other.getUnknownFields());
433 onChanged();
434 return this;
435 }
436
437 @java.lang.Override
438 public final boolean isInitialized() {
439 return true;
440 }
441
442 @java.lang.Override
444 com.google.protobuf.CodedInputStream input,
445 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
446 throws java.io.IOException {
447 if (extensionRegistry == null) {
448 throw new java.lang.NullPointerException();
449 }
450 try {
451 boolean done = false;
452 while (!done) {
453 int tag = input.readTag();
454 switch (tag) {
455 case 0:
456 done = true;
457 break;
458 case 8: {
459 int v = input.readInt32();
460 ensureVarsIsMutable();
461 vars_.addInt(v);
462 break;
463 } // case 8
464 case 10: {
465 int length = input.readRawVarint32();
466 int limit = input.pushLimit(length);
467 ensureVarsIsMutable();
468 while (input.getBytesUntilLimit() > 0) {
469 vars_.addInt(input.readInt32());
470 }
471 input.popLimit(limit);
472 break;
473 } // case 10
474 case 16: {
475 long v = input.readInt64();
476 ensureValuesIsMutable();
477 values_.addLong(v);
478 break;
479 } // case 16
480 case 18: {
481 int length = input.readRawVarint32();
482 int limit = input.pushLimit(length);
483 ensureValuesIsMutable();
484 while (input.getBytesUntilLimit() > 0) {
485 values_.addLong(input.readInt64());
486 }
487 input.popLimit(limit);
488 break;
489 } // case 18
490 default: {
491 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
492 done = true; // was an endgroup tag
493 }
494 break;
495 } // default:
496 } // switch (tag)
497 } // while (!done)
498 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
499 throw e.unwrapIOException();
500 } finally {
501 onChanged();
502 } // finally
503 return this;
504 }
505 private int bitField0_;
506
507 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
508 private void ensureVarsIsMutable() {
509 if (!vars_.isModifiable()) {
510 vars_ = makeMutableCopy(vars_);
511 }
512 bitField0_ |= 0x00000001;
513 }
518 public java.util.List<java.lang.Integer>
520 vars_.makeImmutable();
521 return vars_;
522 }
527 public int getVarsCount() {
528 return vars_.size();
529 }
535 public int getVars(int index) {
536 return vars_.getInt(index);
537 }
545 int index, int value) {
546
547 ensureVarsIsMutable();
548 vars_.setInt(index, value);
549 bitField0_ |= 0x00000001;
550 onChanged();
551 return this;
552 }
558 public Builder addVars(int value) {
559
560 ensureVarsIsMutable();
561 vars_.addInt(value);
562 bitField0_ |= 0x00000001;
563 onChanged();
564 return this;
565 }
572 java.lang.Iterable<? extends java.lang.Integer> values) {
573 ensureVarsIsMutable();
574 com.google.protobuf.AbstractMessageLite.Builder.addAll(
575 values, vars_);
576 bitField0_ |= 0x00000001;
577 onChanged();
578 return this;
579 }
585 vars_ = emptyIntList();
586 bitField0_ = (bitField0_ & ~0x00000001);
587 onChanged();
588 return this;
589 }
590
591 private com.google.protobuf.Internal.LongList values_ = emptyLongList();
592 private void ensureValuesIsMutable() {
593 if (!values_.isModifiable()) {
594 values_ = makeMutableCopy(values_);
595 }
596 bitField0_ |= 0x00000002;
597 }
602 public java.util.List<java.lang.Long>
604 values_.makeImmutable();
605 return values_;
606 }
611 public int getValuesCount() {
612 return values_.size();
613 }
619 public long getValues(int index) {
620 return values_.getLong(index);
621 }
629 int index, long value) {
630
631 ensureValuesIsMutable();
632 values_.setLong(index, value);
633 bitField0_ |= 0x00000002;
634 onChanged();
635 return this;
636 }
642 public Builder addValues(long value) {
643
644 ensureValuesIsMutable();
645 values_.addLong(value);
646 bitField0_ |= 0x00000002;
647 onChanged();
648 return this;
649 }
656 java.lang.Iterable<? extends java.lang.Long> values) {
657 ensureValuesIsMutable();
658 com.google.protobuf.AbstractMessageLite.Builder.addAll(
659 values, values_);
660 bitField0_ |= 0x00000002;
661 onChanged();
662 return this;
663 }
669 values_ = emptyLongList();
670 bitField0_ = (bitField0_ & ~0x00000002);
671 onChanged();
672 return this;
673 }
674
675 // @@protoc_insertion_point(builder_scope:operations_research.sat.PartialVariableAssignment)
676 }
677
678 // @@protoc_insertion_point(class_scope:operations_research.sat.PartialVariableAssignment)
679 private static final com.google.ortools.sat.PartialVariableAssignment DEFAULT_INSTANCE;
680 static {
681 DEFAULT_INSTANCE = new com.google.ortools.sat.PartialVariableAssignment();
682 }
683
685 return DEFAULT_INSTANCE;
686 }
687
688 private static final com.google.protobuf.Parser<PartialVariableAssignment>
689 PARSER = new com.google.protobuf.AbstractParser<PartialVariableAssignment>() {
690 @java.lang.Override
691 public PartialVariableAssignment parsePartialFrom(
692 com.google.protobuf.CodedInputStream input,
693 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
694 throws com.google.protobuf.InvalidProtocolBufferException {
695 Builder builder = newBuilder();
696 try {
697 builder.mergeFrom(input, extensionRegistry);
698 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
699 throw e.setUnfinishedMessage(builder.buildPartial());
700 } catch (com.google.protobuf.UninitializedMessageException e) {
701 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
702 } catch (java.io.IOException e) {
703 throw new com.google.protobuf.InvalidProtocolBufferException(e)
704 .setUnfinishedMessage(builder.buildPartial());
705 }
706 return builder.buildPartial();
707 }
708 };
709
710 public static com.google.protobuf.Parser<PartialVariableAssignment> parser() {
711 return PARSER;
712 }
713
714 @java.lang.Override
715 public com.google.protobuf.Parser<PartialVariableAssignment> getParserForType() {
716 return PARSER;
717 }
718
719 @java.lang.Override
723
724}
725
Builder addAllVars(java.lang.Iterable<? extends java.lang.Integer > values)
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
com.google.ortools.sat.PartialVariableAssignment build()
Builder mergeFrom(com.google.ortools.sat.PartialVariableAssignment other)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Builder addAllValues(java.lang.Iterable<? extends java.lang.Long > values)
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.sat.PartialVariableAssignment getDefaultInstanceForType()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
com.google.ortools.sat.PartialVariableAssignment buildPartial()
static com.google.ortools.sat.PartialVariableAssignment parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.sat.PartialVariableAssignment getDefaultInstanceForType()
static com.google.ortools.sat.PartialVariableAssignment parseFrom(byte[] data)
static com.google.ortools.sat.PartialVariableAssignment parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.Parser< PartialVariableAssignment > getParserForType()
static com.google.protobuf.Parser< PartialVariableAssignment > parser()
static com.google.ortools.sat.PartialVariableAssignment parseFrom(com.google.protobuf.ByteString data)
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
static com.google.ortools.sat.PartialVariableAssignment parseDelimitedFrom(java.io.InputStream input)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
static com.google.ortools.sat.PartialVariableAssignment parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
static com.google.ortools.sat.PartialVariableAssignment parseFrom(java.nio.ByteBuffer data)
static com.google.ortools.sat.PartialVariableAssignment parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static Builder newBuilder(com.google.ortools.sat.PartialVariableAssignment prototype)
static com.google.ortools.sat.PartialVariableAssignment parseFrom(com.google.protobuf.CodedInputStream input)
static com.google.ortools.sat.PartialVariableAssignment getDefaultInstance()
static com.google.ortools.sat.PartialVariableAssignment parseFrom(java.io.InputStream input)
void writeTo(com.google.protobuf.CodedOutputStream output)
static com.google.ortools.sat.PartialVariableAssignment parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.PartialVariableAssignment parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)