6package com.google.ortools.linearsolver;
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 varIndex_ = emptyIntList();
37 varValue_ = emptyDoubleList();
40 public static final com.google.protobuf.Descriptors.Descriptor
42 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_descriptor;
46 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
48 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_fieldAccessorTable
49 .ensureFieldAccessorsInitialized(
50 com.google.ortools.linearsolver.PartialVariableAssignment.class, com.google.ortools.linearsolver.PartialVariableAssignment.Builder.class);
54 @SuppressWarnings(
"serial")
55 private com.google.protobuf.Internal.IntList varIndex_ =
62 public java.
util.List<java.lang.Integer>
71 return varIndex_.size();
79 return varIndex_.getInt(index);
81 private int varIndexMemoizedSerializedSize = -1;
84 @SuppressWarnings(
"serial")
85 private com.google.protobuf.Internal.DoubleList varValue_ =
92 public java.
util.List<java.lang.Double>
101 return varValue_.size();
109 return varValue_.getDouble(index);
111 private int varValueMemoizedSerializedSize = -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(varIndexMemoizedSerializedSize);
132 for (
int i = 0; i < varIndex_.size(); i++) {
133 output.writeInt32NoTag(varIndex_.getInt(i));
136 output.writeUInt32NoTag(18);
137 output.writeUInt32NoTag(varValueMemoizedSerializedSize);
139 for (
int i = 0; i < varValue_.size(); i++) {
140 output.writeDoubleNoTag(varValue_.getDouble(i));
142 getUnknownFields().writeTo(output);
147 int size = memoizedSize;
148 if (size != -1)
return size;
153 for (
int i = 0; i < varIndex_.size(); i++) {
154 dataSize += com.google.protobuf.CodedOutputStream
155 .computeInt32SizeNoTag(varIndex_.getInt(i));
160 size += com.google.protobuf.CodedOutputStream
161 .computeInt32SizeNoTag(dataSize);
163 varIndexMemoizedSerializedSize = dataSize;
171 size += com.google.protobuf.CodedOutputStream
172 .computeInt32SizeNoTag(dataSize);
174 varValueMemoizedSerializedSize = dataSize;
176 size += getUnknownFields().getSerializedSize();
182 public boolean equals(
final java.lang.Object obj) {
186 if (!(obj instanceof com.google.ortools.linearsolver.PartialVariableAssignment)) {
187 return super.equals(obj);
195 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
201 if (memoizedHashCode != 0) {
202 return memoizedHashCode;
214 hash = (29 * hash) + getUnknownFields().hashCode();
215 memoizedHashCode = hash;
220 java.nio.ByteBuffer data)
221 throws com.google.protobuf.InvalidProtocolBufferException {
222 return PARSER.parseFrom(data);
225 java.nio.ByteBuffer data,
226 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
227 throws com.google.protobuf.InvalidProtocolBufferException {
228 return PARSER.parseFrom(data, extensionRegistry);
231 com.google.protobuf.ByteString data)
232 throws com.google.protobuf.InvalidProtocolBufferException {
233 return PARSER.parseFrom(data);
236 com.google.protobuf.ByteString data,
237 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
238 throws com.google.protobuf.InvalidProtocolBufferException {
239 return PARSER.parseFrom(data, extensionRegistry);
242 throws com.google.protobuf.InvalidProtocolBufferException {
243 return PARSER.parseFrom(data);
247 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
248 throws com.google.protobuf.InvalidProtocolBufferException {
249 return PARSER.parseFrom(data, extensionRegistry);
252 throws java.io.IOException {
253 return com.google.protobuf.GeneratedMessage
254 .parseWithIOException(PARSER, input);
257 java.io.InputStream input,
258 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
259 throws java.io.IOException {
260 return com.google.protobuf.GeneratedMessage
261 .parseWithIOException(PARSER, input, extensionRegistry);
265 throws java.io.IOException {
266 return com.google.protobuf.GeneratedMessage
267 .parseDelimitedWithIOException(PARSER, input);
271 java.io.InputStream input,
272 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
273 throws java.io.IOException {
274 return com.google.protobuf.GeneratedMessage
275 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
278 com.google.protobuf.CodedInputStream input)
279 throws java.io.IOException {
280 return com.google.protobuf.GeneratedMessage
281 .parseWithIOException(PARSER, input);
284 com.google.protobuf.CodedInputStream input,
285 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
286 throws java.io.IOException {
287 return com.google.protobuf.GeneratedMessage
288 .parseWithIOException(PARSER, input, extensionRegistry);
294 return DEFAULT_INSTANCE.toBuilder();
296 public static Builder newBuilder(com.google.ortools.linearsolver.PartialVariableAssignment prototype) {
297 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
301 return this == DEFAULT_INSTANCE
307 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
320 public static final class Builder
extends
321 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
324 public static final com.google.protobuf.Descriptors.Descriptor
326 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_descriptor;
330 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
332 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_fieldAccessorTable
333 .ensureFieldAccessorsInitialized(
334 com.google.ortools.linearsolver.PartialVariableAssignment.class, com.google.ortools.linearsolver.PartialVariableAssignment.Builder.class);
343 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
351 varIndex_ = emptyIntList();
352 varValue_ = emptyDoubleList();
357 public com.google.protobuf.Descriptors.Descriptor
359 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_descriptor;
364 return com.google.ortools.linearsolver.PartialVariableAssignment.getDefaultInstance();
371 throw newUninitializedMessageException(result);
379 if (bitField0_ != 0) { buildPartial0(result); }
384 private void buildPartial0(com.google.ortools.linearsolver.PartialVariableAssignment result) {
385 int from_bitField0_ = bitField0_;
386 if (((from_bitField0_ & 0x00000001) != 0)) {
387 varIndex_.makeImmutable();
388 result.varIndex_ = varIndex_;
390 if (((from_bitField0_ & 0x00000002) != 0)) {
391 varValue_.makeImmutable();
392 result.varValue_ = varValue_;
397 public Builder
mergeFrom(com.google.protobuf.Message other) {
398 if (other instanceof com.google.ortools.linearsolver.PartialVariableAssignment) {
399 return mergeFrom((com.google.ortools.linearsolver.PartialVariableAssignment)other);
401 super.mergeFrom(other);
406 public Builder
mergeFrom(com.google.ortools.linearsolver.PartialVariableAssignment other) {
407 if (other == com.google.ortools.linearsolver.PartialVariableAssignment.getDefaultInstance())
return this;
408 if (!other.varIndex_.isEmpty()) {
409 if (varIndex_.isEmpty()) {
410 varIndex_ = other.varIndex_;
411 varIndex_.makeImmutable();
412 bitField0_ |= 0x00000001;
414 ensureVarIndexIsMutable();
415 varIndex_.addAll(other.varIndex_);
419 if (!other.varValue_.isEmpty()) {
420 if (varValue_.isEmpty()) {
421 varValue_ = other.varValue_;
422 varValue_.makeImmutable();
423 bitField0_ |= 0x00000002;
425 ensureVarValueIsMutable();
426 varValue_.addAll(other.varValue_);
430 this.mergeUnknownFields(other.getUnknownFields());
442 com.google.protobuf.CodedInputStream input,
443 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
444 throws java.io.IOException {
445 if (extensionRegistry ==
null) {
446 throw new java.lang.NullPointerException();
449 boolean done =
false;
451 int tag = input.readTag();
457 int v = input.readInt32();
458 ensureVarIndexIsMutable();
463 int length = input.readRawVarint32();
464 int limit = input.pushLimit(length);
465 ensureVarIndexIsMutable();
466 while (input.getBytesUntilLimit() > 0) {
467 varIndex_.addInt(input.readInt32());
469 input.popLimit(limit);
473 double v = input.readDouble();
474 ensureVarValueIsMutable();
475 varValue_.addDouble(v);
479 int length = input.readRawVarint32();
480 int limit = input.pushLimit(length);
481 int alloc = length > 4096 ? 4096 : length;
482 ensureVarValueIsMutable(alloc / 8);
483 while (input.getBytesUntilLimit() > 0) {
484 varValue_.addDouble(input.readDouble());
486 input.popLimit(limit);
490 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
497 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
498 throw e.unwrapIOException();
504 private int bitField0_;
506 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
507 private void ensureVarIndexIsMutable() {
508 if (!varIndex_.isModifiable()) {
509 varIndex_ = makeMutableCopy(varIndex_);
511 bitField0_ |= 0x00000001;
517 public java.util.List<java.lang.Integer>
519 varIndex_.makeImmutable();
527 return varIndex_.size();
535 return varIndex_.getInt(index);
544 int index,
int value) {
546 ensureVarIndexIsMutable();
547 varIndex_.setInt(index, value);
548 bitField0_ |= 0x00000001;
559 ensureVarIndexIsMutable();
560 varIndex_.addInt(value);
561 bitField0_ |= 0x00000001;
571 java.lang.Iterable<? extends java.lang.Integer> values) {
572 ensureVarIndexIsMutable();
573 com.google.protobuf.AbstractMessageLite.Builder.addAll(
575 bitField0_ |= 0x00000001;
584 varIndex_ = emptyIntList();
585 bitField0_ = (bitField0_ & ~0x00000001);
590 private com.google.protobuf.Internal.DoubleList varValue_ = emptyDoubleList();
591 private void ensureVarValueIsMutable() {
592 if (!varValue_.isModifiable()) {
593 varValue_ = makeMutableCopy(varValue_);
595 bitField0_ |= 0x00000002;
597 private void ensureVarValueIsMutable(
int capacity) {
598 if (!varValue_.isModifiable()) {
599 varValue_ = makeMutableCopy(varValue_, capacity);
601 bitField0_ |= 0x00000002;
607 public java.util.List<java.lang.Double>
609 varValue_.makeImmutable();
617 return varValue_.size();
625 return varValue_.getDouble(index);
634 int index,
double value) {
636 ensureVarValueIsMutable();
637 varValue_.setDouble(index, value);
638 bitField0_ |= 0x00000002;
649 ensureVarValueIsMutable();
650 varValue_.addDouble(value);
651 bitField0_ |= 0x00000002;
661 java.lang.Iterable<? extends java.lang.Double> values) {
662 ensureVarValueIsMutable();
663 com.google.protobuf.AbstractMessageLite.Builder.addAll(
665 bitField0_ |= 0x00000002;
674 varValue_ = emptyDoubleList();
675 bitField0_ = (bitField0_ & ~0x00000002);
686 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.PartialVariableAssignment();
690 return DEFAULT_INSTANCE;
697 com.google.protobuf.CodedInputStream input,
698 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
699 throws com.google.protobuf.InvalidProtocolBufferException {
702 builder.mergeFrom(input, extensionRegistry);
703 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
704 throw e.setUnfinishedMessage(builder.buildPartial());
705 }
catch (com.google.protobuf.UninitializedMessageException e) {
706 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
707 }
catch (java.io.IOException e) {
708 throw new com.google.protobuf.InvalidProtocolBufferException(e)
709 .setUnfinishedMessage(builder.buildPartial());
711 return builder.buildPartial();
715 public static com.google.protobuf.Parser<PartialVariableAssignment>
parser() {
726 return DEFAULT_INSTANCE;