Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
TableConstraintProto.java
Go to the documentation of this file.
1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: ortools/sat/cp_model.proto
3
4// Protobuf Java Version: 4.26.1
5package com.google.ortools.sat;
6
16public final class TableConstraintProto extends
17 com.google.protobuf.GeneratedMessage implements
18 // @@protoc_insertion_point(message_implements:operations_research.sat.TableConstraintProto)
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= */ 26,
26 /* patch= */ 1,
27 /* suffix= */ "",
28 TableConstraintProto.class.getName());
29 }
30 // Use TableConstraintProto.newBuilder() to construct.
31 private TableConstraintProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
32 super(builder);
33 }
34 private TableConstraintProto() {
35 vars_ = emptyIntList();
36 values_ = emptyLongList();
37 }
38
39 public static final com.google.protobuf.Descriptors.Descriptor
41 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_TableConstraintProto_descriptor;
42 }
43
44 @java.lang.Override
45 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
47 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_TableConstraintProto_fieldAccessorTable
48 .ensureFieldAccessorsInitialized(
49 com.google.ortools.sat.TableConstraintProto.class, com.google.ortools.sat.TableConstraintProto.Builder.class);
50 }
51
52 public static final int VARS_FIELD_NUMBER = 1;
53 @SuppressWarnings("serial")
54 private com.google.protobuf.Internal.IntList vars_ =
55 emptyIntList();
60 @java.lang.Override
61 public java.util.List<java.lang.Integer>
63 return vars_;
64 }
69 public int getVarsCount() {
70 return vars_.size();
71 }
77 public int getVars(int index) {
78 return vars_.getInt(index);
79 }
80 private int varsMemoizedSerializedSize = -1;
81
82 public static final int VALUES_FIELD_NUMBER = 2;
83 @SuppressWarnings("serial")
84 private com.google.protobuf.Internal.LongList values_ =
85 emptyLongList();
90 @java.lang.Override
91 public java.util.List<java.lang.Long>
93 return values_;
94 }
99 public int getValuesCount() {
100 return values_.size();
101 }
107 public long getValues(int index) {
108 return values_.getLong(index);
109 }
110 private int valuesMemoizedSerializedSize = -1;
111
112 public static final int NEGATED_FIELD_NUMBER = 3;
113 private boolean negated_ = false;
123 @java.lang.Override
124 public boolean getNegated() {
125 return negated_;
126 }
127
128 private byte memoizedIsInitialized = -1;
129 @java.lang.Override
130 public final boolean isInitialized() {
131 byte isInitialized = memoizedIsInitialized;
132 if (isInitialized == 1) return true;
133 if (isInitialized == 0) return false;
134
135 memoizedIsInitialized = 1;
136 return true;
137 }
138
139 @java.lang.Override
140 public void writeTo(com.google.protobuf.CodedOutputStream output)
141 throws java.io.IOException {
143 if (getVarsList().size() > 0) {
144 output.writeUInt32NoTag(10);
145 output.writeUInt32NoTag(varsMemoizedSerializedSize);
146 }
147 for (int i = 0; i < vars_.size(); i++) {
148 output.writeInt32NoTag(vars_.getInt(i));
149 }
150 if (getValuesList().size() > 0) {
151 output.writeUInt32NoTag(18);
152 output.writeUInt32NoTag(valuesMemoizedSerializedSize);
153 }
154 for (int i = 0; i < values_.size(); i++) {
155 output.writeInt64NoTag(values_.getLong(i));
156 }
157 if (negated_ != false) {
158 output.writeBool(3, negated_);
159 }
160 getUnknownFields().writeTo(output);
161 }
162
163 @java.lang.Override
164 public int getSerializedSize() {
165 int size = memoizedSize;
166 if (size != -1) return size;
167
168 size = 0;
169 {
170 int dataSize = 0;
171 for (int i = 0; i < vars_.size(); i++) {
172 dataSize += com.google.protobuf.CodedOutputStream
173 .computeInt32SizeNoTag(vars_.getInt(i));
174 }
175 size += dataSize;
176 if (!getVarsList().isEmpty()) {
177 size += 1;
178 size += com.google.protobuf.CodedOutputStream
179 .computeInt32SizeNoTag(dataSize);
180 }
181 varsMemoizedSerializedSize = dataSize;
182 }
183 {
184 int dataSize = 0;
185 for (int i = 0; i < values_.size(); i++) {
186 dataSize += com.google.protobuf.CodedOutputStream
187 .computeInt64SizeNoTag(values_.getLong(i));
188 }
189 size += dataSize;
190 if (!getValuesList().isEmpty()) {
191 size += 1;
192 size += com.google.protobuf.CodedOutputStream
193 .computeInt32SizeNoTag(dataSize);
194 }
195 valuesMemoizedSerializedSize = dataSize;
196 }
197 if (negated_ != false) {
198 size += com.google.protobuf.CodedOutputStream
199 .computeBoolSize(3, negated_);
200 }
201 size += getUnknownFields().getSerializedSize();
202 memoizedSize = size;
203 return size;
204 }
205
206 @java.lang.Override
207 public boolean equals(final java.lang.Object obj) {
208 if (obj == this) {
209 return true;
210 }
211 if (!(obj instanceof com.google.ortools.sat.TableConstraintProto)) {
212 return super.equals(obj);
213 }
214 com.google.ortools.sat.TableConstraintProto other = (com.google.ortools.sat.TableConstraintProto) obj;
215
216 if (!getVarsList()
217 .equals(other.getVarsList())) return false;
218 if (!getValuesList()
219 .equals(other.getValuesList())) return false;
220 if (getNegated()
221 != other.getNegated()) return false;
222 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
223 return true;
224 }
225
226 @java.lang.Override
227 public int hashCode() {
228 if (memoizedHashCode != 0) {
229 return memoizedHashCode;
230 }
231 int hash = 41;
232 hash = (19 * hash) + getDescriptor().hashCode();
233 if (getVarsCount() > 0) {
234 hash = (37 * hash) + VARS_FIELD_NUMBER;
235 hash = (53 * hash) + getVarsList().hashCode();
236 }
237 if (getValuesCount() > 0) {
238 hash = (37 * hash) + VALUES_FIELD_NUMBER;
239 hash = (53 * hash) + getValuesList().hashCode();
240 }
241 hash = (37 * hash) + NEGATED_FIELD_NUMBER;
242 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
243 getNegated());
244 hash = (29 * hash) + getUnknownFields().hashCode();
245 memoizedHashCode = hash;
246 return hash;
247 }
248
250 java.nio.ByteBuffer data)
251 throws com.google.protobuf.InvalidProtocolBufferException {
252 return PARSER.parseFrom(data);
253 }
255 java.nio.ByteBuffer data,
256 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
257 throws com.google.protobuf.InvalidProtocolBufferException {
258 return PARSER.parseFrom(data, extensionRegistry);
259 }
261 com.google.protobuf.ByteString data)
262 throws com.google.protobuf.InvalidProtocolBufferException {
263 return PARSER.parseFrom(data);
264 }
266 com.google.protobuf.ByteString data,
267 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
268 throws com.google.protobuf.InvalidProtocolBufferException {
269 return PARSER.parseFrom(data, extensionRegistry);
270 }
272 throws com.google.protobuf.InvalidProtocolBufferException {
273 return PARSER.parseFrom(data);
274 }
276 byte[] data,
277 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
278 throws com.google.protobuf.InvalidProtocolBufferException {
279 return PARSER.parseFrom(data, extensionRegistry);
280 }
281 public static com.google.ortools.sat.TableConstraintProto parseFrom(java.io.InputStream input)
282 throws java.io.IOException {
283 return com.google.protobuf.GeneratedMessage
284 .parseWithIOException(PARSER, input);
285 }
287 java.io.InputStream input,
288 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
289 throws java.io.IOException {
290 return com.google.protobuf.GeneratedMessage
291 .parseWithIOException(PARSER, input, extensionRegistry);
292 }
293
295 throws java.io.IOException {
296 return com.google.protobuf.GeneratedMessage
297 .parseDelimitedWithIOException(PARSER, input);
298 }
299
301 java.io.InputStream input,
302 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
303 throws java.io.IOException {
304 return com.google.protobuf.GeneratedMessage
305 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
306 }
308 com.google.protobuf.CodedInputStream input)
309 throws java.io.IOException {
310 return com.google.protobuf.GeneratedMessage
311 .parseWithIOException(PARSER, input);
312 }
314 com.google.protobuf.CodedInputStream input,
315 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
316 throws java.io.IOException {
317 return com.google.protobuf.GeneratedMessage
318 .parseWithIOException(PARSER, input, extensionRegistry);
319 }
320
321 @java.lang.Override
322 public Builder newBuilderForType() { return newBuilder(); }
323 public static Builder newBuilder() {
324 return DEFAULT_INSTANCE.toBuilder();
325 }
326 public static Builder newBuilder(com.google.ortools.sat.TableConstraintProto prototype) {
327 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
328 }
329 @java.lang.Override
331 return this == DEFAULT_INSTANCE
332 ? new Builder() : new Builder().mergeFrom(this);
333 }
334
335 @java.lang.Override
337 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
338 Builder builder = new Builder(parent);
339 return builder;
340 }
350 public static final class Builder extends
351 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
352 // @@protoc_insertion_point(builder_implements:operations_research.sat.TableConstraintProto)
353 com.google.ortools.sat.TableConstraintProtoOrBuilder {
354 public static final com.google.protobuf.Descriptors.Descriptor
356 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_TableConstraintProto_descriptor;
357 }
358
359 @java.lang.Override
360 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
362 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_TableConstraintProto_fieldAccessorTable
363 .ensureFieldAccessorsInitialized(
364 com.google.ortools.sat.TableConstraintProto.class, com.google.ortools.sat.TableConstraintProto.Builder.class);
365 }
366
367 // Construct using com.google.ortools.sat.TableConstraintProto.newBuilder()
368 private Builder() {
369
370 }
371
372 private Builder(
373 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
374 super(parent);
375
376 }
377 @java.lang.Override
378 public Builder clear() {
379 super.clear();
380 bitField0_ = 0;
381 vars_ = emptyIntList();
382 values_ = emptyLongList();
383 negated_ = false;
384 return this;
385 }
386
387 @java.lang.Override
388 public com.google.protobuf.Descriptors.Descriptor
390 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_TableConstraintProto_descriptor;
391 }
392
393 @java.lang.Override
395 return com.google.ortools.sat.TableConstraintProto.getDefaultInstance();
396 }
397
398 @java.lang.Override
401 if (!result.isInitialized()) {
402 throw newUninitializedMessageException(result);
403 }
404 return result;
405 }
406
407 @java.lang.Override
409 com.google.ortools.sat.TableConstraintProto result = new com.google.ortools.sat.TableConstraintProto(this);
410 if (bitField0_ != 0) { buildPartial0(result); }
411 onBuilt();
412 return result;
413 }
414
415 private void buildPartial0(com.google.ortools.sat.TableConstraintProto result) {
416 int from_bitField0_ = bitField0_;
417 if (((from_bitField0_ & 0x00000001) != 0)) {
418 vars_.makeImmutable();
419 result.vars_ = vars_;
420 }
421 if (((from_bitField0_ & 0x00000002) != 0)) {
422 values_.makeImmutable();
423 result.values_ = values_;
424 }
425 if (((from_bitField0_ & 0x00000004) != 0)) {
426 result.negated_ = negated_;
427 }
428 }
429
430 @java.lang.Override
431 public Builder mergeFrom(com.google.protobuf.Message other) {
432 if (other instanceof com.google.ortools.sat.TableConstraintProto) {
433 return mergeFrom((com.google.ortools.sat.TableConstraintProto)other);
434 } else {
435 super.mergeFrom(other);
436 return this;
437 }
438 }
439
440 public Builder mergeFrom(com.google.ortools.sat.TableConstraintProto other) {
441 if (other == com.google.ortools.sat.TableConstraintProto.getDefaultInstance()) return this;
442 if (!other.vars_.isEmpty()) {
443 if (vars_.isEmpty()) {
444 vars_ = other.vars_;
445 vars_.makeImmutable();
446 bitField0_ |= 0x00000001;
447 } else {
448 ensureVarsIsMutable();
449 vars_.addAll(other.vars_);
450 }
451 onChanged();
452 }
453 if (!other.values_.isEmpty()) {
454 if (values_.isEmpty()) {
455 values_ = other.values_;
456 values_.makeImmutable();
457 bitField0_ |= 0x00000002;
458 } else {
459 ensureValuesIsMutable();
460 values_.addAll(other.values_);
461 }
462 onChanged();
463 }
464 if (other.getNegated() != false) {
465 setNegated(other.getNegated());
466 }
467 this.mergeUnknownFields(other.getUnknownFields());
468 onChanged();
469 return this;
470 }
471
472 @java.lang.Override
473 public final boolean isInitialized() {
474 return true;
475 }
476
477 @java.lang.Override
479 com.google.protobuf.CodedInputStream input,
480 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
481 throws java.io.IOException {
482 if (extensionRegistry == null) {
483 throw new java.lang.NullPointerException();
484 }
485 try {
486 boolean done = false;
487 while (!done) {
488 int tag = input.readTag();
489 switch (tag) {
490 case 0:
491 done = true;
492 break;
493 case 8: {
494 int v = input.readInt32();
495 ensureVarsIsMutable();
496 vars_.addInt(v);
497 break;
498 } // case 8
499 case 10: {
500 int length = input.readRawVarint32();
501 int limit = input.pushLimit(length);
502 ensureVarsIsMutable();
503 while (input.getBytesUntilLimit() > 0) {
504 vars_.addInt(input.readInt32());
505 }
506 input.popLimit(limit);
507 break;
508 } // case 10
509 case 16: {
510 long v = input.readInt64();
511 ensureValuesIsMutable();
512 values_.addLong(v);
513 break;
514 } // case 16
515 case 18: {
516 int length = input.readRawVarint32();
517 int limit = input.pushLimit(length);
518 ensureValuesIsMutable();
519 while (input.getBytesUntilLimit() > 0) {
520 values_.addLong(input.readInt64());
521 }
522 input.popLimit(limit);
523 break;
524 } // case 18
525 case 24: {
526 negated_ = input.readBool();
527 bitField0_ |= 0x00000004;
528 break;
529 } // case 24
530 default: {
531 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
532 done = true; // was an endgroup tag
533 }
534 break;
535 } // default:
536 } // switch (tag)
537 } // while (!done)
538 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
539 throw e.unwrapIOException();
540 } finally {
541 onChanged();
542 } // finally
543 return this;
544 }
545 private int bitField0_;
546
547 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
548 private void ensureVarsIsMutable() {
549 if (!vars_.isModifiable()) {
550 vars_ = makeMutableCopy(vars_);
551 }
552 bitField0_ |= 0x00000001;
553 }
558 public java.util.List<java.lang.Integer>
560 vars_.makeImmutable();
561 return vars_;
562 }
567 public int getVarsCount() {
568 return vars_.size();
569 }
575 public int getVars(int index) {
576 return vars_.getInt(index);
577 }
585 int index, int value) {
586
587 ensureVarsIsMutable();
588 vars_.setInt(index, value);
589 bitField0_ |= 0x00000001;
590 onChanged();
591 return this;
592 }
598 public Builder addVars(int value) {
599
600 ensureVarsIsMutable();
601 vars_.addInt(value);
602 bitField0_ |= 0x00000001;
603 onChanged();
604 return this;
605 }
612 java.lang.Iterable<? extends java.lang.Integer> values) {
613 ensureVarsIsMutable();
614 com.google.protobuf.AbstractMessageLite.Builder.addAll(
615 values, vars_);
616 bitField0_ |= 0x00000001;
617 onChanged();
618 return this;
619 }
625 vars_ = emptyIntList();
626 bitField0_ = (bitField0_ & ~0x00000001);
627 onChanged();
628 return this;
629 }
630
631 private com.google.protobuf.Internal.LongList values_ = emptyLongList();
632 private void ensureValuesIsMutable() {
633 if (!values_.isModifiable()) {
634 values_ = makeMutableCopy(values_);
635 }
636 bitField0_ |= 0x00000002;
637 }
642 public java.util.List<java.lang.Long>
644 values_.makeImmutable();
645 return values_;
646 }
651 public int getValuesCount() {
652 return values_.size();
653 }
659 public long getValues(int index) {
660 return values_.getLong(index);
661 }
669 int index, long value) {
670
671 ensureValuesIsMutable();
672 values_.setLong(index, value);
673 bitField0_ |= 0x00000002;
674 onChanged();
675 return this;
676 }
682 public Builder addValues(long value) {
683
684 ensureValuesIsMutable();
685 values_.addLong(value);
686 bitField0_ |= 0x00000002;
687 onChanged();
688 return this;
689 }
696 java.lang.Iterable<? extends java.lang.Long> values) {
697 ensureValuesIsMutable();
698 com.google.protobuf.AbstractMessageLite.Builder.addAll(
699 values, values_);
700 bitField0_ |= 0x00000002;
701 onChanged();
702 return this;
703 }
709 values_ = emptyLongList();
710 bitField0_ = (bitField0_ & ~0x00000002);
711 onChanged();
712 return this;
713 }
714
715 private boolean negated_ ;
725 @java.lang.Override
726 public boolean getNegated() {
727 return negated_;
728 }
739 public Builder setNegated(boolean value) {
740
741 negated_ = value;
742 bitField0_ |= 0x00000004;
743 onChanged();
744 return this;
745 }
756 bitField0_ = (bitField0_ & ~0x00000004);
757 negated_ = false;
758 onChanged();
759 return this;
760 }
761
762 // @@protoc_insertion_point(builder_scope:operations_research.sat.TableConstraintProto)
763 }
764
765 // @@protoc_insertion_point(class_scope:operations_research.sat.TableConstraintProto)
766 private static final com.google.ortools.sat.TableConstraintProto DEFAULT_INSTANCE;
767 static {
768 DEFAULT_INSTANCE = new com.google.ortools.sat.TableConstraintProto();
769 }
770
772 return DEFAULT_INSTANCE;
773 }
774
775 private static final com.google.protobuf.Parser<TableConstraintProto>
776 PARSER = new com.google.protobuf.AbstractParser<TableConstraintProto>() {
777 @java.lang.Override
778 public TableConstraintProto parsePartialFrom(
779 com.google.protobuf.CodedInputStream input,
780 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
781 throws com.google.protobuf.InvalidProtocolBufferException {
782 Builder builder = newBuilder();
783 try {
784 builder.mergeFrom(input, extensionRegistry);
785 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
786 throw e.setUnfinishedMessage(builder.buildPartial());
787 } catch (com.google.protobuf.UninitializedMessageException e) {
788 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
789 } catch (java.io.IOException e) {
790 throw new com.google.protobuf.InvalidProtocolBufferException(e)
791 .setUnfinishedMessage(builder.buildPartial());
792 }
793 return builder.buildPartial();
794 }
795 };
796
797 public static com.google.protobuf.Parser<TableConstraintProto> parser() {
798 return PARSER;
799 }
800
801 @java.lang.Override
802 public com.google.protobuf.Parser<TableConstraintProto> getParserForType() {
803 return PARSER;
804 }
805
806 @java.lang.Override
808 return DEFAULT_INSTANCE;
809 }
810
811}
812
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Builder addAllValues(java.lang.Iterable<? extends java.lang.Long > values)
Builder mergeFrom(com.google.ortools.sat.TableConstraintProto other)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder mergeFrom(com.google.protobuf.Message other)
com.google.ortools.sat.TableConstraintProto buildPartial()
com.google.ortools.sat.TableConstraintProto build()
Builder addAllVars(java.lang.Iterable<? extends java.lang.Integer > values)
com.google.ortools.sat.TableConstraintProto getDefaultInstanceForType()
static Builder newBuilder(com.google.ortools.sat.TableConstraintProto prototype)
static com.google.protobuf.Parser< TableConstraintProto > parser()
static com.google.ortools.sat.TableConstraintProto parseFrom(java.nio.ByteBuffer data)
static com.google.ortools.sat.TableConstraintProto parseFrom(com.google.protobuf.CodedInputStream input)
static com.google.ortools.sat.TableConstraintProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.TableConstraintProto parseFrom(byte[] data)
static com.google.ortools.sat.TableConstraintProto parseFrom(java.io.InputStream input)
com.google.ortools.sat.TableConstraintProto getDefaultInstanceForType()
java.util.List< java.lang.Integer > getVarsList()
com.google.protobuf.Parser< TableConstraintProto > getParserForType()
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
static com.google.ortools.sat.TableConstraintProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
java.util.List< java.lang.Long > getValuesList()
static com.google.ortools.sat.TableConstraintProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.TableConstraintProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
boolean equals(final java.lang.Object obj)
static com.google.ortools.sat.TableConstraintProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.TableConstraintProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
void writeTo(com.google.protobuf.CodedOutputStream output)
static com.google.ortools.sat.TableConstraintProto parseDelimitedFrom(java.io.InputStream input)
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
static com.google.ortools.sat.TableConstraintProto getDefaultInstance()
static com.google.ortools.sat.TableConstraintProto parseFrom(com.google.protobuf.ByteString data)