6package com.google.ortools.linearsolver;
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 varIndex_ = emptyIntList();
38 varValue_ = emptyDoubleList();
41 public static final com.google.protobuf.Descriptors.Descriptor
43 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_descriptor;
47 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
49 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_fieldAccessorTable
50 .ensureFieldAccessorsInitialized(
51 com.google.ortools.linearsolver.PartialVariableAssignment.class, com.google.ortools.linearsolver.PartialVariableAssignment.Builder.class);
55 @SuppressWarnings(
"serial")
56 private com.google.protobuf.Internal.IntList varIndex_ =
63 public java.
util.List<java.lang.Integer>
72 return varIndex_.size();
80 return varIndex_.getInt(index);
82 private int varIndexMemoizedSerializedSize = -1;
85 @SuppressWarnings(
"serial")
86 private com.google.protobuf.Internal.DoubleList varValue_ =
93 public java.
util.List<java.lang.Double>
102 return varValue_.size();
110 return varValue_.getDouble(index);
112 private int varValueMemoizedSerializedSize = -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(varIndexMemoizedSerializedSize);
133 for (
int i = 0; i < varIndex_.size(); i++) {
134 output.writeInt32NoTag(varIndex_.getInt(i));
137 output.writeUInt32NoTag(18);
138 output.writeUInt32NoTag(varValueMemoizedSerializedSize);
140 for (
int i = 0; i < varValue_.size(); i++) {
141 output.writeDoubleNoTag(varValue_.getDouble(i));
143 getUnknownFields().writeTo(output);
148 int size = memoizedSize;
149 if (size != -1)
return size;
154 for (
int i = 0; i < varIndex_.size(); i++) {
155 dataSize += com.google.protobuf.CodedOutputStream
156 .computeInt32SizeNoTag(varIndex_.getInt(i));
161 size += com.google.protobuf.CodedOutputStream
162 .computeInt32SizeNoTag(dataSize);
164 varIndexMemoizedSerializedSize = dataSize;
172 size += com.google.protobuf.CodedOutputStream
173 .computeInt32SizeNoTag(dataSize);
175 varValueMemoizedSerializedSize = dataSize;
177 size += getUnknownFields().getSerializedSize();
183 public boolean equals(
final java.lang.Object obj) {
187 if (!(obj instanceof com.google.ortools.linearsolver.PartialVariableAssignment)) {
188 return super.equals(obj);
196 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
202 if (memoizedHashCode != 0) {
203 return memoizedHashCode;
215 hash = (29 * hash) + getUnknownFields().hashCode();
216 memoizedHashCode = hash;
221 java.nio.ByteBuffer data)
222 throws com.google.protobuf.InvalidProtocolBufferException {
223 return PARSER.parseFrom(data);
226 java.nio.ByteBuffer data,
227 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
228 throws com.google.protobuf.InvalidProtocolBufferException {
229 return PARSER.parseFrom(data, extensionRegistry);
232 com.google.protobuf.ByteString data)
233 throws com.google.protobuf.InvalidProtocolBufferException {
234 return PARSER.parseFrom(data);
237 com.google.protobuf.ByteString data,
238 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
239 throws com.google.protobuf.InvalidProtocolBufferException {
240 return PARSER.parseFrom(data, extensionRegistry);
243 throws com.google.protobuf.InvalidProtocolBufferException {
244 return PARSER.parseFrom(data);
248 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
249 throws com.google.protobuf.InvalidProtocolBufferException {
250 return PARSER.parseFrom(data, extensionRegistry);
253 throws java.io.IOException {
254 return com.google.protobuf.GeneratedMessage
255 .parseWithIOException(PARSER, input);
258 java.io.InputStream input,
259 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
260 throws java.io.IOException {
261 return com.google.protobuf.GeneratedMessage
262 .parseWithIOException(PARSER, input, extensionRegistry);
266 throws java.io.IOException {
267 return com.google.protobuf.GeneratedMessage
268 .parseDelimitedWithIOException(PARSER, input);
272 java.io.InputStream input,
273 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
274 throws java.io.IOException {
275 return com.google.protobuf.GeneratedMessage
276 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
279 com.google.protobuf.CodedInputStream input)
280 throws java.io.IOException {
281 return com.google.protobuf.GeneratedMessage
282 .parseWithIOException(PARSER, input);
285 com.google.protobuf.CodedInputStream input,
286 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
287 throws java.io.IOException {
288 return com.google.protobuf.GeneratedMessage
289 .parseWithIOException(PARSER, input, extensionRegistry);
295 return DEFAULT_INSTANCE.toBuilder();
297 public static Builder newBuilder(com.google.ortools.linearsolver.PartialVariableAssignment prototype) {
298 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
302 return this == DEFAULT_INSTANCE
308 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
321 public static final class Builder
extends
322 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
325 public static final com.google.protobuf.Descriptors.Descriptor
327 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_descriptor;
331 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
333 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_fieldAccessorTable
334 .ensureFieldAccessorsInitialized(
335 com.google.ortools.linearsolver.PartialVariableAssignment.class, com.google.ortools.linearsolver.PartialVariableAssignment.Builder.class);
344 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
352 varIndex_ = emptyIntList();
353 varValue_ = emptyDoubleList();
358 public com.google.protobuf.Descriptors.Descriptor
360 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_descriptor;
365 return com.google.ortools.linearsolver.PartialVariableAssignment.getDefaultInstance();
372 throw newUninitializedMessageException(result);
380 if (bitField0_ != 0) { buildPartial0(result); }
385 private void buildPartial0(com.google.ortools.linearsolver.PartialVariableAssignment result) {
386 int from_bitField0_ = bitField0_;
387 if (((from_bitField0_ & 0x00000001) != 0)) {
388 varIndex_.makeImmutable();
389 result.varIndex_ = varIndex_;
391 if (((from_bitField0_ & 0x00000002) != 0)) {
392 varValue_.makeImmutable();
393 result.varValue_ = varValue_;
398 public Builder
mergeFrom(com.google.protobuf.Message other) {
399 if (other instanceof com.google.ortools.linearsolver.PartialVariableAssignment) {
400 return mergeFrom((com.google.ortools.linearsolver.PartialVariableAssignment)other);
402 super.mergeFrom(other);
407 public Builder
mergeFrom(com.google.ortools.linearsolver.PartialVariableAssignment other) {
408 if (other == com.google.ortools.linearsolver.PartialVariableAssignment.getDefaultInstance())
return this;
409 if (!other.varIndex_.isEmpty()) {
410 if (varIndex_.isEmpty()) {
411 varIndex_ = other.varIndex_;
412 varIndex_.makeImmutable();
413 bitField0_ |= 0x00000001;
415 ensureVarIndexIsMutable();
416 varIndex_.addAll(other.varIndex_);
420 if (!other.varValue_.isEmpty()) {
421 if (varValue_.isEmpty()) {
422 varValue_ = other.varValue_;
423 varValue_.makeImmutable();
424 bitField0_ |= 0x00000002;
426 ensureVarValueIsMutable();
427 varValue_.addAll(other.varValue_);
431 this.mergeUnknownFields(other.getUnknownFields());
443 com.google.protobuf.CodedInputStream input,
444 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
445 throws java.io.IOException {
446 if (extensionRegistry ==
null) {
447 throw new java.lang.NullPointerException();
450 boolean done =
false;
452 int tag = input.readTag();
458 int v = input.readInt32();
459 ensureVarIndexIsMutable();
464 int length = input.readRawVarint32();
465 int limit = input.pushLimit(length);
466 ensureVarIndexIsMutable();
467 while (input.getBytesUntilLimit() > 0) {
468 varIndex_.addInt(input.readInt32());
470 input.popLimit(limit);
474 double v = input.readDouble();
475 ensureVarValueIsMutable();
476 varValue_.addDouble(v);
480 int length = input.readRawVarint32();
481 int limit = input.pushLimit(length);
482 int alloc = length > 4096 ? 4096 : length;
483 ensureVarValueIsMutable(alloc / 8);
484 while (input.getBytesUntilLimit() > 0) {
485 varValue_.addDouble(input.readDouble());
487 input.popLimit(limit);
491 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
498 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
499 throw e.unwrapIOException();
505 private int bitField0_;
507 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
508 private void ensureVarIndexIsMutable() {
509 if (!varIndex_.isModifiable()) {
510 varIndex_ = makeMutableCopy(varIndex_);
512 bitField0_ |= 0x00000001;
518 public java.util.List<java.lang.Integer>
520 varIndex_.makeImmutable();
528 return varIndex_.size();
536 return varIndex_.getInt(index);
545 int index,
int value) {
547 ensureVarIndexIsMutable();
548 varIndex_.setInt(index, value);
549 bitField0_ |= 0x00000001;
560 ensureVarIndexIsMutable();
561 varIndex_.addInt(value);
562 bitField0_ |= 0x00000001;
572 java.lang.Iterable<? extends java.lang.Integer> values) {
573 ensureVarIndexIsMutable();
574 com.google.protobuf.AbstractMessageLite.Builder.addAll(
576 bitField0_ |= 0x00000001;
585 varIndex_ = emptyIntList();
586 bitField0_ = (bitField0_ & ~0x00000001);
591 private com.google.protobuf.Internal.DoubleList varValue_ = emptyDoubleList();
592 private void ensureVarValueIsMutable() {
593 if (!varValue_.isModifiable()) {
594 varValue_ = makeMutableCopy(varValue_);
596 bitField0_ |= 0x00000002;
598 private void ensureVarValueIsMutable(
int capacity) {
599 if (!varValue_.isModifiable()) {
600 varValue_ = makeMutableCopy(varValue_, capacity);
602 bitField0_ |= 0x00000002;
608 public java.util.List<java.lang.Double>
610 varValue_.makeImmutable();
618 return varValue_.size();
626 return varValue_.getDouble(index);
635 int index,
double value) {
637 ensureVarValueIsMutable();
638 varValue_.setDouble(index, value);
639 bitField0_ |= 0x00000002;
650 ensureVarValueIsMutable();
651 varValue_.addDouble(value);
652 bitField0_ |= 0x00000002;
662 java.lang.Iterable<? extends java.lang.Double> values) {
663 ensureVarValueIsMutable();
664 com.google.protobuf.AbstractMessageLite.Builder.addAll(
666 bitField0_ |= 0x00000002;
675 varValue_ = emptyDoubleList();
676 bitField0_ = (bitField0_ & ~0x00000002);
687 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.PartialVariableAssignment();
691 return DEFAULT_INSTANCE;
698 com.google.protobuf.CodedInputStream input,
699 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
700 throws com.google.protobuf.InvalidProtocolBufferException {
703 builder.mergeFrom(input, extensionRegistry);
704 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
705 throw e.setUnfinishedMessage(builder.buildPartial());
706 }
catch (com.google.protobuf.UninitializedMessageException e) {
707 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
708 }
catch (java.io.IOException e) {
709 throw new com.google.protobuf.InvalidProtocolBufferException(e)
710 .setUnfinishedMessage(builder.buildPartial());
712 return builder.buildPartial();
716 public static com.google.protobuf.Parser<PartialVariableAssignment>
parser() {
727 return DEFAULT_INSTANCE;