Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
MPArrayConstraint.java
Go to the documentation of this file.
1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: ortools/linear_solver/linear_solver.proto
3
4// Protobuf Java Version: 4.26.1
5package com.google.ortools.linearsolver;
6
14public final class MPArrayConstraint extends
15 com.google.protobuf.GeneratedMessage implements
16 // @@protoc_insertion_point(message_implements:operations_research.MPArrayConstraint)
18private static final long serialVersionUID = 0L;
19 static {
20 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
21 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
22 /* major= */ 4,
23 /* minor= */ 26,
24 /* patch= */ 1,
25 /* suffix= */ "",
26 MPArrayConstraint.class.getName());
27 }
28 // Use MPArrayConstraint.newBuilder() to construct.
29 private MPArrayConstraint(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
30 super(builder);
31 }
32 private MPArrayConstraint() {
33 varIndex_ = emptyIntList();
34 }
35
36 public static final com.google.protobuf.Descriptors.Descriptor
38 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayConstraint_descriptor;
39 }
40
41 @java.lang.Override
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);
47 }
48
49 private int bitField0_;
50 public static final int VAR_INDEX_FIELD_NUMBER = 1;
51 @SuppressWarnings("serial")
52 private com.google.protobuf.Internal.IntList varIndex_ =
53 emptyIntList();
62 @java.lang.Override
63 public java.util.List<java.lang.Integer>
65 return varIndex_;
66 }
75 public int getVarIndexCount() {
76 return varIndex_.size();
77 }
87 public int getVarIndex(int index) {
88 return varIndex_.getInt(index);
89 }
90
91 public static final int RESULTANT_VAR_INDEX_FIELD_NUMBER = 2;
92 private int resultantVarIndex_ = 0;
97 @java.lang.Override
98 public boolean hasResultantVarIndex() {
99 return ((bitField0_ & 0x00000001) != 0);
100 }
105 @java.lang.Override
106 public int getResultantVarIndex() {
107 return resultantVarIndex_;
108 }
109
110 private byte memoizedIsInitialized = -1;
111 @java.lang.Override
112 public final boolean isInitialized() {
113 byte isInitialized = memoizedIsInitialized;
114 if (isInitialized == 1) return true;
115 if (isInitialized == 0) return false;
116
117 memoizedIsInitialized = 1;
118 return true;
119 }
120
121 @java.lang.Override
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));
126 }
127 if (((bitField0_ & 0x00000001) != 0)) {
128 output.writeInt32(2, resultantVarIndex_);
129 }
130 getUnknownFields().writeTo(output);
131 }
132
133 @java.lang.Override
134 public int getSerializedSize() {
135 int size = memoizedSize;
136 if (size != -1) return size;
137
138 size = 0;
139 {
140 int dataSize = 0;
141 for (int i = 0; i < varIndex_.size(); i++) {
142 dataSize += com.google.protobuf.CodedOutputStream
143 .computeInt32SizeNoTag(varIndex_.getInt(i));
144 }
145 size += dataSize;
146 size += 1 * getVarIndexList().size();
147 }
148 if (((bitField0_ & 0x00000001) != 0)) {
149 size += com.google.protobuf.CodedOutputStream
150 .computeInt32Size(2, resultantVarIndex_);
151 }
152 size += getUnknownFields().getSerializedSize();
153 memoizedSize = size;
154 return size;
155 }
156
157 @java.lang.Override
158 public boolean equals(final java.lang.Object obj) {
159 if (obj == this) {
160 return true;
161 }
162 if (!(obj instanceof com.google.ortools.linearsolver.MPArrayConstraint)) {
163 return super.equals(obj);
164 }
165 com.google.ortools.linearsolver.MPArrayConstraint other = (com.google.ortools.linearsolver.MPArrayConstraint) obj;
166
167 if (!getVarIndexList()
168 .equals(other.getVarIndexList())) return false;
169 if (hasResultantVarIndex() != other.hasResultantVarIndex()) return false;
170 if (hasResultantVarIndex()) {
172 != other.getResultantVarIndex()) return false;
173 }
174 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
175 return true;
176 }
177
178 @java.lang.Override
179 public int hashCode() {
180 if (memoizedHashCode != 0) {
181 return memoizedHashCode;
182 }
183 int hash = 41;
184 hash = (19 * hash) + getDescriptor().hashCode();
185 if (getVarIndexCount() > 0) {
186 hash = (37 * hash) + VAR_INDEX_FIELD_NUMBER;
187 hash = (53 * hash) + getVarIndexList().hashCode();
188 }
189 if (hasResultantVarIndex()) {
190 hash = (37 * hash) + RESULTANT_VAR_INDEX_FIELD_NUMBER;
191 hash = (53 * hash) + getResultantVarIndex();
192 }
193 hash = (29 * hash) + getUnknownFields().hashCode();
194 memoizedHashCode = hash;
195 return hash;
196 }
197
199 java.nio.ByteBuffer data)
200 throws com.google.protobuf.InvalidProtocolBufferException {
201 return PARSER.parseFrom(data);
202 }
204 java.nio.ByteBuffer data,
205 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
206 throws com.google.protobuf.InvalidProtocolBufferException {
207 return PARSER.parseFrom(data, extensionRegistry);
208 }
210 com.google.protobuf.ByteString data)
211 throws com.google.protobuf.InvalidProtocolBufferException {
212 return PARSER.parseFrom(data);
213 }
215 com.google.protobuf.ByteString data,
216 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
217 throws com.google.protobuf.InvalidProtocolBufferException {
218 return PARSER.parseFrom(data, extensionRegistry);
219 }
221 throws com.google.protobuf.InvalidProtocolBufferException {
222 return PARSER.parseFrom(data);
223 }
225 byte[] data,
226 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
227 throws com.google.protobuf.InvalidProtocolBufferException {
228 return PARSER.parseFrom(data, extensionRegistry);
229 }
230 public static com.google.ortools.linearsolver.MPArrayConstraint parseFrom(java.io.InputStream input)
231 throws java.io.IOException {
232 return com.google.protobuf.GeneratedMessage
233 .parseWithIOException(PARSER, input);
234 }
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);
241 }
242
244 throws java.io.IOException {
245 return com.google.protobuf.GeneratedMessage
246 .parseDelimitedWithIOException(PARSER, input);
247 }
248
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);
255 }
257 com.google.protobuf.CodedInputStream input)
258 throws java.io.IOException {
259 return com.google.protobuf.GeneratedMessage
260 .parseWithIOException(PARSER, input);
261 }
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);
268 }
269
270 @java.lang.Override
271 public Builder newBuilderForType() { return newBuilder(); }
272 public static Builder newBuilder() {
273 return DEFAULT_INSTANCE.toBuilder();
274 }
275 public static Builder newBuilder(com.google.ortools.linearsolver.MPArrayConstraint prototype) {
276 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
277 }
278 @java.lang.Override
280 return this == DEFAULT_INSTANCE
281 ? new Builder() : new Builder().mergeFrom(this);
282 }
283
284 @java.lang.Override
286 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
287 Builder builder = new Builder(parent);
288 return builder;
289 }
297 public static final class Builder extends
298 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
299 // @@protoc_insertion_point(builder_implements:operations_research.MPArrayConstraint)
300 com.google.ortools.linearsolver.MPArrayConstraintOrBuilder {
301 public static final com.google.protobuf.Descriptors.Descriptor
303 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayConstraint_descriptor;
304 }
305
306 @java.lang.Override
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);
312 }
313
314 // Construct using com.google.ortools.linearsolver.MPArrayConstraint.newBuilder()
315 private Builder() {
316
317 }
318
319 private Builder(
320 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
321 super(parent);
322
323 }
324 @java.lang.Override
325 public Builder clear() {
326 super.clear();
327 bitField0_ = 0;
328 varIndex_ = emptyIntList();
329 resultantVarIndex_ = 0;
330 return this;
331 }
332
333 @java.lang.Override
334 public com.google.protobuf.Descriptors.Descriptor
336 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPArrayConstraint_descriptor;
337 }
338
339 @java.lang.Override
341 return com.google.ortools.linearsolver.MPArrayConstraint.getDefaultInstance();
342 }
343
344 @java.lang.Override
347 if (!result.isInitialized()) {
348 throw newUninitializedMessageException(result);
349 }
350 return result;
351 }
352
353 @java.lang.Override
355 com.google.ortools.linearsolver.MPArrayConstraint result = new com.google.ortools.linearsolver.MPArrayConstraint(this);
356 if (bitField0_ != 0) { buildPartial0(result); }
357 onBuilt();
358 return result;
359 }
360
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_;
366 }
367 int to_bitField0_ = 0;
368 if (((from_bitField0_ & 0x00000002) != 0)) {
369 result.resultantVarIndex_ = resultantVarIndex_;
370 to_bitField0_ |= 0x00000001;
371 }
372 result.bitField0_ |= to_bitField0_;
373 }
374
375 @java.lang.Override
376 public Builder mergeFrom(com.google.protobuf.Message other) {
377 if (other instanceof com.google.ortools.linearsolver.MPArrayConstraint) {
378 return mergeFrom((com.google.ortools.linearsolver.MPArrayConstraint)other);
379 } else {
380 super.mergeFrom(other);
381 return this;
382 }
383 }
384
385 public Builder mergeFrom(com.google.ortools.linearsolver.MPArrayConstraint 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;
392 } else {
393 ensureVarIndexIsMutable();
394 varIndex_.addAll(other.varIndex_);
395 }
396 onChanged();
397 }
398 if (other.hasResultantVarIndex()) {
399 setResultantVarIndex(other.getResultantVarIndex());
400 }
401 this.mergeUnknownFields(other.getUnknownFields());
402 onChanged();
403 return this;
404 }
405
406 @java.lang.Override
407 public final boolean isInitialized() {
408 return true;
409 }
410
411 @java.lang.Override
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();
418 }
419 try {
420 boolean done = false;
421 while (!done) {
422 int tag = input.readTag();
423 switch (tag) {
424 case 0:
425 done = true;
426 break;
427 case 8: {
428 int v = input.readInt32();
429 ensureVarIndexIsMutable();
430 varIndex_.addInt(v);
431 break;
432 } // case 8
433 case 10: {
434 int length = input.readRawVarint32();
435 int limit = input.pushLimit(length);
436 ensureVarIndexIsMutable();
437 while (input.getBytesUntilLimit() > 0) {
438 varIndex_.addInt(input.readInt32());
439 }
440 input.popLimit(limit);
441 break;
442 } // case 10
443 case 16: {
444 resultantVarIndex_ = input.readInt32();
445 bitField0_ |= 0x00000002;
446 break;
447 } // case 16
448 default: {
449 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
450 done = true; // was an endgroup tag
451 }
452 break;
453 } // default:
454 } // switch (tag)
455 } // while (!done)
456 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
457 throw e.unwrapIOException();
458 } finally {
459 onChanged();
460 } // finally
461 return this;
462 }
463 private int bitField0_;
464
465 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
466 private void ensureVarIndexIsMutable() {
467 if (!varIndex_.isModifiable()) {
468 varIndex_ = makeMutableCopy(varIndex_);
469 }
470 bitField0_ |= 0x00000001;
471 }
480 public java.util.List<java.lang.Integer>
482 varIndex_.makeImmutable();
483 return varIndex_;
484 }
493 public int getVarIndexCount() {
494 return varIndex_.size();
495 }
505 public int getVarIndex(int index) {
506 return varIndex_.getInt(index);
507 }
519 int index, int value) {
520
521 ensureVarIndexIsMutable();
522 varIndex_.setInt(index, value);
523 bitField0_ |= 0x00000001;
524 onChanged();
525 return this;
526 }
536 public Builder addVarIndex(int value) {
537
538 ensureVarIndexIsMutable();
539 varIndex_.addInt(value);
540 bitField0_ |= 0x00000001;
541 onChanged();
542 return this;
543 }
554 java.lang.Iterable<? extends java.lang.Integer> values) {
555 ensureVarIndexIsMutable();
556 com.google.protobuf.AbstractMessageLite.Builder.addAll(
557 values, varIndex_);
558 bitField0_ |= 0x00000001;
559 onChanged();
560 return this;
561 }
571 varIndex_ = emptyIntList();
572 bitField0_ = (bitField0_ & ~0x00000001);
573 onChanged();
574 return this;
575 }
576
577 private int resultantVarIndex_ ;
582 @java.lang.Override
583 public boolean hasResultantVarIndex() {
584 return ((bitField0_ & 0x00000002) != 0);
585 }
590 @java.lang.Override
591 public int getResultantVarIndex() {
592 return resultantVarIndex_;
593 }
599 public Builder setResultantVarIndex(int value) {
600
601 resultantVarIndex_ = value;
602 bitField0_ |= 0x00000002;
603 onChanged();
604 return this;
605 }
611 bitField0_ = (bitField0_ & ~0x00000002);
612 resultantVarIndex_ = 0;
613 onChanged();
614 return this;
615 }
616
617 // @@protoc_insertion_point(builder_scope:operations_research.MPArrayConstraint)
618 }
619
620 // @@protoc_insertion_point(class_scope:operations_research.MPArrayConstraint)
621 private static final com.google.ortools.linearsolver.MPArrayConstraint DEFAULT_INSTANCE;
622 static {
623 DEFAULT_INSTANCE = new com.google.ortools.linearsolver.MPArrayConstraint();
624 }
625
627 return DEFAULT_INSTANCE;
628 }
629
630 private static final com.google.protobuf.Parser<MPArrayConstraint>
631 PARSER = new com.google.protobuf.AbstractParser<MPArrayConstraint>() {
632 @java.lang.Override
633 public MPArrayConstraint parsePartialFrom(
634 com.google.protobuf.CodedInputStream input,
635 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
636 throws com.google.protobuf.InvalidProtocolBufferException {
637 Builder builder = newBuilder();
638 try {
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());
647 }
648 return builder.buildPartial();
649 }
650 };
651
652 public static com.google.protobuf.Parser<MPArrayConstraint> parser() {
653 return PARSER;
654 }
655
656 @java.lang.Override
657 public com.google.protobuf.Parser<MPArrayConstraint> getParserForType() {
658 return PARSER;
659 }
660
661 @java.lang.Override
665
666}
667
Builder addAllVarIndex(java.lang.Iterable<? extends java.lang.Integer > values)
Builder mergeFrom(com.google.ortools.linearsolver.MPArrayConstraint other)
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.linearsolver.MPArrayConstraint buildPartial()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
com.google.ortools.linearsolver.MPArrayConstraint build()
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
com.google.ortools.linearsolver.MPArrayConstraint getDefaultInstanceForType()
Builder mergeFrom(com.google.protobuf.Message other)
static com.google.ortools.linearsolver.MPArrayConstraint parseFrom(com.google.protobuf.CodedInputStream input)
static com.google.ortools.linearsolver.MPArrayConstraint parseFrom(com.google.protobuf.ByteString data)
static com.google.ortools.linearsolver.MPArrayConstraint parseFrom(java.nio.ByteBuffer data)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
static com.google.ortools.linearsolver.MPArrayConstraint parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
java.util.List< java.lang.Integer > getVarIndexList()
static com.google.ortools.linearsolver.MPArrayConstraint getDefaultInstance()
void writeTo(com.google.protobuf.CodedOutputStream output)
static Builder newBuilder(com.google.ortools.linearsolver.MPArrayConstraint prototype)
static com.google.ortools.linearsolver.MPArrayConstraint parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.linearsolver.MPArrayConstraint getDefaultInstanceForType()
static com.google.ortools.linearsolver.MPArrayConstraint parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.linearsolver.MPArrayConstraint parseFrom(byte[] data)
static com.google.ortools.linearsolver.MPArrayConstraint parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.protobuf.Parser< MPArrayConstraint > parser()
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
static com.google.ortools.linearsolver.MPArrayConstraint parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.linearsolver.MPArrayConstraint parseFrom(java.io.InputStream input)
com.google.protobuf.Parser< MPArrayConstraint > getParserForType()
static com.google.ortools.linearsolver.MPArrayConstraint parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.linearsolver.MPArrayConstraint parseDelimitedFrom(java.io.InputStream input)