Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
InverseConstraintProto.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/sat/cp_model.proto
4// Protobuf Java Version: 4.31.1
5
6package com.google.ortools.sat;
7
16@com.google.protobuf.Generated
17public final class InverseConstraintProto extends
18 com.google.protobuf.GeneratedMessage implements
19 // @@protoc_insertion_point(message_implements:operations_research.sat.InverseConstraintProto)
21private static final long serialVersionUID = 0L;
22 static {
23 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
24 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
25 /* major= */ 4,
26 /* minor= */ 31,
27 /* patch= */ 1,
28 /* suffix= */ "",
29 InverseConstraintProto.class.getName());
30 }
31 // Use InverseConstraintProto.newBuilder() to construct.
32 private InverseConstraintProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
33 super(builder);
34 }
35 private InverseConstraintProto() {
36 fDirect_ = emptyIntList();
37 fInverse_ = emptyIntList();
38 }
39
40 public static final com.google.protobuf.Descriptors.Descriptor
42 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_InverseConstraintProto_descriptor;
43 }
44
45 @java.lang.Override
46 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
48 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_InverseConstraintProto_fieldAccessorTable
49 .ensureFieldAccessorsInitialized(
50 com.google.ortools.sat.InverseConstraintProto.class, com.google.ortools.sat.InverseConstraintProto.Builder.class);
51 }
52
53 public static final int F_DIRECT_FIELD_NUMBER = 1;
54 @SuppressWarnings("serial")
55 private com.google.protobuf.Internal.IntList fDirect_ =
56 emptyIntList();
61 @java.lang.Override
62 public java.util.List<java.lang.Integer>
64 return fDirect_;
65 }
66
70 public int getFDirectCount() {
71 return fDirect_.size();
72 }
73
78 public int getFDirect(int index) {
79 return fDirect_.getInt(index);
80 }
81 private int fDirectMemoizedSerializedSize = -1;
82
83 public static final int F_INVERSE_FIELD_NUMBER = 2;
84 @SuppressWarnings("serial")
85 private com.google.protobuf.Internal.IntList fInverse_ =
86 emptyIntList();
91 @java.lang.Override
92 public java.util.List<java.lang.Integer>
94 return fInverse_;
95 }
96
100 public int getFInverseCount() {
101 return fInverse_.size();
102 }
103
108 public int getFInverse(int index) {
109 return fInverse_.getInt(index);
110 }
111 private int fInverseMemoizedSerializedSize = -1;
112
113 private byte memoizedIsInitialized = -1;
114 @java.lang.Override
115 public final boolean isInitialized() {
116 byte isInitialized = memoizedIsInitialized;
117 if (isInitialized == 1) return true;
118 if (isInitialized == 0) return false;
119
120 memoizedIsInitialized = 1;
121 return true;
122 }
123
124 @java.lang.Override
125 public void writeTo(com.google.protobuf.CodedOutputStream output)
126 throws java.io.IOException {
128 if (getFDirectList().size() > 0) {
129 output.writeUInt32NoTag(10);
130 output.writeUInt32NoTag(fDirectMemoizedSerializedSize);
131 }
132 for (int i = 0; i < fDirect_.size(); i++) {
133 output.writeInt32NoTag(fDirect_.getInt(i));
134 }
135 if (getFInverseList().size() > 0) {
136 output.writeUInt32NoTag(18);
137 output.writeUInt32NoTag(fInverseMemoizedSerializedSize);
138 }
139 for (int i = 0; i < fInverse_.size(); i++) {
140 output.writeInt32NoTag(fInverse_.getInt(i));
141 }
142 getUnknownFields().writeTo(output);
143 }
144
145 @java.lang.Override
146 public int getSerializedSize() {
147 int size = memoizedSize;
148 if (size != -1) return size;
149
150 size = 0;
151 {
152 int dataSize = 0;
153 for (int i = 0; i < fDirect_.size(); i++) {
154 dataSize += com.google.protobuf.CodedOutputStream
155 .computeInt32SizeNoTag(fDirect_.getInt(i));
156 }
157 size += dataSize;
158 if (!getFDirectList().isEmpty()) {
159 size += 1;
160 size += com.google.protobuf.CodedOutputStream
161 .computeInt32SizeNoTag(dataSize);
162 }
163 fDirectMemoizedSerializedSize = dataSize;
164 }
165 {
166 int dataSize = 0;
167 for (int i = 0; i < fInverse_.size(); i++) {
168 dataSize += com.google.protobuf.CodedOutputStream
169 .computeInt32SizeNoTag(fInverse_.getInt(i));
170 }
171 size += dataSize;
172 if (!getFInverseList().isEmpty()) {
173 size += 1;
174 size += com.google.protobuf.CodedOutputStream
175 .computeInt32SizeNoTag(dataSize);
176 }
177 fInverseMemoizedSerializedSize = dataSize;
178 }
179 size += getUnknownFields().getSerializedSize();
180 memoizedSize = size;
181 return size;
182 }
183
184 @java.lang.Override
185 public boolean equals(final java.lang.Object obj) {
186 if (obj == this) {
187 return true;
188 }
189 if (!(obj instanceof com.google.ortools.sat.InverseConstraintProto)) {
190 return super.equals(obj);
191 }
192 com.google.ortools.sat.InverseConstraintProto other = (com.google.ortools.sat.InverseConstraintProto) obj;
193
194 if (!getFDirectList()
195 .equals(other.getFDirectList())) return false;
196 if (!getFInverseList()
197 .equals(other.getFInverseList())) return false;
198 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
199 return true;
200 }
201
202 @java.lang.Override
203 public int hashCode() {
204 if (memoizedHashCode != 0) {
205 return memoizedHashCode;
206 }
207 int hash = 41;
208 hash = (19 * hash) + getDescriptor().hashCode();
209 if (getFDirectCount() > 0) {
210 hash = (37 * hash) + F_DIRECT_FIELD_NUMBER;
211 hash = (53 * hash) + getFDirectList().hashCode();
212 }
213 if (getFInverseCount() > 0) {
214 hash = (37 * hash) + F_INVERSE_FIELD_NUMBER;
215 hash = (53 * hash) + getFInverseList().hashCode();
216 }
217 hash = (29 * hash) + getUnknownFields().hashCode();
218 memoizedHashCode = hash;
219 return hash;
220 }
221
223 java.nio.ByteBuffer data)
224 throws com.google.protobuf.InvalidProtocolBufferException {
225 return PARSER.parseFrom(data);
226 }
228 java.nio.ByteBuffer data,
229 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
230 throws com.google.protobuf.InvalidProtocolBufferException {
231 return PARSER.parseFrom(data, extensionRegistry);
232 }
234 com.google.protobuf.ByteString data)
235 throws com.google.protobuf.InvalidProtocolBufferException {
236 return PARSER.parseFrom(data);
237 }
239 com.google.protobuf.ByteString data,
240 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
241 throws com.google.protobuf.InvalidProtocolBufferException {
242 return PARSER.parseFrom(data, extensionRegistry);
243 }
245 throws com.google.protobuf.InvalidProtocolBufferException {
246 return PARSER.parseFrom(data);
247 }
249 byte[] data,
250 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
251 throws com.google.protobuf.InvalidProtocolBufferException {
252 return PARSER.parseFrom(data, extensionRegistry);
253 }
254 public static com.google.ortools.sat.InverseConstraintProto parseFrom(java.io.InputStream input)
255 throws java.io.IOException {
256 return com.google.protobuf.GeneratedMessage
257 .parseWithIOException(PARSER, input);
258 }
260 java.io.InputStream input,
261 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
262 throws java.io.IOException {
263 return com.google.protobuf.GeneratedMessage
264 .parseWithIOException(PARSER, input, extensionRegistry);
265 }
266
268 throws java.io.IOException {
269 return com.google.protobuf.GeneratedMessage
270 .parseDelimitedWithIOException(PARSER, input);
271 }
272
274 java.io.InputStream input,
275 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
276 throws java.io.IOException {
277 return com.google.protobuf.GeneratedMessage
278 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
279 }
281 com.google.protobuf.CodedInputStream input)
282 throws java.io.IOException {
283 return com.google.protobuf.GeneratedMessage
284 .parseWithIOException(PARSER, input);
285 }
287 com.google.protobuf.CodedInputStream 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
294 @java.lang.Override
295 public Builder newBuilderForType() { return newBuilder(); }
296 public static Builder newBuilder() {
297 return DEFAULT_INSTANCE.toBuilder();
298 }
299 public static Builder newBuilder(com.google.ortools.sat.InverseConstraintProto prototype) {
300 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
301 }
302 @java.lang.Override
304 return this == DEFAULT_INSTANCE
305 ? new Builder() : new Builder().mergeFrom(this);
306 }
307
308 @java.lang.Override
310 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
311 Builder builder = new Builder(parent);
312 return builder;
313 }
314
322 public static final class Builder extends
323 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
324 // @@protoc_insertion_point(builder_implements:operations_research.sat.InverseConstraintProto)
326 public static final com.google.protobuf.Descriptors.Descriptor
328 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_InverseConstraintProto_descriptor;
329 }
330
331 @java.lang.Override
332 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
334 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_InverseConstraintProto_fieldAccessorTable
335 .ensureFieldAccessorsInitialized(
336 com.google.ortools.sat.InverseConstraintProto.class, com.google.ortools.sat.InverseConstraintProto.Builder.class);
337 }
338
339 // Construct using com.google.ortools.sat.InverseConstraintProto.newBuilder()
340 private Builder() {
341
342 }
343
344 private Builder(
345 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
346 super(parent);
347
348 }
349 @java.lang.Override
350 public Builder clear() {
351 super.clear();
352 bitField0_ = 0;
353 fDirect_ = emptyIntList();
354 fInverse_ = emptyIntList();
355 return this;
356 }
357
358 @java.lang.Override
359 public com.google.protobuf.Descriptors.Descriptor
361 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_InverseConstraintProto_descriptor;
362 }
363
364 @java.lang.Override
366 return com.google.ortools.sat.InverseConstraintProto.getDefaultInstance();
367 }
368
369 @java.lang.Override
372 if (!result.isInitialized()) {
373 throw newUninitializedMessageException(result);
374 }
375 return result;
376 }
377
378 @java.lang.Override
380 com.google.ortools.sat.InverseConstraintProto result = new com.google.ortools.sat.InverseConstraintProto(this);
381 if (bitField0_ != 0) { buildPartial0(result); }
382 onBuilt();
383 return result;
384 }
385
386 private void buildPartial0(com.google.ortools.sat.InverseConstraintProto result) {
387 int from_bitField0_ = bitField0_;
388 if (((from_bitField0_ & 0x00000001) != 0)) {
389 fDirect_.makeImmutable();
390 result.fDirect_ = fDirect_;
391 }
392 if (((from_bitField0_ & 0x00000002) != 0)) {
393 fInverse_.makeImmutable();
394 result.fInverse_ = fInverse_;
395 }
396 }
397
398 @java.lang.Override
399 public Builder mergeFrom(com.google.protobuf.Message other) {
400 if (other instanceof com.google.ortools.sat.InverseConstraintProto) {
401 return mergeFrom((com.google.ortools.sat.InverseConstraintProto)other);
402 } else {
403 super.mergeFrom(other);
404 return this;
405 }
406 }
407
408 public Builder mergeFrom(com.google.ortools.sat.InverseConstraintProto other) {
409 if (other == com.google.ortools.sat.InverseConstraintProto.getDefaultInstance()) return this;
410 if (!other.fDirect_.isEmpty()) {
411 if (fDirect_.isEmpty()) {
412 fDirect_ = other.fDirect_;
413 fDirect_.makeImmutable();
414 bitField0_ |= 0x00000001;
415 } else {
416 ensureFDirectIsMutable();
417 fDirect_.addAll(other.fDirect_);
418 }
419 onChanged();
420 }
421 if (!other.fInverse_.isEmpty()) {
422 if (fInverse_.isEmpty()) {
423 fInverse_ = other.fInverse_;
424 fInverse_.makeImmutable();
425 bitField0_ |= 0x00000002;
426 } else {
427 ensureFInverseIsMutable();
428 fInverse_.addAll(other.fInverse_);
429 }
430 onChanged();
431 }
432 this.mergeUnknownFields(other.getUnknownFields());
433 onChanged();
434 return this;
435 }
436
437 @java.lang.Override
438 public final boolean isInitialized() {
439 return true;
440 }
441
442 @java.lang.Override
443 public Builder mergeFrom(
444 com.google.protobuf.CodedInputStream input,
445 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
446 throws java.io.IOException {
447 if (extensionRegistry == null) {
448 throw new java.lang.NullPointerException();
449 }
450 try {
451 boolean done = false;
452 while (!done) {
453 int tag = input.readTag();
454 switch (tag) {
455 case 0:
456 done = true;
457 break;
458 case 8: {
459 int v = input.readInt32();
460 ensureFDirectIsMutable();
461 fDirect_.addInt(v);
462 break;
463 } // case 8
464 case 10: {
465 int length = input.readRawVarint32();
466 int limit = input.pushLimit(length);
467 ensureFDirectIsMutable();
468 while (input.getBytesUntilLimit() > 0) {
469 fDirect_.addInt(input.readInt32());
470 }
471 input.popLimit(limit);
472 break;
473 } // case 10
474 case 16: {
475 int v = input.readInt32();
476 ensureFInverseIsMutable();
477 fInverse_.addInt(v);
478 break;
479 } // case 16
480 case 18: {
481 int length = input.readRawVarint32();
482 int limit = input.pushLimit(length);
483 ensureFInverseIsMutable();
484 while (input.getBytesUntilLimit() > 0) {
485 fInverse_.addInt(input.readInt32());
486 }
487 input.popLimit(limit);
488 break;
489 } // case 18
490 default: {
491 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
492 done = true; // was an endgroup tag
493 }
494 break;
495 } // default:
496 } // switch (tag)
497 } // while (!done)
498 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
499 throw e.unwrapIOException();
500 } finally {
501 onChanged();
502 } // finally
503 return this;
504 }
505 private int bitField0_;
506
507 private com.google.protobuf.Internal.IntList fDirect_ = emptyIntList();
508 private void ensureFDirectIsMutable() {
509 if (!fDirect_.isModifiable()) {
510 fDirect_ = makeMutableCopy(fDirect_);
511 }
512 bitField0_ |= 0x00000001;
513 }
518 public java.util.List<java.lang.Integer>
520 fDirect_.makeImmutable();
521 return fDirect_;
522 }
523
527 public int getFDirectCount() {
528 return fDirect_.size();
529 }
530
535 public int getFDirect(int index) {
536 return fDirect_.getInt(index);
537 }
538
544 public Builder setFDirect(
545 int index, int value) {
546
547 ensureFDirectIsMutable();
548 fDirect_.setInt(index, value);
549 bitField0_ |= 0x00000001;
550 onChanged();
551 return this;
552 }
553
558 public Builder addFDirect(int value) {
559
560 ensureFDirectIsMutable();
561 fDirect_.addInt(value);
562 bitField0_ |= 0x00000001;
563 onChanged();
564 return this;
565 }
566
571 public Builder addAllFDirect(
572 java.lang.Iterable<? extends java.lang.Integer> values) {
573 ensureFDirectIsMutable();
574 com.google.protobuf.AbstractMessageLite.Builder.addAll(
575 values, fDirect_);
576 bitField0_ |= 0x00000001;
577 onChanged();
578 return this;
579 }
580
584 public Builder clearFDirect() {
585 fDirect_ = emptyIntList();
586 bitField0_ = (bitField0_ & ~0x00000001);
587 onChanged();
588 return this;
589 }
590
591 private com.google.protobuf.Internal.IntList fInverse_ = emptyIntList();
592 private void ensureFInverseIsMutable() {
593 if (!fInverse_.isModifiable()) {
594 fInverse_ = makeMutableCopy(fInverse_);
595 }
596 bitField0_ |= 0x00000002;
597 }
602 public java.util.List<java.lang.Integer>
604 fInverse_.makeImmutable();
605 return fInverse_;
606 }
607
611 public int getFInverseCount() {
612 return fInverse_.size();
613 }
614
619 public int getFInverse(int index) {
620 return fInverse_.getInt(index);
621 }
622
628 public Builder setFInverse(
629 int index, int value) {
630
631 ensureFInverseIsMutable();
632 fInverse_.setInt(index, value);
633 bitField0_ |= 0x00000002;
634 onChanged();
635 return this;
636 }
637
642 public Builder addFInverse(int value) {
643
644 ensureFInverseIsMutable();
645 fInverse_.addInt(value);
646 bitField0_ |= 0x00000002;
647 onChanged();
648 return this;
649 }
650
655 public Builder addAllFInverse(
656 java.lang.Iterable<? extends java.lang.Integer> values) {
657 ensureFInverseIsMutable();
658 com.google.protobuf.AbstractMessageLite.Builder.addAll(
659 values, fInverse_);
660 bitField0_ |= 0x00000002;
661 onChanged();
662 return this;
663 }
664
668 public Builder clearFInverse() {
669 fInverse_ = emptyIntList();
670 bitField0_ = (bitField0_ & ~0x00000002);
671 onChanged();
672 return this;
673 }
674
675 // @@protoc_insertion_point(builder_scope:operations_research.sat.InverseConstraintProto)
676 }
677
678 // @@protoc_insertion_point(class_scope:operations_research.sat.InverseConstraintProto)
679 private static final com.google.ortools.sat.InverseConstraintProto DEFAULT_INSTANCE;
680 static {
681 DEFAULT_INSTANCE = new com.google.ortools.sat.InverseConstraintProto();
682 }
683
685 return DEFAULT_INSTANCE;
686 }
687
688 private static final com.google.protobuf.Parser<InverseConstraintProto>
689 PARSER = new com.google.protobuf.AbstractParser<InverseConstraintProto>() {
690 @java.lang.Override
691 public InverseConstraintProto parsePartialFrom(
692 com.google.protobuf.CodedInputStream input,
693 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
694 throws com.google.protobuf.InvalidProtocolBufferException {
695 Builder builder = newBuilder();
696 try {
697 builder.mergeFrom(input, extensionRegistry);
698 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
699 throw e.setUnfinishedMessage(builder.buildPartial());
700 } catch (com.google.protobuf.UninitializedMessageException e) {
701 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
702 } catch (java.io.IOException e) {
703 throw new com.google.protobuf.InvalidProtocolBufferException(e)
704 .setUnfinishedMessage(builder.buildPartial());
705 }
706 return builder.buildPartial();
707 }
708 };
709
710 public static com.google.protobuf.Parser<InverseConstraintProto> parser() {
711 return PARSER;
712 }
713
714 @java.lang.Override
715 public com.google.protobuf.Parser<InverseConstraintProto> getParserForType() {
716 return PARSER;
717 }
718
719 @java.lang.Override
723
724}
725
com.google.ortools.sat.InverseConstraintProto buildPartial()
com.google.ortools.sat.InverseConstraintProto build()
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
Builder addAllFDirect(java.lang.Iterable<? extends java.lang.Integer > values)
Builder mergeFrom(com.google.protobuf.Message other)
Builder mergeFrom(com.google.ortools.sat.InverseConstraintProto other)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
com.google.ortools.sat.InverseConstraintProto getDefaultInstanceForType()
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder addAllFInverse(java.lang.Iterable<? extends java.lang.Integer > values)
java.util.List< java.lang.Integer > getFDirectList()
static com.google.ortools.sat.InverseConstraintProto parseFrom(com.google.protobuf.ByteString data)
java.util.List< java.lang.Integer > getFInverseList()
com.google.protobuf.Parser< InverseConstraintProto > getParserForType()
static com.google.ortools.sat.InverseConstraintProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.InverseConstraintProto parseFrom(byte[] data)
static com.google.ortools.sat.InverseConstraintProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.InverseConstraintProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.InverseConstraintProto parseFrom(java.io.InputStream input)
static com.google.ortools.sat.InverseConstraintProto parseFrom(java.nio.ByteBuffer data)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
com.google.ortools.sat.InverseConstraintProto getDefaultInstanceForType()
static com.google.ortools.sat.InverseConstraintProto parseDelimitedFrom(java.io.InputStream input)
void writeTo(com.google.protobuf.CodedOutputStream output)
static Builder newBuilder(com.google.ortools.sat.InverseConstraintProto prototype)
static com.google.ortools.sat.InverseConstraintProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
static com.google.ortools.sat.InverseConstraintProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
static com.google.ortools.sat.InverseConstraintProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.protobuf.Parser< InverseConstraintProto > parser()
static com.google.ortools.sat.InverseConstraintProto parseFrom(com.google.protobuf.CodedInputStream input)
static com.google.ortools.sat.InverseConstraintProto getDefaultInstance()