6package com.google.ortools.sat;
17@com.google.protobuf.Generated
18public final class PartialVariableAssignment
extends
19 com.google.protobuf.GeneratedMessage implements
22private static final long serialVersionUID = 0L;
24 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
25 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
30 PartialVariableAssignment.class.getName());
33 private PartialVariableAssignment(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
36 private PartialVariableAssignment() {
37 vars_ = emptyIntList();
38 values_ = emptyLongList();
41 public static final com.google.protobuf.Descriptors.Descriptor
43 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_PartialVariableAssignment_descriptor;
47 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
49 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_PartialVariableAssignment_fieldAccessorTable
50 .ensureFieldAccessorsInitialized(
51 com.google.ortools.sat.PartialVariableAssignment.class, com.google.ortools.sat.PartialVariableAssignment.Builder.class);
55 @SuppressWarnings(
"serial")
56 private com.google.protobuf.Internal.IntList vars_ =
63 public java.
util.List<java.lang.Integer>
80 return vars_.getInt(index);
82 private int varsMemoizedSerializedSize = -1;
85 @SuppressWarnings(
"serial")
86 private com.google.protobuf.Internal.LongList values_ =
93 public java.
util.List<java.lang.Long>
102 return values_.size();
110 return values_.getLong(index);
112 private int valuesMemoizedSerializedSize = -1;
114 private byte memoizedIsInitialized = -1;
121 memoizedIsInitialized = 1;
126 public void writeTo(com.google.protobuf.CodedOutputStream output)
127 throws java.io.IOException {
130 output.writeUInt32NoTag(10);
131 output.writeUInt32NoTag(varsMemoizedSerializedSize);
133 for (
int i = 0; i < vars_.size(); i++) {
134 output.writeInt32NoTag(vars_.getInt(i));
137 output.writeUInt32NoTag(18);
138 output.writeUInt32NoTag(valuesMemoizedSerializedSize);
140 for (
int i = 0; i < values_.size(); i++) {
141 output.writeInt64NoTag(values_.getLong(i));
143 getUnknownFields().writeTo(output);
148 int size = memoizedSize;
149 if (size != -1)
return size;
154 for (
int i = 0; i < vars_.size(); i++) {
155 dataSize += com.google.protobuf.CodedOutputStream
156 .computeInt32SizeNoTag(vars_.getInt(i));
161 size += com.google.protobuf.CodedOutputStream
162 .computeInt32SizeNoTag(dataSize);
164 varsMemoizedSerializedSize = dataSize;
168 for (
int i = 0; i < values_.size(); i++) {
169 dataSize += com.google.protobuf.CodedOutputStream
170 .computeInt64SizeNoTag(values_.getLong(i));
175 size += com.google.protobuf.CodedOutputStream
176 .computeInt32SizeNoTag(dataSize);
178 valuesMemoizedSerializedSize = dataSize;
180 size += getUnknownFields().getSerializedSize();
186 public boolean equals(
final java.lang.Object obj) {
190 if (!(obj instanceof com.google.ortools.sat.PartialVariableAssignment)) {
191 return super.equals(obj);
199 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
205 if (memoizedHashCode != 0) {
206 return memoizedHashCode;
218 hash = (29 * hash) + getUnknownFields().hashCode();
219 memoizedHashCode = hash;
224 java.nio.ByteBuffer data)
225 throws com.google.protobuf.InvalidProtocolBufferException {
226 return PARSER.parseFrom(data);
229 java.nio.ByteBuffer data,
230 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
231 throws com.google.protobuf.InvalidProtocolBufferException {
232 return PARSER.parseFrom(data, extensionRegistry);
235 com.google.protobuf.ByteString data)
236 throws com.google.protobuf.InvalidProtocolBufferException {
237 return PARSER.parseFrom(data);
240 com.google.protobuf.ByteString data,
241 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
242 throws com.google.protobuf.InvalidProtocolBufferException {
243 return PARSER.parseFrom(data, extensionRegistry);
246 throws com.google.protobuf.InvalidProtocolBufferException {
247 return PARSER.parseFrom(data);
251 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
252 throws com.google.protobuf.InvalidProtocolBufferException {
253 return PARSER.parseFrom(data, extensionRegistry);
256 throws java.io.IOException {
257 return com.google.protobuf.GeneratedMessage
258 .parseWithIOException(PARSER, input);
261 java.io.InputStream input,
262 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
263 throws java.io.IOException {
264 return com.google.protobuf.GeneratedMessage
265 .parseWithIOException(PARSER, input, extensionRegistry);
269 throws java.io.IOException {
270 return com.google.protobuf.GeneratedMessage
271 .parseDelimitedWithIOException(PARSER, input);
275 java.io.InputStream input,
276 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
277 throws java.io.IOException {
278 return com.google.protobuf.GeneratedMessage
279 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
282 com.google.protobuf.CodedInputStream input)
283 throws java.io.IOException {
284 return com.google.protobuf.GeneratedMessage
285 .parseWithIOException(PARSER, input);
288 com.google.protobuf.CodedInputStream input,
289 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
290 throws java.io.IOException {
291 return com.google.protobuf.GeneratedMessage
292 .parseWithIOException(PARSER, input, extensionRegistry);
298 return DEFAULT_INSTANCE.toBuilder();
301 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
305 return this == DEFAULT_INSTANCE
311 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
324 public static final class Builder
extends
325 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
328 public static final com.google.protobuf.Descriptors.Descriptor
330 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_PartialVariableAssignment_descriptor;
334 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
336 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_PartialVariableAssignment_fieldAccessorTable
337 .ensureFieldAccessorsInitialized(
338 com.google.ortools.sat.PartialVariableAssignment.class, com.google.ortools.sat.PartialVariableAssignment.Builder.class);
347 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
355 vars_ = emptyIntList();
356 values_ = emptyLongList();
361 public com.google.protobuf.Descriptors.Descriptor
363 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_PartialVariableAssignment_descriptor;
368 return com.google.ortools.sat.PartialVariableAssignment.getDefaultInstance();
375 throw newUninitializedMessageException(result);
383 if (bitField0_ != 0) { buildPartial0(result); }
388 private void buildPartial0(com.google.ortools.sat.PartialVariableAssignment result) {
389 int from_bitField0_ = bitField0_;
390 if (((from_bitField0_ & 0x00000001) != 0)) {
391 vars_.makeImmutable();
392 result.vars_ = vars_;
394 if (((from_bitField0_ & 0x00000002) != 0)) {
395 values_.makeImmutable();
396 result.values_ = values_;
401 public Builder
mergeFrom(com.google.protobuf.Message other) {
402 if (other instanceof com.google.ortools.sat.PartialVariableAssignment) {
403 return mergeFrom((com.google.ortools.sat.PartialVariableAssignment)other);
405 super.mergeFrom(other);
410 public Builder
mergeFrom(com.google.ortools.sat.PartialVariableAssignment other) {
411 if (other == com.google.ortools.sat.PartialVariableAssignment.getDefaultInstance())
return this;
412 if (!other.vars_.isEmpty()) {
413 if (vars_.isEmpty()) {
415 vars_.makeImmutable();
416 bitField0_ |= 0x00000001;
418 ensureVarsIsMutable();
419 vars_.addAll(other.vars_);
423 if (!other.values_.isEmpty()) {
424 if (values_.isEmpty()) {
425 values_ = other.values_;
426 values_.makeImmutable();
427 bitField0_ |= 0x00000002;
429 ensureValuesIsMutable();
430 values_.addAll(other.values_);
434 this.mergeUnknownFields(other.getUnknownFields());
446 com.google.protobuf.CodedInputStream input,
447 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
448 throws java.io.IOException {
449 if (extensionRegistry ==
null) {
450 throw new java.lang.NullPointerException();
453 boolean done =
false;
455 int tag = input.readTag();
461 int v = input.readInt32();
462 ensureVarsIsMutable();
467 int length = input.readRawVarint32();
468 int limit = input.pushLimit(length);
469 ensureVarsIsMutable();
470 while (input.getBytesUntilLimit() > 0) {
471 vars_.addInt(input.readInt32());
473 input.popLimit(limit);
477 long v = input.readInt64();
478 ensureValuesIsMutable();
483 int length = input.readRawVarint32();
484 int limit = input.pushLimit(length);
485 ensureValuesIsMutable();
486 while (input.getBytesUntilLimit() > 0) {
487 values_.addLong(input.readInt64());
489 input.popLimit(limit);
493 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
500 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
501 throw e.unwrapIOException();
507 private int bitField0_;
509 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
510 private void ensureVarsIsMutable() {
511 if (!vars_.isModifiable()) {
512 vars_ = makeMutableCopy(vars_);
514 bitField0_ |= 0x00000001;
520 public java.util.List<java.lang.Integer>
522 vars_.makeImmutable();
538 return vars_.getInt(index);
547 int index,
int value) {
549 ensureVarsIsMutable();
550 vars_.setInt(index, value);
551 bitField0_ |= 0x00000001;
562 ensureVarsIsMutable();
564 bitField0_ |= 0x00000001;
574 java.lang.Iterable<? extends java.lang.Integer> values) {
575 ensureVarsIsMutable();
576 com.google.protobuf.AbstractMessageLite.Builder.addAll(
578 bitField0_ |= 0x00000001;
587 vars_ = emptyIntList();
588 bitField0_ = (bitField0_ & ~0x00000001);
593 private com.google.protobuf.Internal.LongList values_ = emptyLongList();
594 private void ensureValuesIsMutable() {
595 if (!values_.isModifiable()) {
596 values_ = makeMutableCopy(values_);
598 bitField0_ |= 0x00000002;
604 public java.util.List<java.lang.Long>
606 values_.makeImmutable();
614 return values_.size();
622 return values_.getLong(index);
631 int index,
long value) {
633 ensureValuesIsMutable();
634 values_.setLong(index, value);
635 bitField0_ |= 0x00000002;
646 ensureValuesIsMutable();
647 values_.addLong(value);
648 bitField0_ |= 0x00000002;
658 java.lang.Iterable<? extends java.lang.Long> values) {
659 ensureValuesIsMutable();
660 com.google.protobuf.AbstractMessageLite.Builder.addAll(
662 bitField0_ |= 0x00000002;
671 values_ = emptyLongList();
672 bitField0_ = (bitField0_ & ~0x00000002);
683 DEFAULT_INSTANCE =
new com.google.ortools.sat.PartialVariableAssignment();
687 return DEFAULT_INSTANCE;
694 com.google.protobuf.CodedInputStream input,
695 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
696 throws com.google.protobuf.InvalidProtocolBufferException {
699 builder.mergeFrom(input, extensionRegistry);
700 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
701 throw e.setUnfinishedMessage(builder.buildPartial());
702 }
catch (com.google.protobuf.UninitializedMessageException e) {
703 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
704 }
catch (java.io.IOException e) {
705 throw new com.google.protobuf.InvalidProtocolBufferException(e)
706 .setUnfinishedMessage(builder.buildPartial());
708 return builder.buildPartial();
712 public static com.google.protobuf.Parser<PartialVariableAssignment>
parser() {
723 return DEFAULT_INSTANCE;