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