6package com.google.ortools.sat;
17public final class PartialVariableAssignment
extends
18 com.google.protobuf.GeneratedMessage implements
21private static final long serialVersionUID = 0L;
23 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
24 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
29 PartialVariableAssignment.class.getName());
32 private PartialVariableAssignment(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
35 private PartialVariableAssignment() {
36 vars_ = emptyIntList();
37 values_ = emptyLongList();
40 public static final com.google.protobuf.Descriptors.Descriptor
42 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_PartialVariableAssignment_descriptor;
46 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
48 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_PartialVariableAssignment_fieldAccessorTable
49 .ensureFieldAccessorsInitialized(
50 com.google.ortools.sat.PartialVariableAssignment.class, com.google.ortools.sat.PartialVariableAssignment.Builder.class);
54 @SuppressWarnings(
"serial")
55 private com.google.protobuf.Internal.IntList vars_ =
62 public java.
util.List<java.lang.Integer>
79 return vars_.getInt(index);
81 private int varsMemoizedSerializedSize = -1;
84 @SuppressWarnings(
"serial")
85 private com.google.protobuf.Internal.LongList values_ =
92 public java.
util.List<java.lang.Long>
101 return values_.size();
109 return values_.getLong(index);
111 private int valuesMemoizedSerializedSize = -1;
113 private byte memoizedIsInitialized = -1;
120 memoizedIsInitialized = 1;
125 public void writeTo(com.google.protobuf.CodedOutputStream output)
126 throws java.io.IOException {
129 output.writeUInt32NoTag(10);
130 output.writeUInt32NoTag(varsMemoizedSerializedSize);
132 for (
int i = 0; i < vars_.size(); i++) {
133 output.writeInt32NoTag(vars_.getInt(i));
136 output.writeUInt32NoTag(18);
137 output.writeUInt32NoTag(valuesMemoizedSerializedSize);
139 for (
int i = 0; i < values_.size(); i++) {
140 output.writeInt64NoTag(values_.getLong(i));
142 getUnknownFields().writeTo(output);
147 int size = memoizedSize;
148 if (size != -1)
return size;
153 for (
int i = 0; i < vars_.size(); i++) {
154 dataSize += com.google.protobuf.CodedOutputStream
155 .computeInt32SizeNoTag(vars_.getInt(i));
160 size += com.google.protobuf.CodedOutputStream
161 .computeInt32SizeNoTag(dataSize);
163 varsMemoizedSerializedSize = dataSize;
167 for (
int i = 0; i < values_.size(); i++) {
168 dataSize += com.google.protobuf.CodedOutputStream
169 .computeInt64SizeNoTag(values_.getLong(i));
174 size += com.google.protobuf.CodedOutputStream
175 .computeInt32SizeNoTag(dataSize);
177 valuesMemoizedSerializedSize = dataSize;
179 size += getUnknownFields().getSerializedSize();
185 public boolean equals(
final java.lang.Object obj) {
189 if (!(obj instanceof com.google.ortools.sat.PartialVariableAssignment)) {
190 return super.equals(obj);
198 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
204 if (memoizedHashCode != 0) {
205 return memoizedHashCode;
217 hash = (29 * hash) + getUnknownFields().hashCode();
218 memoizedHashCode = hash;
223 java.nio.ByteBuffer data)
224 throws com.google.protobuf.InvalidProtocolBufferException {
225 return PARSER.parseFrom(data);
228 java.nio.ByteBuffer data,
229 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
230 throws com.google.protobuf.InvalidProtocolBufferException {
231 return PARSER.parseFrom(data, extensionRegistry);
234 com.google.protobuf.ByteString data)
235 throws com.google.protobuf.InvalidProtocolBufferException {
236 return PARSER.parseFrom(data);
239 com.google.protobuf.ByteString data,
240 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
241 throws com.google.protobuf.InvalidProtocolBufferException {
242 return PARSER.parseFrom(data, extensionRegistry);
245 throws com.google.protobuf.InvalidProtocolBufferException {
246 return PARSER.parseFrom(data);
250 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
251 throws com.google.protobuf.InvalidProtocolBufferException {
252 return PARSER.parseFrom(data, extensionRegistry);
255 throws java.io.IOException {
256 return com.google.protobuf.GeneratedMessage
257 .parseWithIOException(PARSER, input);
260 java.io.InputStream input,
261 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
262 throws java.io.IOException {
263 return com.google.protobuf.GeneratedMessage
264 .parseWithIOException(PARSER, input, extensionRegistry);
268 throws java.io.IOException {
269 return com.google.protobuf.GeneratedMessage
270 .parseDelimitedWithIOException(PARSER, input);
274 java.io.InputStream input,
275 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
276 throws java.io.IOException {
277 return com.google.protobuf.GeneratedMessage
278 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
281 com.google.protobuf.CodedInputStream input)
282 throws java.io.IOException {
283 return com.google.protobuf.GeneratedMessage
284 .parseWithIOException(PARSER, input);
287 com.google.protobuf.CodedInputStream input,
288 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
289 throws java.io.IOException {
290 return com.google.protobuf.GeneratedMessage
291 .parseWithIOException(PARSER, input, extensionRegistry);
297 return DEFAULT_INSTANCE.toBuilder();
300 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
304 return this == DEFAULT_INSTANCE
310 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
323 public static final class Builder
extends
324 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
327 public static final com.google.protobuf.Descriptors.Descriptor
329 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_PartialVariableAssignment_descriptor;
333 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
335 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_PartialVariableAssignment_fieldAccessorTable
336 .ensureFieldAccessorsInitialized(
337 com.google.ortools.sat.PartialVariableAssignment.class, com.google.ortools.sat.PartialVariableAssignment.Builder.class);
346 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
354 vars_ = emptyIntList();
355 values_ = emptyLongList();
360 public com.google.protobuf.Descriptors.Descriptor
362 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_PartialVariableAssignment_descriptor;
367 return com.google.ortools.sat.PartialVariableAssignment.getDefaultInstance();
374 throw newUninitializedMessageException(result);
382 if (bitField0_ != 0) { buildPartial0(result); }
387 private void buildPartial0(com.google.ortools.sat.PartialVariableAssignment result) {
388 int from_bitField0_ = bitField0_;
389 if (((from_bitField0_ & 0x00000001) != 0)) {
390 vars_.makeImmutable();
391 result.vars_ = vars_;
393 if (((from_bitField0_ & 0x00000002) != 0)) {
394 values_.makeImmutable();
395 result.values_ = values_;
400 public Builder
mergeFrom(com.google.protobuf.Message other) {
401 if (other instanceof com.google.ortools.sat.PartialVariableAssignment) {
402 return mergeFrom((com.google.ortools.sat.PartialVariableAssignment)other);
404 super.mergeFrom(other);
409 public Builder
mergeFrom(com.google.ortools.sat.PartialVariableAssignment other) {
410 if (other == com.google.ortools.sat.PartialVariableAssignment.getDefaultInstance())
return this;
411 if (!other.vars_.isEmpty()) {
412 if (vars_.isEmpty()) {
414 vars_.makeImmutable();
415 bitField0_ |= 0x00000001;
417 ensureVarsIsMutable();
418 vars_.addAll(other.vars_);
422 if (!other.values_.isEmpty()) {
423 if (values_.isEmpty()) {
424 values_ = other.values_;
425 values_.makeImmutable();
426 bitField0_ |= 0x00000002;
428 ensureValuesIsMutable();
429 values_.addAll(other.values_);
433 this.mergeUnknownFields(other.getUnknownFields());
445 com.google.protobuf.CodedInputStream input,
446 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
447 throws java.io.IOException {
448 if (extensionRegistry ==
null) {
449 throw new java.lang.NullPointerException();
452 boolean done =
false;
454 int tag = input.readTag();
460 int v = input.readInt32();
461 ensureVarsIsMutable();
466 int length = input.readRawVarint32();
467 int limit = input.pushLimit(length);
468 ensureVarsIsMutable();
469 while (input.getBytesUntilLimit() > 0) {
470 vars_.addInt(input.readInt32());
472 input.popLimit(limit);
476 long v = input.readInt64();
477 ensureValuesIsMutable();
482 int length = input.readRawVarint32();
483 int limit = input.pushLimit(length);
484 ensureValuesIsMutable();
485 while (input.getBytesUntilLimit() > 0) {
486 values_.addLong(input.readInt64());
488 input.popLimit(limit);
492 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
499 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
500 throw e.unwrapIOException();
506 private int bitField0_;
508 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
509 private void ensureVarsIsMutable() {
510 if (!vars_.isModifiable()) {
511 vars_ = makeMutableCopy(vars_);
513 bitField0_ |= 0x00000001;
519 public java.util.List<java.lang.Integer>
521 vars_.makeImmutable();
537 return vars_.getInt(index);
546 int index,
int value) {
548 ensureVarsIsMutable();
549 vars_.setInt(index, value);
550 bitField0_ |= 0x00000001;
561 ensureVarsIsMutable();
563 bitField0_ |= 0x00000001;
573 java.lang.Iterable<? extends java.lang.Integer> values) {
574 ensureVarsIsMutable();
575 com.google.protobuf.AbstractMessageLite.Builder.addAll(
577 bitField0_ |= 0x00000001;
586 vars_ = emptyIntList();
587 bitField0_ = (bitField0_ & ~0x00000001);
592 private com.google.protobuf.Internal.LongList values_ = emptyLongList();
593 private void ensureValuesIsMutable() {
594 if (!values_.isModifiable()) {
595 values_ = makeMutableCopy(values_);
597 bitField0_ |= 0x00000002;
603 public java.util.List<java.lang.Long>
605 values_.makeImmutable();
613 return values_.size();
621 return values_.getLong(index);
630 int index,
long value) {
632 ensureValuesIsMutable();
633 values_.setLong(index, value);
634 bitField0_ |= 0x00000002;
645 ensureValuesIsMutable();
646 values_.addLong(value);
647 bitField0_ |= 0x00000002;
657 java.lang.Iterable<? extends java.lang.Long> values) {
658 ensureValuesIsMutable();
659 com.google.protobuf.AbstractMessageLite.Builder.addAll(
661 bitField0_ |= 0x00000002;
670 values_ = emptyLongList();
671 bitField0_ = (bitField0_ & ~0x00000002);
682 DEFAULT_INSTANCE =
new com.google.ortools.sat.PartialVariableAssignment();
686 return DEFAULT_INSTANCE;
693 com.google.protobuf.CodedInputStream input,
694 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
695 throws com.google.protobuf.InvalidProtocolBufferException {
698 builder.mergeFrom(input, extensionRegistry);
699 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
700 throw e.setUnfinishedMessage(builder.buildPartial());
701 }
catch (com.google.protobuf.UninitializedMessageException e) {
702 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
703 }
catch (java.io.IOException e) {
704 throw new com.google.protobuf.InvalidProtocolBufferException(e)
705 .setUnfinishedMessage(builder.buildPartial());
707 return builder.buildPartial();
711 public static com.google.protobuf.Parser<PartialVariableAssignment>
parser() {
722 return DEFAULT_INSTANCE;