6package com.google.ortools.linearsolver;
16public final class MPArrayWithConstantConstraint
extends
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,
28 MPArrayWithConstantConstraint.class.getName());
31 private MPArrayWithConstantConstraint(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
34 private MPArrayWithConstantConstraint() {
35 varIndex_ = emptyIntList();
38 public static final com.google.protobuf.Descriptors.Descriptor
40 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayWithConstantConstraint_descriptor;
44 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
46 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayWithConstantConstraint_fieldAccessorTable
47 .ensureFieldAccessorsInitialized(
48 com.google.ortools.linearsolver.MPArrayWithConstantConstraint.class, com.google.ortools.linearsolver.MPArrayWithConstantConstraint.Builder.class);
51 private int bitField0_;
53 @SuppressWarnings(
"serial")
54 private com.google.protobuf.Internal.IntList varIndex_ =
66 public java.
util.List<java.lang.Integer>
80 return varIndex_.size();
93 return varIndex_.getInt(index);
97 private double constant_ = 0D;
104 return ((bitField0_ & 0x00000001) != 0);
116 private int resultantVarIndex_ = 0;
123 return ((bitField0_ & 0x00000002) != 0);
131 return resultantVarIndex_;
134 private byte memoizedIsInitialized = -1;
141 memoizedIsInitialized = 1;
146 public void writeTo(com.google.protobuf.CodedOutputStream output)
147 throws java.io.IOException {
148 for (
int i = 0; i < varIndex_.size(); i++) {
149 output.writeInt32(1, varIndex_.getInt(i));
151 if (((bitField0_ & 0x00000001) != 0)) {
152 output.writeDouble(2, constant_);
154 if (((bitField0_ & 0x00000002) != 0)) {
155 output.writeInt32(3, resultantVarIndex_);
157 getUnknownFields().writeTo(output);
162 int size = memoizedSize;
163 if (size != -1)
return size;
168 for (
int i = 0; i < varIndex_.size(); i++) {
169 dataSize += com.google.protobuf.CodedOutputStream
170 .computeInt32SizeNoTag(varIndex_.getInt(i));
175 if (((bitField0_ & 0x00000001) != 0)) {
176 size += com.google.protobuf.CodedOutputStream
177 .computeDoubleSize(2, constant_);
179 if (((bitField0_ & 0x00000002) != 0)) {
180 size += com.google.protobuf.CodedOutputStream
181 .computeInt32Size(3, resultantVarIndex_);
183 size += getUnknownFields().getSerializedSize();
189 public boolean equals(
final java.lang.Object obj) {
193 if (!(obj instanceof com.google.ortools.linearsolver.MPArrayWithConstantConstraint)) {
194 return super.equals(obj);
202 if (java.lang.Double.doubleToLongBits(
getConstant())
203 != java.lang.Double.doubleToLongBits(
211 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
217 if (memoizedHashCode != 0) {
218 return memoizedHashCode;
228 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
235 hash = (29 * hash) + getUnknownFields().hashCode();
236 memoizedHashCode = hash;
241 java.nio.ByteBuffer data)
242 throws com.google.protobuf.InvalidProtocolBufferException {
243 return PARSER.parseFrom(data);
246 java.nio.ByteBuffer data,
247 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
248 throws com.google.protobuf.InvalidProtocolBufferException {
249 return PARSER.parseFrom(data, extensionRegistry);
252 com.google.protobuf.ByteString data)
253 throws com.google.protobuf.InvalidProtocolBufferException {
254 return PARSER.parseFrom(data);
257 com.google.protobuf.ByteString data,
258 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
259 throws com.google.protobuf.InvalidProtocolBufferException {
260 return PARSER.parseFrom(data, extensionRegistry);
263 throws com.google.protobuf.InvalidProtocolBufferException {
264 return PARSER.parseFrom(data);
268 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
269 throws com.google.protobuf.InvalidProtocolBufferException {
270 return PARSER.parseFrom(data, extensionRegistry);
273 throws java.io.IOException {
274 return com.google.protobuf.GeneratedMessage
275 .parseWithIOException(PARSER, input);
278 java.io.InputStream input,
279 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
280 throws java.io.IOException {
281 return com.google.protobuf.GeneratedMessage
282 .parseWithIOException(PARSER, input, extensionRegistry);
286 throws java.io.IOException {
287 return com.google.protobuf.GeneratedMessage
288 .parseDelimitedWithIOException(PARSER, input);
292 java.io.InputStream input,
293 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
294 throws java.io.IOException {
295 return com.google.protobuf.GeneratedMessage
296 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
299 com.google.protobuf.CodedInputStream input)
300 throws java.io.IOException {
301 return com.google.protobuf.GeneratedMessage
302 .parseWithIOException(PARSER, input);
305 com.google.protobuf.CodedInputStream input,
306 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
307 throws java.io.IOException {
308 return com.google.protobuf.GeneratedMessage
309 .parseWithIOException(PARSER, input, extensionRegistry);
315 return DEFAULT_INSTANCE.toBuilder();
317 public static Builder newBuilder(com.google.ortools.linearsolver.MPArrayWithConstantConstraint prototype) {
318 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
322 return this == DEFAULT_INSTANCE
328 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
340 public static final class Builder
extends
341 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
344 public static final com.google.protobuf.Descriptors.Descriptor
346 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayWithConstantConstraint_descriptor;
350 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
352 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayWithConstantConstraint_fieldAccessorTable
353 .ensureFieldAccessorsInitialized(
354 com.google.ortools.linearsolver.MPArrayWithConstantConstraint.class, com.google.ortools.linearsolver.MPArrayWithConstantConstraint.Builder.class);
363 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
371 varIndex_ = emptyIntList();
373 resultantVarIndex_ = 0;
378 public com.google.protobuf.Descriptors.Descriptor
380 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayWithConstantConstraint_descriptor;
385 return com.google.ortools.linearsolver.MPArrayWithConstantConstraint.getDefaultInstance();
392 throw newUninitializedMessageException(result);
400 if (bitField0_ != 0) { buildPartial0(result); }
405 private void buildPartial0(com.google.ortools.linearsolver.MPArrayWithConstantConstraint result) {
406 int from_bitField0_ = bitField0_;
407 if (((from_bitField0_ & 0x00000001) != 0)) {
408 varIndex_.makeImmutable();
409 result.varIndex_ = varIndex_;
411 int to_bitField0_ = 0;
412 if (((from_bitField0_ & 0x00000002) != 0)) {
413 result.constant_ = constant_;
414 to_bitField0_ |= 0x00000001;
416 if (((from_bitField0_ & 0x00000004) != 0)) {
417 result.resultantVarIndex_ = resultantVarIndex_;
418 to_bitField0_ |= 0x00000002;
420 result.bitField0_ |= to_bitField0_;
424 public Builder
mergeFrom(com.google.protobuf.Message other) {
425 if (other instanceof com.google.ortools.linearsolver.MPArrayWithConstantConstraint) {
426 return mergeFrom((com.google.ortools.linearsolver.MPArrayWithConstantConstraint)other);
428 super.mergeFrom(other);
433 public Builder
mergeFrom(com.google.ortools.linearsolver.MPArrayWithConstantConstraint other) {
434 if (other == com.google.ortools.linearsolver.MPArrayWithConstantConstraint.getDefaultInstance())
return this;
435 if (!other.varIndex_.isEmpty()) {
436 if (varIndex_.isEmpty()) {
437 varIndex_ = other.varIndex_;
438 varIndex_.makeImmutable();
439 bitField0_ |= 0x00000001;
441 ensureVarIndexIsMutable();
442 varIndex_.addAll(other.varIndex_);
446 if (other.hasConstant()) {
449 if (other.hasResultantVarIndex()) {
452 this.mergeUnknownFields(other.getUnknownFields());
464 com.google.protobuf.CodedInputStream input,
465 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
466 throws java.io.IOException {
467 if (extensionRegistry ==
null) {
468 throw new java.lang.NullPointerException();
471 boolean done =
false;
473 int tag = input.readTag();
479 int v = input.readInt32();
480 ensureVarIndexIsMutable();
485 int length = input.readRawVarint32();
486 int limit = input.pushLimit(length);
487 ensureVarIndexIsMutable();
488 while (input.getBytesUntilLimit() > 0) {
489 varIndex_.addInt(input.readInt32());
491 input.popLimit(limit);
495 constant_ = input.readDouble();
496 bitField0_ |= 0x00000002;
500 resultantVarIndex_ = input.readInt32();
501 bitField0_ |= 0x00000004;
505 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
512 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
513 throw e.unwrapIOException();
519 private int bitField0_;
521 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
522 private void ensureVarIndexIsMutable() {
523 if (!varIndex_.isModifiable()) {
524 varIndex_ = makeMutableCopy(varIndex_);
526 bitField0_ |= 0x00000001;
537 public java.util.List<java.lang.Integer>
539 varIndex_.makeImmutable();
552 return varIndex_.size();
565 return varIndex_.getInt(index);
579 int index,
int value) {
581 ensureVarIndexIsMutable();
582 varIndex_.setInt(index, value);
583 bitField0_ |= 0x00000001;
599 ensureVarIndexIsMutable();
600 varIndex_.addInt(value);
601 bitField0_ |= 0x00000001;
616 java.lang.Iterable<? extends java.lang.Integer> values) {
617 ensureVarIndexIsMutable();
618 com.google.protobuf.AbstractMessageLite.Builder.addAll(
620 bitField0_ |= 0x00000001;
634 varIndex_ = emptyIntList();
635 bitField0_ = (bitField0_ & ~0x00000001);
640 private double constant_ ;
647 return ((bitField0_ & 0x00000002) != 0);
665 bitField0_ |= 0x00000002;
674 bitField0_ = (bitField0_ & ~0x00000002);
680 private int resultantVarIndex_ ;
687 return ((bitField0_ & 0x00000004) != 0);
695 return resultantVarIndex_;
704 resultantVarIndex_ = value;
705 bitField0_ |= 0x00000004;
714 bitField0_ = (bitField0_ & ~0x00000004);
715 resultantVarIndex_ = 0;
726 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPArrayWithConstantConstraint();
730 return DEFAULT_INSTANCE;
737 com.google.protobuf.CodedInputStream input,
738 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
739 throws com.google.protobuf.InvalidProtocolBufferException {
742 builder.mergeFrom(input, extensionRegistry);
743 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
744 throw e.setUnfinishedMessage(builder.buildPartial());
745 }
catch (com.google.protobuf.UninitializedMessageException e) {
746 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
747 }
catch (java.io.IOException e) {
748 throw new com.google.protobuf.InvalidProtocolBufferException(e)
749 .setUnfinishedMessage(builder.buildPartial());
751 return builder.buildPartial();
755 public static com.google.protobuf.Parser<MPArrayWithConstantConstraint>
parser() {
766 return DEFAULT_INSTANCE;