5package com.google.ortools.linearsolver;
15 com.google.protobuf.GeneratedMessage implements
18private static final long serialVersionUID = 0L;
20 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
21 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
29 private MPArrayConstraint(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
33 varIndex_ = emptyIntList();
36 public static final com.google.protobuf.Descriptors.Descriptor
38 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayConstraint_descriptor;
42 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
44 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayConstraint_fieldAccessorTable
45 .ensureFieldAccessorsInitialized(
46 com.google.ortools.linearsolver.MPArrayConstraint.class, com.google.ortools.linearsolver.MPArrayConstraint.Builder.class);
49 private int bitField0_;
51 @SuppressWarnings(
"serial")
52 private com.google.protobuf.Internal.IntList varIndex_ =
63 public java.util.List<java.lang.Integer>
76 return varIndex_.size();
88 return varIndex_.getInt(index);
92 private int resultantVarIndex_ = 0;
99 return ((bitField0_ & 0x00000001) != 0);
107 return resultantVarIndex_;
110 private byte memoizedIsInitialized = -1;
117 memoizedIsInitialized = 1;
122 public void writeTo(com.google.protobuf.CodedOutputStream output)
123 throws java.io.IOException {
124 for (
int i = 0; i < varIndex_.size(); i++) {
125 output.writeInt32(1, varIndex_.getInt(i));
127 if (((bitField0_ & 0x00000001) != 0)) {
128 output.writeInt32(2, resultantVarIndex_);
130 getUnknownFields().writeTo(output);
135 int size = memoizedSize;
136 if (size != -1)
return size;
141 for (
int i = 0; i < varIndex_.size(); i++) {
142 dataSize += com.google.protobuf.CodedOutputStream
143 .computeInt32SizeNoTag(varIndex_.getInt(i));
148 if (((bitField0_ & 0x00000001) != 0)) {
149 size += com.google.protobuf.CodedOutputStream
150 .computeInt32Size(2, resultantVarIndex_);
152 size += getUnknownFields().getSerializedSize();
158 public boolean equals(
final java.lang.Object obj) {
162 if (!(obj instanceof com.google.ortools.linearsolver.MPArrayConstraint)) {
163 return super.equals(obj);
174 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
180 if (memoizedHashCode != 0) {
181 return memoizedHashCode;
193 hash = (29 * hash) + getUnknownFields().hashCode();
194 memoizedHashCode = hash;
199 java.nio.ByteBuffer data)
200 throws com.google.protobuf.InvalidProtocolBufferException {
201 return PARSER.parseFrom(data);
204 java.nio.ByteBuffer data,
205 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
206 throws com.google.protobuf.InvalidProtocolBufferException {
207 return PARSER.parseFrom(data, extensionRegistry);
210 com.google.protobuf.ByteString data)
211 throws com.google.protobuf.InvalidProtocolBufferException {
212 return PARSER.parseFrom(data);
215 com.google.protobuf.ByteString data,
216 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
217 throws com.google.protobuf.InvalidProtocolBufferException {
218 return PARSER.parseFrom(data, extensionRegistry);
221 throws com.google.protobuf.InvalidProtocolBufferException {
222 return PARSER.parseFrom(data);
226 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
227 throws com.google.protobuf.InvalidProtocolBufferException {
228 return PARSER.parseFrom(data, extensionRegistry);
231 throws java.io.IOException {
232 return com.google.protobuf.GeneratedMessage
233 .parseWithIOException(PARSER, input);
236 java.io.InputStream input,
237 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
238 throws java.io.IOException {
239 return com.google.protobuf.GeneratedMessage
240 .parseWithIOException(PARSER, input, extensionRegistry);
244 throws java.io.IOException {
245 return com.google.protobuf.GeneratedMessage
246 .parseDelimitedWithIOException(PARSER, input);
250 java.io.InputStream input,
251 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
252 throws java.io.IOException {
253 return com.google.protobuf.GeneratedMessage
254 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
257 com.google.protobuf.CodedInputStream input)
258 throws java.io.IOException {
259 return com.google.protobuf.GeneratedMessage
260 .parseWithIOException(PARSER, input);
263 com.google.protobuf.CodedInputStream input,
264 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
265 throws java.io.IOException {
266 return com.google.protobuf.GeneratedMessage
267 .parseWithIOException(PARSER, input, extensionRegistry);
280 return this == DEFAULT_INSTANCE
286 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
298 com.google.protobuf.GeneratedMessage.
Builder<Builder> implements
301 public static final com.google.protobuf.Descriptors.Descriptor
303 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayConstraint_descriptor;
307 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
309 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayConstraint_fieldAccessorTable
310 .ensureFieldAccessorsInitialized(
311 com.google.ortools.linearsolver.MPArrayConstraint.class, com.google.ortools.linearsolver.MPArrayConstraint.Builder.class);
320 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
328 varIndex_ = emptyIntList();
329 resultantVarIndex_ = 0;
334 public com.google.protobuf.Descriptors.Descriptor
336 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayConstraint_descriptor;
341 return com.google.ortools.linearsolver.MPArrayConstraint.getDefaultInstance();
348 throw newUninitializedMessageException(result);
356 if (bitField0_ != 0) { buildPartial0(result); }
361 private void buildPartial0(com.google.ortools.linearsolver.MPArrayConstraint result) {
362 int from_bitField0_ = bitField0_;
363 if (((from_bitField0_ & 0x00000001) != 0)) {
364 varIndex_.makeImmutable();
365 result.varIndex_ = varIndex_;
367 int to_bitField0_ = 0;
368 if (((from_bitField0_ & 0x00000002) != 0)) {
369 result.resultantVarIndex_ = resultantVarIndex_;
370 to_bitField0_ |= 0x00000001;
372 result.bitField0_ |= to_bitField0_;
377 if (other instanceof com.google.ortools.linearsolver.MPArrayConstraint) {
378 return mergeFrom((com.google.ortools.linearsolver.MPArrayConstraint)other);
380 super.mergeFrom(other);
386 if (other == com.google.ortools.linearsolver.MPArrayConstraint.getDefaultInstance())
return this;
387 if (!other.varIndex_.isEmpty()) {
388 if (varIndex_.isEmpty()) {
389 varIndex_ = other.varIndex_;
390 varIndex_.makeImmutable();
391 bitField0_ |= 0x00000001;
393 ensureVarIndexIsMutable();
394 varIndex_.addAll(other.varIndex_);
398 if (other.hasResultantVarIndex()) {
401 this.mergeUnknownFields(other.getUnknownFields());
413 com.google.protobuf.CodedInputStream input,
414 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
415 throws java.io.IOException {
416 if (extensionRegistry ==
null) {
417 throw new java.lang.NullPointerException();
420 boolean done =
false;
422 int tag = input.readTag();
428 int v = input.readInt32();
429 ensureVarIndexIsMutable();
434 int length = input.readRawVarint32();
435 int limit = input.pushLimit(length);
436 ensureVarIndexIsMutable();
437 while (input.getBytesUntilLimit() > 0) {
438 varIndex_.addInt(input.readInt32());
440 input.popLimit(limit);
444 resultantVarIndex_ = input.readInt32();
445 bitField0_ |= 0x00000002;
449 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
456 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
457 throw e.unwrapIOException();
463 private int bitField0_;
465 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
466 private void ensureVarIndexIsMutable() {
467 if (!varIndex_.isModifiable()) {
468 varIndex_ = makeMutableCopy(varIndex_);
470 bitField0_ |= 0x00000001;
480 public java.util.List<java.lang.Integer>
482 varIndex_.makeImmutable();
494 return varIndex_.size();
506 return varIndex_.getInt(index);
519 int index,
int value) {
521 ensureVarIndexIsMutable();
522 varIndex_.setInt(index, value);
523 bitField0_ |= 0x00000001;
538 ensureVarIndexIsMutable();
539 varIndex_.addInt(value);
540 bitField0_ |= 0x00000001;
554 java.lang.Iterable<? extends java.lang.Integer> values) {
555 ensureVarIndexIsMutable();
556 com.google.protobuf.AbstractMessageLite.Builder.addAll(
558 bitField0_ |= 0x00000001;
571 varIndex_ = emptyIntList();
572 bitField0_ = (bitField0_ & ~0x00000001);
577 private int resultantVarIndex_ ;
584 return ((bitField0_ & 0x00000002) != 0);
592 return resultantVarIndex_;
601 resultantVarIndex_ = value;
602 bitField0_ |= 0x00000002;
611 bitField0_ = (bitField0_ & ~0x00000002);
612 resultantVarIndex_ = 0;
623 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPArrayConstraint();
627 return DEFAULT_INSTANCE;
634 com.google.protobuf.CodedInputStream input,
635 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
636 throws com.google.protobuf.InvalidProtocolBufferException {
639 builder.mergeFrom(input, extensionRegistry);
640 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
641 throw e.setUnfinishedMessage(builder.buildPartial());
642 }
catch (com.google.protobuf.UninitializedMessageException e) {
643 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
644 }
catch (java.io.IOException e) {
645 throw new com.google.protobuf.InvalidProtocolBufferException(e)
646 .setUnfinishedMessage(builder.buildPartial());
648 return builder.buildPartial();
663 return DEFAULT_INSTANCE;