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