6package com.google.ortools.linearsolver;
16@com.google.protobuf.Generated
17public final class MPArrayWithConstantConstraint
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 MPArrayWithConstantConstraint.class.getName());
32 private MPArrayWithConstantConstraint(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
35 private MPArrayWithConstantConstraint() {
36 varIndex_ = emptyIntList();
39 public static final com.google.protobuf.Descriptors.Descriptor
41 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayWithConstantConstraint_descriptor;
45 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
47 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayWithConstantConstraint_fieldAccessorTable
48 .ensureFieldAccessorsInitialized(
49 com.google.ortools.linearsolver.MPArrayWithConstantConstraint.class, com.google.ortools.linearsolver.MPArrayWithConstantConstraint.Builder.class);
52 private int bitField0_;
54 @SuppressWarnings(
"serial")
55 private com.google.protobuf.Internal.IntList varIndex_ =
67 public java.
util.List<java.lang.Integer>
81 return varIndex_.size();
94 return varIndex_.getInt(index);
98 private double constant_ = 0D;
105 return ((bitField0_ & 0x00000001) != 0);
117 private int resultantVarIndex_ = 0;
124 return ((bitField0_ & 0x00000002) != 0);
132 return resultantVarIndex_;
135 private byte memoizedIsInitialized = -1;
142 memoizedIsInitialized = 1;
147 public void writeTo(com.google.protobuf.CodedOutputStream output)
148 throws java.io.IOException {
149 for (
int i = 0; i < varIndex_.size(); i++) {
150 output.writeInt32(1, varIndex_.getInt(i));
152 if (((bitField0_ & 0x00000001) != 0)) {
153 output.writeDouble(2, constant_);
155 if (((bitField0_ & 0x00000002) != 0)) {
156 output.writeInt32(3, resultantVarIndex_);
158 getUnknownFields().writeTo(output);
163 int size = memoizedSize;
164 if (size != -1)
return size;
169 for (
int i = 0; i < varIndex_.size(); i++) {
170 dataSize += com.google.protobuf.CodedOutputStream
171 .computeInt32SizeNoTag(varIndex_.getInt(i));
176 if (((bitField0_ & 0x00000001) != 0)) {
177 size += com.google.protobuf.CodedOutputStream
178 .computeDoubleSize(2, constant_);
180 if (((bitField0_ & 0x00000002) != 0)) {
181 size += com.google.protobuf.CodedOutputStream
182 .computeInt32Size(3, resultantVarIndex_);
184 size += getUnknownFields().getSerializedSize();
190 public boolean equals(
final java.lang.Object obj) {
194 if (!(obj instanceof com.google.ortools.linearsolver.MPArrayWithConstantConstraint)) {
195 return super.equals(obj);
203 if (java.lang.Double.doubleToLongBits(
getConstant())
204 != java.lang.Double.doubleToLongBits(
212 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
218 if (memoizedHashCode != 0) {
219 return memoizedHashCode;
229 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
236 hash = (29 * hash) + getUnknownFields().hashCode();
237 memoizedHashCode = hash;
242 java.nio.ByteBuffer data)
243 throws com.google.protobuf.InvalidProtocolBufferException {
244 return PARSER.parseFrom(data);
247 java.nio.ByteBuffer data,
248 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
249 throws com.google.protobuf.InvalidProtocolBufferException {
250 return PARSER.parseFrom(data, extensionRegistry);
253 com.google.protobuf.ByteString data)
254 throws com.google.protobuf.InvalidProtocolBufferException {
255 return PARSER.parseFrom(data);
258 com.google.protobuf.ByteString data,
259 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
260 throws com.google.protobuf.InvalidProtocolBufferException {
261 return PARSER.parseFrom(data, extensionRegistry);
264 throws com.google.protobuf.InvalidProtocolBufferException {
265 return PARSER.parseFrom(data);
269 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
270 throws com.google.protobuf.InvalidProtocolBufferException {
271 return PARSER.parseFrom(data, extensionRegistry);
274 throws java.io.IOException {
275 return com.google.protobuf.GeneratedMessage
276 .parseWithIOException(PARSER, input);
279 java.io.InputStream input,
280 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
281 throws java.io.IOException {
282 return com.google.protobuf.GeneratedMessage
283 .parseWithIOException(PARSER, input, extensionRegistry);
287 throws java.io.IOException {
288 return com.google.protobuf.GeneratedMessage
289 .parseDelimitedWithIOException(PARSER, input);
293 java.io.InputStream input,
294 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
295 throws java.io.IOException {
296 return com.google.protobuf.GeneratedMessage
297 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
300 com.google.protobuf.CodedInputStream input)
301 throws java.io.IOException {
302 return com.google.protobuf.GeneratedMessage
303 .parseWithIOException(PARSER, input);
306 com.google.protobuf.CodedInputStream input,
307 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
308 throws java.io.IOException {
309 return com.google.protobuf.GeneratedMessage
310 .parseWithIOException(PARSER, input, extensionRegistry);
316 return DEFAULT_INSTANCE.toBuilder();
318 public static Builder newBuilder(com.google.ortools.linearsolver.MPArrayWithConstantConstraint prototype) {
319 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
323 return this == DEFAULT_INSTANCE
329 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
341 public static final class Builder
extends
342 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
345 public static final com.google.protobuf.Descriptors.Descriptor
347 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayWithConstantConstraint_descriptor;
351 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
353 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayWithConstantConstraint_fieldAccessorTable
354 .ensureFieldAccessorsInitialized(
355 com.google.ortools.linearsolver.MPArrayWithConstantConstraint.class, com.google.ortools.linearsolver.MPArrayWithConstantConstraint.Builder.class);
364 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
372 varIndex_ = emptyIntList();
374 resultantVarIndex_ = 0;
379 public com.google.protobuf.Descriptors.Descriptor
381 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayWithConstantConstraint_descriptor;
386 return com.google.ortools.linearsolver.MPArrayWithConstantConstraint.getDefaultInstance();
393 throw newUninitializedMessageException(result);
401 if (bitField0_ != 0) { buildPartial0(result); }
406 private void buildPartial0(com.google.ortools.linearsolver.MPArrayWithConstantConstraint result) {
407 int from_bitField0_ = bitField0_;
408 if (((from_bitField0_ & 0x00000001) != 0)) {
409 varIndex_.makeImmutable();
410 result.varIndex_ = varIndex_;
412 int to_bitField0_ = 0;
413 if (((from_bitField0_ & 0x00000002) != 0)) {
414 result.constant_ = constant_;
415 to_bitField0_ |= 0x00000001;
417 if (((from_bitField0_ & 0x00000004) != 0)) {
418 result.resultantVarIndex_ = resultantVarIndex_;
419 to_bitField0_ |= 0x00000002;
421 result.bitField0_ |= to_bitField0_;
425 public Builder
mergeFrom(com.google.protobuf.Message other) {
426 if (other instanceof com.google.ortools.linearsolver.MPArrayWithConstantConstraint) {
427 return mergeFrom((com.google.ortools.linearsolver.MPArrayWithConstantConstraint)other);
429 super.mergeFrom(other);
434 public Builder
mergeFrom(com.google.ortools.linearsolver.MPArrayWithConstantConstraint other) {
435 if (other == com.google.ortools.linearsolver.MPArrayWithConstantConstraint.getDefaultInstance())
return this;
436 if (!other.varIndex_.isEmpty()) {
437 if (varIndex_.isEmpty()) {
438 varIndex_ = other.varIndex_;
439 varIndex_.makeImmutable();
440 bitField0_ |= 0x00000001;
442 ensureVarIndexIsMutable();
443 varIndex_.addAll(other.varIndex_);
447 if (other.hasConstant()) {
450 if (other.hasResultantVarIndex()) {
453 this.mergeUnknownFields(other.getUnknownFields());
465 com.google.protobuf.CodedInputStream input,
466 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
467 throws java.io.IOException {
468 if (extensionRegistry ==
null) {
469 throw new java.lang.NullPointerException();
472 boolean done =
false;
474 int tag = input.readTag();
480 int v = input.readInt32();
481 ensureVarIndexIsMutable();
486 int length = input.readRawVarint32();
487 int limit = input.pushLimit(length);
488 ensureVarIndexIsMutable();
489 while (input.getBytesUntilLimit() > 0) {
490 varIndex_.addInt(input.readInt32());
492 input.popLimit(limit);
496 constant_ = input.readDouble();
497 bitField0_ |= 0x00000002;
501 resultantVarIndex_ = input.readInt32();
502 bitField0_ |= 0x00000004;
506 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
513 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
514 throw e.unwrapIOException();
520 private int bitField0_;
522 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
523 private void ensureVarIndexIsMutable() {
524 if (!varIndex_.isModifiable()) {
525 varIndex_ = makeMutableCopy(varIndex_);
527 bitField0_ |= 0x00000001;
538 public java.util.List<java.lang.Integer>
540 varIndex_.makeImmutable();
553 return varIndex_.size();
566 return varIndex_.getInt(index);
580 int index,
int value) {
582 ensureVarIndexIsMutable();
583 varIndex_.setInt(index, value);
584 bitField0_ |= 0x00000001;
600 ensureVarIndexIsMutable();
601 varIndex_.addInt(value);
602 bitField0_ |= 0x00000001;
617 java.lang.Iterable<? extends java.lang.Integer> values) {
618 ensureVarIndexIsMutable();
619 com.google.protobuf.AbstractMessageLite.Builder.addAll(
621 bitField0_ |= 0x00000001;
635 varIndex_ = emptyIntList();
636 bitField0_ = (bitField0_ & ~0x00000001);
641 private double constant_ ;
648 return ((bitField0_ & 0x00000002) != 0);
666 bitField0_ |= 0x00000002;
675 bitField0_ = (bitField0_ & ~0x00000002);
681 private int resultantVarIndex_ ;
688 return ((bitField0_ & 0x00000004) != 0);
696 return resultantVarIndex_;
705 resultantVarIndex_ = value;
706 bitField0_ |= 0x00000004;
715 bitField0_ = (bitField0_ & ~0x00000004);
716 resultantVarIndex_ = 0;
727 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPArrayWithConstantConstraint();
731 return DEFAULT_INSTANCE;
738 com.google.protobuf.CodedInputStream input,
739 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
740 throws com.google.protobuf.InvalidProtocolBufferException {
743 builder.mergeFrom(input, extensionRegistry);
744 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
745 throw e.setUnfinishedMessage(builder.buildPartial());
746 }
catch (com.google.protobuf.UninitializedMessageException e) {
747 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
748 }
catch (java.io.IOException e) {
749 throw new com.google.protobuf.InvalidProtocolBufferException(e)
750 .setUnfinishedMessage(builder.buildPartial());
752 return builder.buildPartial();
756 public static com.google.protobuf.Parser<MPArrayWithConstantConstraint>
parser() {
767 return DEFAULT_INSTANCE;