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