5package com.google.ortools.linearsolver;
17 com.google.protobuf.GeneratedMessage implements
20private static final long serialVersionUID = 0L;
22 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
23 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
35 varIndex_ = emptyIntList();
36 varValue_ = emptyDoubleList();
39 public static final com.google.protobuf.Descriptors.Descriptor
41 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_descriptor;
45 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
47 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_fieldAccessorTable
48 .ensureFieldAccessorsInitialized(
49 com.google.ortools.linearsolver.PartialVariableAssignment.class, com.google.ortools.linearsolver.PartialVariableAssignment.Builder.class);
53 @SuppressWarnings(
"serial")
54 private com.google.protobuf.Internal.IntList varIndex_ =
61 public java.util.List<java.lang.Integer>
70 return varIndex_.size();
78 return varIndex_.getInt(index);
80 private int varIndexMemoizedSerializedSize = -1;
83 @SuppressWarnings(
"serial")
84 private com.google.protobuf.Internal.DoubleList varValue_ =
91 public java.util.List<java.lang.Double>
100 return varValue_.size();
108 return varValue_.getDouble(index);
110 private int varValueMemoizedSerializedSize = -1;
112 private byte memoizedIsInitialized = -1;
119 memoizedIsInitialized = 1;
124 public void writeTo(com.google.protobuf.CodedOutputStream output)
125 throws java.io.IOException {
128 output.writeUInt32NoTag(10);
129 output.writeUInt32NoTag(varIndexMemoizedSerializedSize);
131 for (
int i = 0; i < varIndex_.size(); i++) {
132 output.writeInt32NoTag(varIndex_.getInt(i));
135 output.writeUInt32NoTag(18);
136 output.writeUInt32NoTag(varValueMemoizedSerializedSize);
138 for (
int i = 0; i < varValue_.size(); i++) {
139 output.writeDoubleNoTag(varValue_.getDouble(i));
141 getUnknownFields().writeTo(output);
146 int size = memoizedSize;
147 if (size != -1)
return size;
152 for (
int i = 0; i < varIndex_.size(); i++) {
153 dataSize += com.google.protobuf.CodedOutputStream
154 .computeInt32SizeNoTag(varIndex_.getInt(i));
159 size += com.google.protobuf.CodedOutputStream
160 .computeInt32SizeNoTag(dataSize);
162 varIndexMemoizedSerializedSize = dataSize;
170 size += com.google.protobuf.CodedOutputStream
171 .computeInt32SizeNoTag(dataSize);
173 varValueMemoizedSerializedSize = dataSize;
175 size += getUnknownFields().getSerializedSize();
181 public boolean equals(
final java.lang.Object obj) {
185 if (!(obj instanceof com.google.ortools.linearsolver.PartialVariableAssignment)) {
186 return super.equals(obj);
194 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
200 if (memoizedHashCode != 0) {
201 return memoizedHashCode;
213 hash = (29 * hash) + getUnknownFields().hashCode();
214 memoizedHashCode = hash;
219 java.nio.ByteBuffer data)
220 throws com.google.protobuf.InvalidProtocolBufferException {
221 return PARSER.parseFrom(data);
224 java.nio.ByteBuffer data,
225 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
226 throws com.google.protobuf.InvalidProtocolBufferException {
227 return PARSER.parseFrom(data, extensionRegistry);
230 com.google.protobuf.ByteString data)
231 throws com.google.protobuf.InvalidProtocolBufferException {
232 return PARSER.parseFrom(data);
235 com.google.protobuf.ByteString data,
236 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
237 throws com.google.protobuf.InvalidProtocolBufferException {
238 return PARSER.parseFrom(data, extensionRegistry);
241 throws com.google.protobuf.InvalidProtocolBufferException {
242 return PARSER.parseFrom(data);
246 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
247 throws com.google.protobuf.InvalidProtocolBufferException {
248 return PARSER.parseFrom(data, extensionRegistry);
251 throws java.io.IOException {
252 return com.google.protobuf.GeneratedMessage
253 .parseWithIOException(PARSER, input);
256 java.io.InputStream input,
257 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
258 throws java.io.IOException {
259 return com.google.protobuf.GeneratedMessage
260 .parseWithIOException(PARSER, input, extensionRegistry);
264 throws java.io.IOException {
265 return com.google.protobuf.GeneratedMessage
266 .parseDelimitedWithIOException(PARSER, input);
270 java.io.InputStream input,
271 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
272 throws java.io.IOException {
273 return com.google.protobuf.GeneratedMessage
274 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
277 com.google.protobuf.CodedInputStream input)
278 throws java.io.IOException {
279 return com.google.protobuf.GeneratedMessage
280 .parseWithIOException(PARSER, input);
283 com.google.protobuf.CodedInputStream input,
284 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
285 throws java.io.IOException {
286 return com.google.protobuf.GeneratedMessage
287 .parseWithIOException(PARSER, input, extensionRegistry);
295 public static Builder newBuilder(com.google.ortools.linearsolver.PartialVariableAssignment prototype) {
300 return this == DEFAULT_INSTANCE
306 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
320 com.google.protobuf.GeneratedMessage.
Builder<Builder> implements
323 public static final com.google.protobuf.Descriptors.Descriptor
325 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_descriptor;
329 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
331 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_fieldAccessorTable
332 .ensureFieldAccessorsInitialized(
333 com.google.ortools.linearsolver.PartialVariableAssignment.class, com.google.ortools.linearsolver.PartialVariableAssignment.Builder.class);
342 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
350 varIndex_ = emptyIntList();
351 varValue_ = emptyDoubleList();
356 public com.google.protobuf.Descriptors.Descriptor
358 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_descriptor;
363 return com.google.ortools.linearsolver.PartialVariableAssignment.getDefaultInstance();
370 throw newUninitializedMessageException(result);
378 if (bitField0_ != 0) { buildPartial0(result); }
383 private void buildPartial0(com.google.ortools.linearsolver.PartialVariableAssignment result) {
384 int from_bitField0_ = bitField0_;
385 if (((from_bitField0_ & 0x00000001) != 0)) {
386 varIndex_.makeImmutable();
387 result.varIndex_ = varIndex_;
389 if (((from_bitField0_ & 0x00000002) != 0)) {
390 varValue_.makeImmutable();
391 result.varValue_ = varValue_;
397 if (other instanceof com.google.ortools.linearsolver.PartialVariableAssignment) {
398 return mergeFrom((com.google.ortools.linearsolver.PartialVariableAssignment)other);
400 super.mergeFrom(other);
405 public Builder mergeFrom(com.google.ortools.linearsolver.PartialVariableAssignment other) {
406 if (other == com.google.ortools.linearsolver.PartialVariableAssignment.getDefaultInstance())
return this;
407 if (!other.varIndex_.isEmpty()) {
408 if (varIndex_.isEmpty()) {
409 varIndex_ = other.varIndex_;
410 varIndex_.makeImmutable();
411 bitField0_ |= 0x00000001;
413 ensureVarIndexIsMutable();
414 varIndex_.addAll(other.varIndex_);
418 if (!other.varValue_.isEmpty()) {
419 if (varValue_.isEmpty()) {
420 varValue_ = other.varValue_;
421 varValue_.makeImmutable();
422 bitField0_ |= 0x00000002;
424 ensureVarValueIsMutable();
425 varValue_.addAll(other.varValue_);
429 this.mergeUnknownFields(other.getUnknownFields());
441 com.google.protobuf.CodedInputStream input,
442 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
443 throws java.io.IOException {
444 if (extensionRegistry ==
null) {
445 throw new java.lang.NullPointerException();
448 boolean done =
false;
450 int tag = input.readTag();
456 int v = input.readInt32();
457 ensureVarIndexIsMutable();
462 int length = input.readRawVarint32();
463 int limit = input.pushLimit(length);
464 ensureVarIndexIsMutable();
465 while (input.getBytesUntilLimit() > 0) {
466 varIndex_.addInt(input.readInt32());
468 input.popLimit(limit);
472 double v = input.readDouble();
473 ensureVarValueIsMutable();
474 varValue_.addDouble(v);
478 int length = input.readRawVarint32();
479 int limit = input.pushLimit(length);
480 int alloc = length > 4096 ? 4096 : length;
481 ensureVarValueIsMutable(alloc / 8);
482 while (input.getBytesUntilLimit() > 0) {
483 varValue_.addDouble(input.readDouble());
485 input.popLimit(limit);
489 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
496 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
497 throw e.unwrapIOException();
503 private int bitField0_;
505 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
506 private void ensureVarIndexIsMutable() {
507 if (!varIndex_.isModifiable()) {
508 varIndex_ = makeMutableCopy(varIndex_);
510 bitField0_ |= 0x00000001;
516 public java.util.List<java.lang.Integer>
518 varIndex_.makeImmutable();
526 return varIndex_.size();
534 return varIndex_.getInt(index);
543 int index,
int value) {
545 ensureVarIndexIsMutable();
546 varIndex_.setInt(index, value);
547 bitField0_ |= 0x00000001;
558 ensureVarIndexIsMutable();
559 varIndex_.addInt(value);
560 bitField0_ |= 0x00000001;
570 java.lang.Iterable<? extends java.lang.Integer> values) {
571 ensureVarIndexIsMutable();
572 com.google.protobuf.AbstractMessageLite.Builder.addAll(
574 bitField0_ |= 0x00000001;
583 varIndex_ = emptyIntList();
584 bitField0_ = (bitField0_ & ~0x00000001);
589 private com.google.protobuf.Internal.DoubleList varValue_ = emptyDoubleList();
590 private void ensureVarValueIsMutable() {
591 if (!varValue_.isModifiable()) {
592 varValue_ = makeMutableCopy(varValue_);
594 bitField0_ |= 0x00000002;
596 private void ensureVarValueIsMutable(
int capacity) {
597 if (!varValue_.isModifiable()) {
598 varValue_ = makeMutableCopy(varValue_, capacity);
600 bitField0_ |= 0x00000002;
606 public java.util.List<java.lang.Double>
608 varValue_.makeImmutable();
616 return varValue_.size();
624 return varValue_.getDouble(index);
633 int index,
double value) {
635 ensureVarValueIsMutable();
636 varValue_.setDouble(index, value);
637 bitField0_ |= 0x00000002;
648 ensureVarValueIsMutable();
649 varValue_.addDouble(value);
650 bitField0_ |= 0x00000002;
660 java.lang.Iterable<? extends java.lang.Double> values) {
661 ensureVarValueIsMutable();
662 com.google.protobuf.AbstractMessageLite.Builder.addAll(
664 bitField0_ |= 0x00000002;
673 varValue_ = emptyDoubleList();
674 bitField0_ = (bitField0_ & ~0x00000002);
685 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.PartialVariableAssignment();
689 return DEFAULT_INSTANCE;
696 com.google.protobuf.CodedInputStream input,
697 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
698 throws com.google.protobuf.InvalidProtocolBufferException {
701 builder.mergeFrom(input, extensionRegistry);
702 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
703 throw e.setUnfinishedMessage(builder.buildPartial());
704 }
catch (com.google.protobuf.UninitializedMessageException e) {
705 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
706 }
catch (java.io.IOException e) {
707 throw new com.google.protobuf.InvalidProtocolBufferException(e)
708 .setUnfinishedMessage(builder.buildPartial());
710 return builder.buildPartial();
725 return DEFAULT_INSTANCE;