Google OR-Tools v9.11
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// source: ortools/sat/cp_model.proto
3
4// Protobuf Java Version: 4.26.1
5package com.google.ortools.sat;
6
15public final class InverseConstraintProto extends
16 com.google.protobuf.GeneratedMessage implements
17 // @@protoc_insertion_point(message_implements:operations_research.sat.InverseConstraintProto)
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= */ 26,
25 /* patch= */ 1,
26 /* suffix= */ "",
27 InverseConstraintProto.class.getName());
28 }
29 // Use InverseConstraintProto.newBuilder() to construct.
30 private InverseConstraintProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
31 super(builder);
32 }
33 private InverseConstraintProto() {
34 fDirect_ = emptyIntList();
35 fInverse_ = emptyIntList();
36 }
37
38 public static final com.google.protobuf.Descriptors.Descriptor
40 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_InverseConstraintProto_descriptor;
41 }
42
43 @java.lang.Override
44 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
46 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_InverseConstraintProto_fieldAccessorTable
47 .ensureFieldAccessorsInitialized(
48 com.google.ortools.sat.InverseConstraintProto.class, com.google.ortools.sat.InverseConstraintProto.Builder.class);
49 }
50
51 public static final int F_DIRECT_FIELD_NUMBER = 1;
52 @SuppressWarnings("serial")
53 private com.google.protobuf.Internal.IntList fDirect_ =
54 emptyIntList();
59 @java.lang.Override
60 public java.util.List<java.lang.Integer>
62 return fDirect_;
63 }
68 public int getFDirectCount() {
69 return fDirect_.size();
70 }
76 public int getFDirect(int index) {
77 return fDirect_.getInt(index);
78 }
79 private int fDirectMemoizedSerializedSize = -1;
80
81 public static final int F_INVERSE_FIELD_NUMBER = 2;
82 @SuppressWarnings("serial")
83 private com.google.protobuf.Internal.IntList fInverse_ =
84 emptyIntList();
89 @java.lang.Override
90 public java.util.List<java.lang.Integer>
92 return fInverse_;
93 }
98 public int getFInverseCount() {
99 return fInverse_.size();
100 }
106 public int getFInverse(int index) {
107 return fInverse_.getInt(index);
108 }
109 private int fInverseMemoizedSerializedSize = -1;
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 {
126 if (getFDirectList().size() > 0) {
127 output.writeUInt32NoTag(10);
128 output.writeUInt32NoTag(fDirectMemoizedSerializedSize);
129 }
130 for (int i = 0; i < fDirect_.size(); i++) {
131 output.writeInt32NoTag(fDirect_.getInt(i));
132 }
133 if (getFInverseList().size() > 0) {
134 output.writeUInt32NoTag(18);
135 output.writeUInt32NoTag(fInverseMemoizedSerializedSize);
136 }
137 for (int i = 0; i < fInverse_.size(); i++) {
138 output.writeInt32NoTag(fInverse_.getInt(i));
139 }
140 getUnknownFields().writeTo(output);
141 }
142
143 @java.lang.Override
144 public int getSerializedSize() {
145 int size = memoizedSize;
146 if (size != -1) return size;
147
148 size = 0;
149 {
150 int dataSize = 0;
151 for (int i = 0; i < fDirect_.size(); i++) {
152 dataSize += com.google.protobuf.CodedOutputStream
153 .computeInt32SizeNoTag(fDirect_.getInt(i));
154 }
155 size += dataSize;
156 if (!getFDirectList().isEmpty()) {
157 size += 1;
158 size += com.google.protobuf.CodedOutputStream
159 .computeInt32SizeNoTag(dataSize);
160 }
161 fDirectMemoizedSerializedSize = dataSize;
162 }
163 {
164 int dataSize = 0;
165 for (int i = 0; i < fInverse_.size(); i++) {
166 dataSize += com.google.protobuf.CodedOutputStream
167 .computeInt32SizeNoTag(fInverse_.getInt(i));
168 }
169 size += dataSize;
170 if (!getFInverseList().isEmpty()) {
171 size += 1;
172 size += com.google.protobuf.CodedOutputStream
173 .computeInt32SizeNoTag(dataSize);
174 }
175 fInverseMemoizedSerializedSize = dataSize;
176 }
177 size += getUnknownFields().getSerializedSize();
178 memoizedSize = size;
179 return size;
180 }
181
182 @java.lang.Override
183 public boolean equals(final java.lang.Object obj) {
184 if (obj == this) {
185 return true;
186 }
187 if (!(obj instanceof com.google.ortools.sat.InverseConstraintProto)) {
188 return super.equals(obj);
189 }
190 com.google.ortools.sat.InverseConstraintProto other = (com.google.ortools.sat.InverseConstraintProto) obj;
191
192 if (!getFDirectList()
193 .equals(other.getFDirectList())) return false;
194 if (!getFInverseList()
195 .equals(other.getFInverseList())) return false;
196 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
197 return true;
198 }
199
200 @java.lang.Override
201 public int hashCode() {
202 if (memoizedHashCode != 0) {
203 return memoizedHashCode;
204 }
205 int hash = 41;
206 hash = (19 * hash) + getDescriptor().hashCode();
207 if (getFDirectCount() > 0) {
208 hash = (37 * hash) + F_DIRECT_FIELD_NUMBER;
209 hash = (53 * hash) + getFDirectList().hashCode();
210 }
211 if (getFInverseCount() > 0) {
212 hash = (37 * hash) + F_INVERSE_FIELD_NUMBER;
213 hash = (53 * hash) + getFInverseList().hashCode();
214 }
215 hash = (29 * hash) + getUnknownFields().hashCode();
216 memoizedHashCode = hash;
217 return hash;
218 }
219
221 java.nio.ByteBuffer data)
222 throws com.google.protobuf.InvalidProtocolBufferException {
223 return PARSER.parseFrom(data);
224 }
226 java.nio.ByteBuffer data,
227 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
228 throws com.google.protobuf.InvalidProtocolBufferException {
229 return PARSER.parseFrom(data, extensionRegistry);
230 }
232 com.google.protobuf.ByteString data)
233 throws com.google.protobuf.InvalidProtocolBufferException {
234 return PARSER.parseFrom(data);
235 }
237 com.google.protobuf.ByteString data,
238 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
239 throws com.google.protobuf.InvalidProtocolBufferException {
240 return PARSER.parseFrom(data, extensionRegistry);
241 }
243 throws com.google.protobuf.InvalidProtocolBufferException {
244 return PARSER.parseFrom(data);
245 }
247 byte[] data,
248 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
249 throws com.google.protobuf.InvalidProtocolBufferException {
250 return PARSER.parseFrom(data, extensionRegistry);
251 }
252 public static com.google.ortools.sat.InverseConstraintProto parseFrom(java.io.InputStream input)
253 throws java.io.IOException {
254 return com.google.protobuf.GeneratedMessage
255 .parseWithIOException(PARSER, input);
256 }
258 java.io.InputStream input,
259 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
260 throws java.io.IOException {
261 return com.google.protobuf.GeneratedMessage
262 .parseWithIOException(PARSER, input, extensionRegistry);
263 }
264
266 throws java.io.IOException {
267 return com.google.protobuf.GeneratedMessage
268 .parseDelimitedWithIOException(PARSER, input);
269 }
270
272 java.io.InputStream input,
273 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
274 throws java.io.IOException {
275 return com.google.protobuf.GeneratedMessage
276 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
277 }
279 com.google.protobuf.CodedInputStream input)
280 throws java.io.IOException {
281 return com.google.protobuf.GeneratedMessage
282 .parseWithIOException(PARSER, input);
283 }
285 com.google.protobuf.CodedInputStream input,
286 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
287 throws java.io.IOException {
288 return com.google.protobuf.GeneratedMessage
289 .parseWithIOException(PARSER, input, extensionRegistry);
290 }
291
292 @java.lang.Override
293 public Builder newBuilderForType() { return newBuilder(); }
294 public static Builder newBuilder() {
295 return DEFAULT_INSTANCE.toBuilder();
296 }
297 public static Builder newBuilder(com.google.ortools.sat.InverseConstraintProto prototype) {
298 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
299 }
300 @java.lang.Override
302 return this == DEFAULT_INSTANCE
303 ? new Builder() : new Builder().mergeFrom(this);
304 }
305
306 @java.lang.Override
308 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
309 Builder builder = new Builder(parent);
310 return builder;
311 }
320 public static final class Builder extends
321 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
322 // @@protoc_insertion_point(builder_implements:operations_research.sat.InverseConstraintProto)
323 com.google.ortools.sat.InverseConstraintProtoOrBuilder {
324 public static final com.google.protobuf.Descriptors.Descriptor
326 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_InverseConstraintProto_descriptor;
327 }
328
329 @java.lang.Override
330 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
332 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_InverseConstraintProto_fieldAccessorTable
333 .ensureFieldAccessorsInitialized(
334 com.google.ortools.sat.InverseConstraintProto.class, com.google.ortools.sat.InverseConstraintProto.Builder.class);
335 }
336
337 // Construct using com.google.ortools.sat.InverseConstraintProto.newBuilder()
338 private Builder() {
339
340 }
341
342 private Builder(
343 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
344 super(parent);
345
346 }
347 @java.lang.Override
348 public Builder clear() {
349 super.clear();
350 bitField0_ = 0;
351 fDirect_ = emptyIntList();
352 fInverse_ = emptyIntList();
353 return this;
354 }
355
356 @java.lang.Override
357 public com.google.protobuf.Descriptors.Descriptor
359 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_InverseConstraintProto_descriptor;
360 }
361
362 @java.lang.Override
364 return com.google.ortools.sat.InverseConstraintProto.getDefaultInstance();
365 }
366
367 @java.lang.Override
370 if (!result.isInitialized()) {
371 throw newUninitializedMessageException(result);
372 }
373 return result;
374 }
375
376 @java.lang.Override
378 com.google.ortools.sat.InverseConstraintProto result = new com.google.ortools.sat.InverseConstraintProto(this);
379 if (bitField0_ != 0) { buildPartial0(result); }
380 onBuilt();
381 return result;
382 }
383
384 private void buildPartial0(com.google.ortools.sat.InverseConstraintProto result) {
385 int from_bitField0_ = bitField0_;
386 if (((from_bitField0_ & 0x00000001) != 0)) {
387 fDirect_.makeImmutable();
388 result.fDirect_ = fDirect_;
389 }
390 if (((from_bitField0_ & 0x00000002) != 0)) {
391 fInverse_.makeImmutable();
392 result.fInverse_ = fInverse_;
393 }
394 }
395
396 @java.lang.Override
397 public Builder mergeFrom(com.google.protobuf.Message other) {
398 if (other instanceof com.google.ortools.sat.InverseConstraintProto) {
399 return mergeFrom((com.google.ortools.sat.InverseConstraintProto)other);
400 } else {
401 super.mergeFrom(other);
402 return this;
403 }
404 }
405
406 public Builder mergeFrom(com.google.ortools.sat.InverseConstraintProto other) {
407 if (other == com.google.ortools.sat.InverseConstraintProto.getDefaultInstance()) return this;
408 if (!other.fDirect_.isEmpty()) {
409 if (fDirect_.isEmpty()) {
410 fDirect_ = other.fDirect_;
411 fDirect_.makeImmutable();
412 bitField0_ |= 0x00000001;
413 } else {
414 ensureFDirectIsMutable();
415 fDirect_.addAll(other.fDirect_);
416 }
417 onChanged();
418 }
419 if (!other.fInverse_.isEmpty()) {
420 if (fInverse_.isEmpty()) {
421 fInverse_ = other.fInverse_;
422 fInverse_.makeImmutable();
423 bitField0_ |= 0x00000002;
424 } else {
425 ensureFInverseIsMutable();
426 fInverse_.addAll(other.fInverse_);
427 }
428 onChanged();
429 }
430 this.mergeUnknownFields(other.getUnknownFields());
431 onChanged();
432 return this;
433 }
434
435 @java.lang.Override
436 public final boolean isInitialized() {
437 return true;
438 }
439
440 @java.lang.Override
442 com.google.protobuf.CodedInputStream input,
443 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
444 throws java.io.IOException {
445 if (extensionRegistry == null) {
446 throw new java.lang.NullPointerException();
447 }
448 try {
449 boolean done = false;
450 while (!done) {
451 int tag = input.readTag();
452 switch (tag) {
453 case 0:
454 done = true;
455 break;
456 case 8: {
457 int v = input.readInt32();
458 ensureFDirectIsMutable();
459 fDirect_.addInt(v);
460 break;
461 } // case 8
462 case 10: {
463 int length = input.readRawVarint32();
464 int limit = input.pushLimit(length);
465 ensureFDirectIsMutable();
466 while (input.getBytesUntilLimit() > 0) {
467 fDirect_.addInt(input.readInt32());
468 }
469 input.popLimit(limit);
470 break;
471 } // case 10
472 case 16: {
473 int v = input.readInt32();
474 ensureFInverseIsMutable();
475 fInverse_.addInt(v);
476 break;
477 } // case 16
478 case 18: {
479 int length = input.readRawVarint32();
480 int limit = input.pushLimit(length);
481 ensureFInverseIsMutable();
482 while (input.getBytesUntilLimit() > 0) {
483 fInverse_.addInt(input.readInt32());
484 }
485 input.popLimit(limit);
486 break;
487 } // case 18
488 default: {
489 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
490 done = true; // was an endgroup tag
491 }
492 break;
493 } // default:
494 } // switch (tag)
495 } // while (!done)
496 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
497 throw e.unwrapIOException();
498 } finally {
499 onChanged();
500 } // finally
501 return this;
502 }
503 private int bitField0_;
504
505 private com.google.protobuf.Internal.IntList fDirect_ = emptyIntList();
506 private void ensureFDirectIsMutable() {
507 if (!fDirect_.isModifiable()) {
508 fDirect_ = makeMutableCopy(fDirect_);
509 }
510 bitField0_ |= 0x00000001;
511 }
516 public java.util.List<java.lang.Integer>
518 fDirect_.makeImmutable();
519 return fDirect_;
520 }
525 public int getFDirectCount() {
526 return fDirect_.size();
527 }
533 public int getFDirect(int index) {
534 return fDirect_.getInt(index);
535 }
543 int index, int value) {
544
545 ensureFDirectIsMutable();
546 fDirect_.setInt(index, value);
547 bitField0_ |= 0x00000001;
548 onChanged();
549 return this;
550 }
556 public Builder addFDirect(int value) {
557
558 ensureFDirectIsMutable();
559 fDirect_.addInt(value);
560 bitField0_ |= 0x00000001;
561 onChanged();
562 return this;
563 }
570 java.lang.Iterable<? extends java.lang.Integer> values) {
571 ensureFDirectIsMutable();
572 com.google.protobuf.AbstractMessageLite.Builder.addAll(
573 values, fDirect_);
574 bitField0_ |= 0x00000001;
575 onChanged();
576 return this;
577 }
583 fDirect_ = emptyIntList();
584 bitField0_ = (bitField0_ & ~0x00000001);
585 onChanged();
586 return this;
587 }
588
589 private com.google.protobuf.Internal.IntList fInverse_ = emptyIntList();
590 private void ensureFInverseIsMutable() {
591 if (!fInverse_.isModifiable()) {
592 fInverse_ = makeMutableCopy(fInverse_);
593 }
594 bitField0_ |= 0x00000002;
595 }
600 public java.util.List<java.lang.Integer>
602 fInverse_.makeImmutable();
603 return fInverse_;
604 }
609 public int getFInverseCount() {
610 return fInverse_.size();
611 }
617 public int getFInverse(int index) {
618 return fInverse_.getInt(index);
619 }
627 int index, int value) {
628
629 ensureFInverseIsMutable();
630 fInverse_.setInt(index, value);
631 bitField0_ |= 0x00000002;
632 onChanged();
633 return this;
634 }
640 public Builder addFInverse(int value) {
641
642 ensureFInverseIsMutable();
643 fInverse_.addInt(value);
644 bitField0_ |= 0x00000002;
645 onChanged();
646 return this;
647 }
654 java.lang.Iterable<? extends java.lang.Integer> values) {
655 ensureFInverseIsMutable();
656 com.google.protobuf.AbstractMessageLite.Builder.addAll(
657 values, fInverse_);
658 bitField0_ |= 0x00000002;
659 onChanged();
660 return this;
661 }
667 fInverse_ = emptyIntList();
668 bitField0_ = (bitField0_ & ~0x00000002);
669 onChanged();
670 return this;
671 }
672
673 // @@protoc_insertion_point(builder_scope:operations_research.sat.InverseConstraintProto)
674 }
675
676 // @@protoc_insertion_point(class_scope:operations_research.sat.InverseConstraintProto)
677 private static final com.google.ortools.sat.InverseConstraintProto DEFAULT_INSTANCE;
678 static {
679 DEFAULT_INSTANCE = new com.google.ortools.sat.InverseConstraintProto();
680 }
681
683 return DEFAULT_INSTANCE;
684 }
685
686 private static final com.google.protobuf.Parser<InverseConstraintProto>
687 PARSER = new com.google.protobuf.AbstractParser<InverseConstraintProto>() {
688 @java.lang.Override
689 public InverseConstraintProto parsePartialFrom(
690 com.google.protobuf.CodedInputStream input,
691 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
692 throws com.google.protobuf.InvalidProtocolBufferException {
693 Builder builder = newBuilder();
694 try {
695 builder.mergeFrom(input, extensionRegistry);
696 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
697 throw e.setUnfinishedMessage(builder.buildPartial());
698 } catch (com.google.protobuf.UninitializedMessageException e) {
699 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
700 } catch (java.io.IOException e) {
701 throw new com.google.protobuf.InvalidProtocolBufferException(e)
702 .setUnfinishedMessage(builder.buildPartial());
703 }
704 return builder.buildPartial();
705 }
706 };
707
708 public static com.google.protobuf.Parser<InverseConstraintProto> parser() {
709 return PARSER;
710 }
711
712 @java.lang.Override
713 public com.google.protobuf.Parser<InverseConstraintProto> getParserForType() {
714 return PARSER;
715 }
716
717 @java.lang.Override
721
722}
723
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()