6package com.google.ortools.linearsolver;
15@com.google.protobuf.Generated
16public final class MPArrayConstraint
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 MPArrayConstraint.class.getName());
31 private MPArrayConstraint(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
34 private MPArrayConstraint() {
35 varIndex_ = emptyIntList();
38 public static final com.google.protobuf.Descriptors.Descriptor
40 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayConstraint_descriptor;
44 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
46 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayConstraint_fieldAccessorTable
47 .ensureFieldAccessorsInitialized(
48 com.google.ortools.linearsolver.MPArrayConstraint.class, com.google.ortools.linearsolver.MPArrayConstraint.Builder.class);
51 private int bitField0_;
53 @SuppressWarnings(
"serial")
54 private com.google.protobuf.Internal.IntList varIndex_ =
65 public java.
util.List<java.lang.Integer>
78 return varIndex_.size();
90 return varIndex_.getInt(index);
94 private int resultantVarIndex_ = 0;
101 return ((bitField0_ & 0x00000001) != 0);
109 return resultantVarIndex_;
112 private byte memoizedIsInitialized = -1;
119 memoizedIsInitialized = 1;
124 public void writeTo(com.google.protobuf.CodedOutputStream output)
125 throws java.io.IOException {
126 for (
int i = 0; i < varIndex_.size(); i++) {
127 output.writeInt32(1, varIndex_.getInt(i));
129 if (((bitField0_ & 0x00000001) != 0)) {
130 output.writeInt32(2, resultantVarIndex_);
132 getUnknownFields().writeTo(output);
137 int size = memoizedSize;
138 if (size != -1)
return size;
143 for (
int i = 0; i < varIndex_.size(); i++) {
144 dataSize += com.google.protobuf.CodedOutputStream
145 .computeInt32SizeNoTag(varIndex_.getInt(i));
150 if (((bitField0_ & 0x00000001) != 0)) {
151 size += com.google.protobuf.CodedOutputStream
152 .computeInt32Size(2, resultantVarIndex_);
154 size += getUnknownFields().getSerializedSize();
160 public boolean equals(
final java.lang.Object obj) {
164 if (!(obj instanceof com.google.ortools.linearsolver.MPArrayConstraint)) {
165 return super.equals(obj);
176 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
182 if (memoizedHashCode != 0) {
183 return memoizedHashCode;
195 hash = (29 * hash) + getUnknownFields().hashCode();
196 memoizedHashCode = hash;
201 java.nio.ByteBuffer data)
202 throws com.google.protobuf.InvalidProtocolBufferException {
203 return PARSER.parseFrom(data);
206 java.nio.ByteBuffer data,
207 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
208 throws com.google.protobuf.InvalidProtocolBufferException {
209 return PARSER.parseFrom(data, extensionRegistry);
212 com.google.protobuf.ByteString data)
213 throws com.google.protobuf.InvalidProtocolBufferException {
214 return PARSER.parseFrom(data);
217 com.google.protobuf.ByteString data,
218 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
219 throws com.google.protobuf.InvalidProtocolBufferException {
220 return PARSER.parseFrom(data, extensionRegistry);
223 throws com.google.protobuf.InvalidProtocolBufferException {
224 return PARSER.parseFrom(data);
228 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
229 throws com.google.protobuf.InvalidProtocolBufferException {
230 return PARSER.parseFrom(data, extensionRegistry);
233 throws java.io.IOException {
234 return com.google.protobuf.GeneratedMessage
235 .parseWithIOException(PARSER, input);
238 java.io.InputStream input,
239 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
240 throws java.io.IOException {
241 return com.google.protobuf.GeneratedMessage
242 .parseWithIOException(PARSER, input, extensionRegistry);
246 throws java.io.IOException {
247 return com.google.protobuf.GeneratedMessage
248 .parseDelimitedWithIOException(PARSER, input);
252 java.io.InputStream input,
253 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
254 throws java.io.IOException {
255 return com.google.protobuf.GeneratedMessage
256 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
259 com.google.protobuf.CodedInputStream input)
260 throws java.io.IOException {
261 return com.google.protobuf.GeneratedMessage
262 .parseWithIOException(PARSER, input);
265 com.google.protobuf.CodedInputStream input,
266 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
267 throws java.io.IOException {
268 return com.google.protobuf.GeneratedMessage
269 .parseWithIOException(PARSER, input, extensionRegistry);
275 return DEFAULT_INSTANCE.toBuilder();
278 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
282 return this == DEFAULT_INSTANCE
288 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
299 public static final class Builder
extends
300 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
303 public static final com.google.protobuf.Descriptors.Descriptor
305 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayConstraint_descriptor;
309 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
311 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayConstraint_fieldAccessorTable
312 .ensureFieldAccessorsInitialized(
313 com.google.ortools.linearsolver.MPArrayConstraint.class, com.google.ortools.linearsolver.MPArrayConstraint.Builder.class);
322 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
330 varIndex_ = emptyIntList();
331 resultantVarIndex_ = 0;
336 public com.google.protobuf.Descriptors.Descriptor
338 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayConstraint_descriptor;
343 return com.google.ortools.linearsolver.MPArrayConstraint.getDefaultInstance();
350 throw newUninitializedMessageException(result);
358 if (bitField0_ != 0) { buildPartial0(result); }
363 private void buildPartial0(com.google.ortools.linearsolver.MPArrayConstraint result) {
364 int from_bitField0_ = bitField0_;
365 if (((from_bitField0_ & 0x00000001) != 0)) {
366 varIndex_.makeImmutable();
367 result.varIndex_ = varIndex_;
369 int to_bitField0_ = 0;
370 if (((from_bitField0_ & 0x00000002) != 0)) {
371 result.resultantVarIndex_ = resultantVarIndex_;
372 to_bitField0_ |= 0x00000001;
374 result.bitField0_ |= to_bitField0_;
378 public Builder
mergeFrom(com.google.protobuf.Message other) {
379 if (other instanceof com.google.ortools.linearsolver.MPArrayConstraint) {
380 return mergeFrom((com.google.ortools.linearsolver.MPArrayConstraint)other);
382 super.mergeFrom(other);
387 public Builder
mergeFrom(com.google.ortools.linearsolver.MPArrayConstraint other) {
388 if (other == com.google.ortools.linearsolver.MPArrayConstraint.getDefaultInstance())
return this;
389 if (!other.varIndex_.isEmpty()) {
390 if (varIndex_.isEmpty()) {
391 varIndex_ = other.varIndex_;
392 varIndex_.makeImmutable();
393 bitField0_ |= 0x00000001;
395 ensureVarIndexIsMutable();
396 varIndex_.addAll(other.varIndex_);
400 if (other.hasResultantVarIndex()) {
403 this.mergeUnknownFields(other.getUnknownFields());
415 com.google.protobuf.CodedInputStream input,
416 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
417 throws java.io.IOException {
418 if (extensionRegistry ==
null) {
419 throw new java.lang.NullPointerException();
422 boolean done =
false;
424 int tag = input.readTag();
430 int v = input.readInt32();
431 ensureVarIndexIsMutable();
436 int length = input.readRawVarint32();
437 int limit = input.pushLimit(length);
438 ensureVarIndexIsMutable();
439 while (input.getBytesUntilLimit() > 0) {
440 varIndex_.addInt(input.readInt32());
442 input.popLimit(limit);
446 resultantVarIndex_ = input.readInt32();
447 bitField0_ |= 0x00000002;
451 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
458 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
459 throw e.unwrapIOException();
465 private int bitField0_;
467 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
468 private void ensureVarIndexIsMutable() {
469 if (!varIndex_.isModifiable()) {
470 varIndex_ = makeMutableCopy(varIndex_);
472 bitField0_ |= 0x00000001;
482 public java.util.List<java.lang.Integer>
484 varIndex_.makeImmutable();
496 return varIndex_.size();
508 return varIndex_.getInt(index);
521 int index,
int value) {
523 ensureVarIndexIsMutable();
524 varIndex_.setInt(index, value);
525 bitField0_ |= 0x00000001;
540 ensureVarIndexIsMutable();
541 varIndex_.addInt(value);
542 bitField0_ |= 0x00000001;
556 java.lang.Iterable<? extends java.lang.Integer> values) {
557 ensureVarIndexIsMutable();
558 com.google.protobuf.AbstractMessageLite.Builder.addAll(
560 bitField0_ |= 0x00000001;
573 varIndex_ = emptyIntList();
574 bitField0_ = (bitField0_ & ~0x00000001);
579 private int resultantVarIndex_ ;
586 return ((bitField0_ & 0x00000002) != 0);
594 return resultantVarIndex_;
603 resultantVarIndex_ = value;
604 bitField0_ |= 0x00000002;
613 bitField0_ = (bitField0_ & ~0x00000002);
614 resultantVarIndex_ = 0;
625 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPArrayConstraint();
629 return DEFAULT_INSTANCE;
636 com.google.protobuf.CodedInputStream input,
637 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
638 throws com.google.protobuf.InvalidProtocolBufferException {
641 builder.mergeFrom(input, extensionRegistry);
642 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
643 throw e.setUnfinishedMessage(builder.buildPartial());
644 }
catch (com.google.protobuf.UninitializedMessageException e) {
645 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
646 }
catch (java.io.IOException e) {
647 throw new com.google.protobuf.InvalidProtocolBufferException(e)
648 .setUnfinishedMessage(builder.buildPartial());
650 return builder.buildPartial();
654 public static com.google.protobuf.Parser<MPArrayConstraint>
parser() {
665 return DEFAULT_INSTANCE;