5package com.google.ortools.linearsolver;
16 com.google.protobuf.GeneratedMessage implements
19private static final long serialVersionUID = 0L;
21 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
22 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
34 varIndex_ = emptyIntList();
37 public static final com.google.protobuf.Descriptors.Descriptor
39 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayWithConstantConstraint_descriptor;
43 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
45 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayWithConstantConstraint_fieldAccessorTable
46 .ensureFieldAccessorsInitialized(
47 com.google.ortools.linearsolver.MPArrayWithConstantConstraint.class, com.google.ortools.linearsolver.MPArrayWithConstantConstraint.Builder.class);
50 private int bitField0_;
52 @SuppressWarnings(
"serial")
53 private com.google.protobuf.Internal.IntList varIndex_ =
65 public java.util.List<java.lang.Integer>
79 return varIndex_.size();
92 return varIndex_.getInt(index);
96 private double constant_ = 0D;
103 return ((bitField0_ & 0x00000001) != 0);
115 private int resultantVarIndex_ = 0;
122 return ((bitField0_ & 0x00000002) != 0);
130 return resultantVarIndex_;
133 private byte memoizedIsInitialized = -1;
140 memoizedIsInitialized = 1;
145 public void writeTo(com.google.protobuf.CodedOutputStream output)
146 throws java.io.IOException {
147 for (
int i = 0; i < varIndex_.size(); i++) {
148 output.writeInt32(1, varIndex_.getInt(i));
150 if (((bitField0_ & 0x00000001) != 0)) {
151 output.writeDouble(2, constant_);
153 if (((bitField0_ & 0x00000002) != 0)) {
154 output.writeInt32(3, resultantVarIndex_);
156 getUnknownFields().writeTo(output);
161 int size = memoizedSize;
162 if (size != -1)
return size;
167 for (
int i = 0; i < varIndex_.size(); i++) {
168 dataSize += com.google.protobuf.CodedOutputStream
169 .computeInt32SizeNoTag(varIndex_.getInt(i));
174 if (((bitField0_ & 0x00000001) != 0)) {
175 size += com.google.protobuf.CodedOutputStream
176 .computeDoubleSize(2, constant_);
178 if (((bitField0_ & 0x00000002) != 0)) {
179 size += com.google.protobuf.CodedOutputStream
180 .computeInt32Size(3, resultantVarIndex_);
182 size += getUnknownFields().getSerializedSize();
188 public boolean equals(
final java.lang.Object obj) {
192 if (!(obj instanceof com.google.ortools.linearsolver.MPArrayWithConstantConstraint)) {
193 return super.equals(obj);
201 if (java.lang.Double.doubleToLongBits(
getConstant())
202 != java.lang.Double.doubleToLongBits(
210 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
216 if (memoizedHashCode != 0) {
217 return memoizedHashCode;
227 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
234 hash = (29 * hash) + getUnknownFields().hashCode();
235 memoizedHashCode = hash;
240 java.nio.ByteBuffer data)
241 throws com.google.protobuf.InvalidProtocolBufferException {
242 return PARSER.parseFrom(data);
245 java.nio.ByteBuffer data,
246 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
247 throws com.google.protobuf.InvalidProtocolBufferException {
248 return PARSER.parseFrom(data, extensionRegistry);
251 com.google.protobuf.ByteString data)
252 throws com.google.protobuf.InvalidProtocolBufferException {
253 return PARSER.parseFrom(data);
256 com.google.protobuf.ByteString data,
257 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
258 throws com.google.protobuf.InvalidProtocolBufferException {
259 return PARSER.parseFrom(data, extensionRegistry);
262 throws com.google.protobuf.InvalidProtocolBufferException {
263 return PARSER.parseFrom(data);
267 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
268 throws com.google.protobuf.InvalidProtocolBufferException {
269 return PARSER.parseFrom(data, extensionRegistry);
272 throws java.io.IOException {
273 return com.google.protobuf.GeneratedMessage
274 .parseWithIOException(PARSER, input);
277 java.io.InputStream input,
278 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
279 throws java.io.IOException {
280 return com.google.protobuf.GeneratedMessage
281 .parseWithIOException(PARSER, input, extensionRegistry);
285 throws java.io.IOException {
286 return com.google.protobuf.GeneratedMessage
287 .parseDelimitedWithIOException(PARSER, input);
291 java.io.InputStream input,
292 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
293 throws java.io.IOException {
294 return com.google.protobuf.GeneratedMessage
295 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
298 com.google.protobuf.CodedInputStream input)
299 throws java.io.IOException {
300 return com.google.protobuf.GeneratedMessage
301 .parseWithIOException(PARSER, input);
304 com.google.protobuf.CodedInputStream input,
305 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
306 throws java.io.IOException {
307 return com.google.protobuf.GeneratedMessage
308 .parseWithIOException(PARSER, input, extensionRegistry);
316 public static Builder newBuilder(com.google.ortools.linearsolver.MPArrayWithConstantConstraint prototype) {
321 return this == DEFAULT_INSTANCE
327 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
340 com.google.protobuf.GeneratedMessage.
Builder<Builder> implements
343 public static final com.google.protobuf.Descriptors.Descriptor
345 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayWithConstantConstraint_descriptor;
349 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
351 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayWithConstantConstraint_fieldAccessorTable
352 .ensureFieldAccessorsInitialized(
353 com.google.ortools.linearsolver.MPArrayWithConstantConstraint.class, com.google.ortools.linearsolver.MPArrayWithConstantConstraint.Builder.class);
362 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
370 varIndex_ = emptyIntList();
372 resultantVarIndex_ = 0;
377 public com.google.protobuf.Descriptors.Descriptor
379 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayWithConstantConstraint_descriptor;
384 return com.google.ortools.linearsolver.MPArrayWithConstantConstraint.getDefaultInstance();
391 throw newUninitializedMessageException(result);
399 if (bitField0_ != 0) { buildPartial0(result); }
404 private void buildPartial0(com.google.ortools.linearsolver.MPArrayWithConstantConstraint result) {
405 int from_bitField0_ = bitField0_;
406 if (((from_bitField0_ & 0x00000001) != 0)) {
407 varIndex_.makeImmutable();
408 result.varIndex_ = varIndex_;
410 int to_bitField0_ = 0;
411 if (((from_bitField0_ & 0x00000002) != 0)) {
412 result.constant_ = constant_;
413 to_bitField0_ |= 0x00000001;
415 if (((from_bitField0_ & 0x00000004) != 0)) {
416 result.resultantVarIndex_ = resultantVarIndex_;
417 to_bitField0_ |= 0x00000002;
419 result.bitField0_ |= to_bitField0_;
424 if (other instanceof com.google.ortools.linearsolver.MPArrayWithConstantConstraint) {
425 return mergeFrom((com.google.ortools.linearsolver.MPArrayWithConstantConstraint)other);
427 super.mergeFrom(other);
432 public Builder mergeFrom(com.google.ortools.linearsolver.MPArrayWithConstantConstraint other) {
433 if (other == com.google.ortools.linearsolver.MPArrayWithConstantConstraint.getDefaultInstance())
return this;
434 if (!other.varIndex_.isEmpty()) {
435 if (varIndex_.isEmpty()) {
436 varIndex_ = other.varIndex_;
437 varIndex_.makeImmutable();
438 bitField0_ |= 0x00000001;
440 ensureVarIndexIsMutable();
441 varIndex_.addAll(other.varIndex_);
445 if (other.hasConstant()) {
448 if (other.hasResultantVarIndex()) {
451 this.mergeUnknownFields(other.getUnknownFields());
463 com.google.protobuf.CodedInputStream input,
464 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
465 throws java.io.IOException {
466 if (extensionRegistry ==
null) {
467 throw new java.lang.NullPointerException();
470 boolean done =
false;
472 int tag = input.readTag();
478 int v = input.readInt32();
479 ensureVarIndexIsMutable();
484 int length = input.readRawVarint32();
485 int limit = input.pushLimit(length);
486 ensureVarIndexIsMutable();
487 while (input.getBytesUntilLimit() > 0) {
488 varIndex_.addInt(input.readInt32());
490 input.popLimit(limit);
494 constant_ = input.readDouble();
495 bitField0_ |= 0x00000002;
499 resultantVarIndex_ = input.readInt32();
500 bitField0_ |= 0x00000004;
504 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
511 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
512 throw e.unwrapIOException();
518 private int bitField0_;
520 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
521 private void ensureVarIndexIsMutable() {
522 if (!varIndex_.isModifiable()) {
523 varIndex_ = makeMutableCopy(varIndex_);
525 bitField0_ |= 0x00000001;
536 public java.util.List<java.lang.Integer>
538 varIndex_.makeImmutable();
551 return varIndex_.size();
564 return varIndex_.getInt(index);
578 int index,
int value) {
580 ensureVarIndexIsMutable();
581 varIndex_.setInt(index, value);
582 bitField0_ |= 0x00000001;
598 ensureVarIndexIsMutable();
599 varIndex_.addInt(value);
600 bitField0_ |= 0x00000001;
615 java.lang.Iterable<? extends java.lang.Integer> values) {
616 ensureVarIndexIsMutable();
617 com.google.protobuf.AbstractMessageLite.Builder.addAll(
619 bitField0_ |= 0x00000001;
633 varIndex_ = emptyIntList();
634 bitField0_ = (bitField0_ & ~0x00000001);
639 private double constant_ ;
646 return ((bitField0_ & 0x00000002) != 0);
664 bitField0_ |= 0x00000002;
673 bitField0_ = (bitField0_ & ~0x00000002);
679 private int resultantVarIndex_ ;
686 return ((bitField0_ & 0x00000004) != 0);
694 return resultantVarIndex_;
703 resultantVarIndex_ = value;
704 bitField0_ |= 0x00000004;
713 bitField0_ = (bitField0_ & ~0x00000004);
714 resultantVarIndex_ = 0;
725 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPArrayWithConstantConstraint();
729 return DEFAULT_INSTANCE;
736 com.google.protobuf.CodedInputStream input,
737 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
738 throws com.google.protobuf.InvalidProtocolBufferException {
741 builder.mergeFrom(input, extensionRegistry);
742 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
743 throw e.setUnfinishedMessage(builder.buildPartial());
744 }
catch (com.google.protobuf.UninitializedMessageException e) {
745 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
746 }
catch (java.io.IOException e) {
747 throw new com.google.protobuf.InvalidProtocolBufferException(e)
748 .setUnfinishedMessage(builder.buildPartial());
750 return builder.buildPartial();
765 return DEFAULT_INSTANCE;