6package com.google.ortools.linearsolver;
15public final class MPArrayConstraint
extends
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,
27 MPArrayConstraint.class.getName());
30 private MPArrayConstraint(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
33 private MPArrayConstraint() {
34 varIndex_ = emptyIntList();
37 public static final com.google.protobuf.Descriptors.Descriptor
39 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayConstraint_descriptor;
43 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
45 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayConstraint_fieldAccessorTable
46 .ensureFieldAccessorsInitialized(
47 com.google.ortools.linearsolver.MPArrayConstraint.class, com.google.ortools.linearsolver.MPArrayConstraint.Builder.class);
50 private int bitField0_;
52 @SuppressWarnings(
"serial")
53 private com.google.protobuf.Internal.IntList varIndex_ =
64 public java.
util.List<java.lang.Integer>
77 return varIndex_.size();
89 return varIndex_.getInt(index);
93 private int resultantVarIndex_ = 0;
100 return ((bitField0_ & 0x00000001) != 0);
108 return resultantVarIndex_;
111 private byte memoizedIsInitialized = -1;
118 memoizedIsInitialized = 1;
123 public void writeTo(com.google.protobuf.CodedOutputStream output)
124 throws java.io.IOException {
125 for (
int i = 0; i < varIndex_.size(); i++) {
126 output.writeInt32(1, varIndex_.getInt(i));
128 if (((bitField0_ & 0x00000001) != 0)) {
129 output.writeInt32(2, resultantVarIndex_);
131 getUnknownFields().writeTo(output);
136 int size = memoizedSize;
137 if (size != -1)
return size;
142 for (
int i = 0; i < varIndex_.size(); i++) {
143 dataSize += com.google.protobuf.CodedOutputStream
144 .computeInt32SizeNoTag(varIndex_.getInt(i));
149 if (((bitField0_ & 0x00000001) != 0)) {
150 size += com.google.protobuf.CodedOutputStream
151 .computeInt32Size(2, resultantVarIndex_);
153 size += getUnknownFields().getSerializedSize();
159 public boolean equals(
final java.lang.Object obj) {
163 if (!(obj instanceof com.google.ortools.linearsolver.MPArrayConstraint)) {
164 return super.equals(obj);
175 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
181 if (memoizedHashCode != 0) {
182 return memoizedHashCode;
194 hash = (29 * hash) + getUnknownFields().hashCode();
195 memoizedHashCode = hash;
200 java.nio.ByteBuffer data)
201 throws com.google.protobuf.InvalidProtocolBufferException {
202 return PARSER.parseFrom(data);
205 java.nio.ByteBuffer data,
206 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
207 throws com.google.protobuf.InvalidProtocolBufferException {
208 return PARSER.parseFrom(data, extensionRegistry);
211 com.google.protobuf.ByteString data)
212 throws com.google.protobuf.InvalidProtocolBufferException {
213 return PARSER.parseFrom(data);
216 com.google.protobuf.ByteString data,
217 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
218 throws com.google.protobuf.InvalidProtocolBufferException {
219 return PARSER.parseFrom(data, extensionRegistry);
222 throws com.google.protobuf.InvalidProtocolBufferException {
223 return PARSER.parseFrom(data);
227 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
228 throws com.google.protobuf.InvalidProtocolBufferException {
229 return PARSER.parseFrom(data, extensionRegistry);
232 throws java.io.IOException {
233 return com.google.protobuf.GeneratedMessage
234 .parseWithIOException(PARSER, input);
237 java.io.InputStream input,
238 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
239 throws java.io.IOException {
240 return com.google.protobuf.GeneratedMessage
241 .parseWithIOException(PARSER, input, extensionRegistry);
245 throws java.io.IOException {
246 return com.google.protobuf.GeneratedMessage
247 .parseDelimitedWithIOException(PARSER, input);
251 java.io.InputStream input,
252 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
253 throws java.io.IOException {
254 return com.google.protobuf.GeneratedMessage
255 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
258 com.google.protobuf.CodedInputStream input)
259 throws java.io.IOException {
260 return com.google.protobuf.GeneratedMessage
261 .parseWithIOException(PARSER, input);
264 com.google.protobuf.CodedInputStream input,
265 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
266 throws java.io.IOException {
267 return com.google.protobuf.GeneratedMessage
268 .parseWithIOException(PARSER, input, extensionRegistry);
274 return DEFAULT_INSTANCE.toBuilder();
277 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
281 return this == DEFAULT_INSTANCE
287 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
298 public static final class Builder
extends
299 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
302 public static final com.google.protobuf.Descriptors.Descriptor
304 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayConstraint_descriptor;
308 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
310 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayConstraint_fieldAccessorTable
311 .ensureFieldAccessorsInitialized(
312 com.google.ortools.linearsolver.MPArrayConstraint.class, com.google.ortools.linearsolver.MPArrayConstraint.Builder.class);
321 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
329 varIndex_ = emptyIntList();
330 resultantVarIndex_ = 0;
335 public com.google.protobuf.Descriptors.Descriptor
337 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayConstraint_descriptor;
342 return com.google.ortools.linearsolver.MPArrayConstraint.getDefaultInstance();
349 throw newUninitializedMessageException(result);
357 if (bitField0_ != 0) { buildPartial0(result); }
362 private void buildPartial0(com.google.ortools.linearsolver.MPArrayConstraint result) {
363 int from_bitField0_ = bitField0_;
364 if (((from_bitField0_ & 0x00000001) != 0)) {
365 varIndex_.makeImmutable();
366 result.varIndex_ = varIndex_;
368 int to_bitField0_ = 0;
369 if (((from_bitField0_ & 0x00000002) != 0)) {
370 result.resultantVarIndex_ = resultantVarIndex_;
371 to_bitField0_ |= 0x00000001;
373 result.bitField0_ |= to_bitField0_;
377 public Builder
mergeFrom(com.google.protobuf.Message other) {
378 if (other instanceof com.google.ortools.linearsolver.MPArrayConstraint) {
379 return mergeFrom((com.google.ortools.linearsolver.MPArrayConstraint)other);
381 super.mergeFrom(other);
386 public Builder
mergeFrom(com.google.ortools.linearsolver.MPArrayConstraint other) {
387 if (other == com.google.ortools.linearsolver.MPArrayConstraint.getDefaultInstance())
return this;
388 if (!other.varIndex_.isEmpty()) {
389 if (varIndex_.isEmpty()) {
390 varIndex_ = other.varIndex_;
391 varIndex_.makeImmutable();
392 bitField0_ |= 0x00000001;
394 ensureVarIndexIsMutable();
395 varIndex_.addAll(other.varIndex_);
399 if (other.hasResultantVarIndex()) {
402 this.mergeUnknownFields(other.getUnknownFields());
414 com.google.protobuf.CodedInputStream input,
415 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
416 throws java.io.IOException {
417 if (extensionRegistry ==
null) {
418 throw new java.lang.NullPointerException();
421 boolean done =
false;
423 int tag = input.readTag();
429 int v = input.readInt32();
430 ensureVarIndexIsMutable();
435 int length = input.readRawVarint32();
436 int limit = input.pushLimit(length);
437 ensureVarIndexIsMutable();
438 while (input.getBytesUntilLimit() > 0) {
439 varIndex_.addInt(input.readInt32());
441 input.popLimit(limit);
445 resultantVarIndex_ = input.readInt32();
446 bitField0_ |= 0x00000002;
450 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
457 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
458 throw e.unwrapIOException();
464 private int bitField0_;
466 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
467 private void ensureVarIndexIsMutable() {
468 if (!varIndex_.isModifiable()) {
469 varIndex_ = makeMutableCopy(varIndex_);
471 bitField0_ |= 0x00000001;
481 public java.util.List<java.lang.Integer>
483 varIndex_.makeImmutable();
495 return varIndex_.size();
507 return varIndex_.getInt(index);
520 int index,
int value) {
522 ensureVarIndexIsMutable();
523 varIndex_.setInt(index, value);
524 bitField0_ |= 0x00000001;
539 ensureVarIndexIsMutable();
540 varIndex_.addInt(value);
541 bitField0_ |= 0x00000001;
555 java.lang.Iterable<? extends java.lang.Integer> values) {
556 ensureVarIndexIsMutable();
557 com.google.protobuf.AbstractMessageLite.Builder.addAll(
559 bitField0_ |= 0x00000001;
572 varIndex_ = emptyIntList();
573 bitField0_ = (bitField0_ & ~0x00000001);
578 private int resultantVarIndex_ ;
585 return ((bitField0_ & 0x00000002) != 0);
593 return resultantVarIndex_;
602 resultantVarIndex_ = value;
603 bitField0_ |= 0x00000002;
612 bitField0_ = (bitField0_ & ~0x00000002);
613 resultantVarIndex_ = 0;
624 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPArrayConstraint();
628 return DEFAULT_INSTANCE;
635 com.google.protobuf.CodedInputStream input,
636 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
637 throws com.google.protobuf.InvalidProtocolBufferException {
640 builder.mergeFrom(input, extensionRegistry);
641 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
642 throw e.setUnfinishedMessage(builder.buildPartial());
643 }
catch (com.google.protobuf.UninitializedMessageException e) {
644 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
645 }
catch (java.io.IOException e) {
646 throw new com.google.protobuf.InvalidProtocolBufferException(e)
647 .setUnfinishedMessage(builder.buildPartial());
649 return builder.buildPartial();
653 public static com.google.protobuf.Parser<MPArrayConstraint>
parser() {
664 return DEFAULT_INSTANCE;