Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
SparsePermutationProto.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 SparsePermutationProto extends
17 com.google.protobuf.GeneratedMessage implements
18 // @@protoc_insertion_point(message_implements:operations_research.sat.SparsePermutationProto)
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 SparsePermutationProto.class.getName());
29 }
30 // Use SparsePermutationProto.newBuilder() to construct.
31 private SparsePermutationProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
32 super(builder);
33 }
34 private SparsePermutationProto() {
35 support_ = emptyIntList();
36 cycleSizes_ = emptyIntList();
37 }
38
39 public static final com.google.protobuf.Descriptors.Descriptor
41 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_SparsePermutationProto_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_SparsePermutationProto_fieldAccessorTable
48 .ensureFieldAccessorsInitialized(
49 com.google.ortools.sat.SparsePermutationProto.class, com.google.ortools.sat.SparsePermutationProto.Builder.class);
50 }
51
52 public static final int SUPPORT_FIELD_NUMBER = 1;
53 @SuppressWarnings("serial")
54 private com.google.protobuf.Internal.IntList support_ =
55 emptyIntList();
65 @java.lang.Override
66 public java.util.List<java.lang.Integer>
68 return support_;
69 }
70
79 public int getSupportCount() {
80 return support_.size();
81 }
82
92 public int getSupport(int index) {
93 return support_.getInt(index);
94 }
95 private int supportMemoizedSerializedSize = -1;
96
97 public static final int CYCLE_SIZES_FIELD_NUMBER = 2;
98 @SuppressWarnings("serial")
99 private com.google.protobuf.Internal.IntList cycleSizes_ =
100 emptyIntList();
105 @java.lang.Override
106 public java.util.List<java.lang.Integer>
108 return cycleSizes_;
109 }
110
114 public int getCycleSizesCount() {
115 return cycleSizes_.size();
116 }
117
122 public int getCycleSizes(int index) {
123 return cycleSizes_.getInt(index);
124 }
125 private int cycleSizesMemoizedSerializedSize = -1;
126
127 private byte memoizedIsInitialized = -1;
128 @java.lang.Override
129 public final boolean isInitialized() {
130 byte isInitialized = memoizedIsInitialized;
131 if (isInitialized == 1) return true;
132 if (isInitialized == 0) return false;
133
134 memoizedIsInitialized = 1;
135 return true;
136 }
137
138 @java.lang.Override
139 public void writeTo(com.google.protobuf.CodedOutputStream output)
140 throws java.io.IOException {
142 if (getSupportList().size() > 0) {
143 output.writeUInt32NoTag(10);
144 output.writeUInt32NoTag(supportMemoizedSerializedSize);
145 }
146 for (int i = 0; i < support_.size(); i++) {
147 output.writeInt32NoTag(support_.getInt(i));
148 }
149 if (getCycleSizesList().size() > 0) {
150 output.writeUInt32NoTag(18);
151 output.writeUInt32NoTag(cycleSizesMemoizedSerializedSize);
152 }
153 for (int i = 0; i < cycleSizes_.size(); i++) {
154 output.writeInt32NoTag(cycleSizes_.getInt(i));
155 }
156 getUnknownFields().writeTo(output);
157 }
158
159 @java.lang.Override
160 public int getSerializedSize() {
161 int size = memoizedSize;
162 if (size != -1) return size;
163
164 size = 0;
165 {
166 int dataSize = 0;
167 for (int i = 0; i < support_.size(); i++) {
168 dataSize += com.google.protobuf.CodedOutputStream
169 .computeInt32SizeNoTag(support_.getInt(i));
170 }
171 size += dataSize;
172 if (!getSupportList().isEmpty()) {
173 size += 1;
174 size += com.google.protobuf.CodedOutputStream
175 .computeInt32SizeNoTag(dataSize);
176 }
177 supportMemoizedSerializedSize = dataSize;
178 }
179 {
180 int dataSize = 0;
181 for (int i = 0; i < cycleSizes_.size(); i++) {
182 dataSize += com.google.protobuf.CodedOutputStream
183 .computeInt32SizeNoTag(cycleSizes_.getInt(i));
184 }
185 size += dataSize;
186 if (!getCycleSizesList().isEmpty()) {
187 size += 1;
188 size += com.google.protobuf.CodedOutputStream
189 .computeInt32SizeNoTag(dataSize);
190 }
191 cycleSizesMemoizedSerializedSize = dataSize;
192 }
193 size += getUnknownFields().getSerializedSize();
194 memoizedSize = size;
195 return size;
196 }
197
198 @java.lang.Override
199 public boolean equals(final java.lang.Object obj) {
200 if (obj == this) {
201 return true;
202 }
203 if (!(obj instanceof com.google.ortools.sat.SparsePermutationProto)) {
204 return super.equals(obj);
205 }
206 com.google.ortools.sat.SparsePermutationProto other = (com.google.ortools.sat.SparsePermutationProto) obj;
207
208 if (!getSupportList()
209 .equals(other.getSupportList())) return false;
210 if (!getCycleSizesList()
211 .equals(other.getCycleSizesList())) return false;
212 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
213 return true;
214 }
215
216 @java.lang.Override
217 public int hashCode() {
218 if (memoizedHashCode != 0) {
219 return memoizedHashCode;
220 }
221 int hash = 41;
222 hash = (19 * hash) + getDescriptor().hashCode();
223 if (getSupportCount() > 0) {
224 hash = (37 * hash) + SUPPORT_FIELD_NUMBER;
225 hash = (53 * hash) + getSupportList().hashCode();
226 }
227 if (getCycleSizesCount() > 0) {
228 hash = (37 * hash) + CYCLE_SIZES_FIELD_NUMBER;
229 hash = (53 * hash) + getCycleSizesList().hashCode();
230 }
231 hash = (29 * hash) + getUnknownFields().hashCode();
232 memoizedHashCode = hash;
233 return hash;
234 }
235
237 java.nio.ByteBuffer data)
238 throws com.google.protobuf.InvalidProtocolBufferException {
239 return PARSER.parseFrom(data);
240 }
242 java.nio.ByteBuffer data,
243 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
244 throws com.google.protobuf.InvalidProtocolBufferException {
245 return PARSER.parseFrom(data, extensionRegistry);
246 }
248 com.google.protobuf.ByteString data)
249 throws com.google.protobuf.InvalidProtocolBufferException {
250 return PARSER.parseFrom(data);
251 }
253 com.google.protobuf.ByteString data,
254 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
255 throws com.google.protobuf.InvalidProtocolBufferException {
256 return PARSER.parseFrom(data, extensionRegistry);
257 }
259 throws com.google.protobuf.InvalidProtocolBufferException {
260 return PARSER.parseFrom(data);
261 }
263 byte[] data,
264 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
265 throws com.google.protobuf.InvalidProtocolBufferException {
266 return PARSER.parseFrom(data, extensionRegistry);
267 }
268 public static com.google.ortools.sat.SparsePermutationProto parseFrom(java.io.InputStream input)
269 throws java.io.IOException {
270 return com.google.protobuf.GeneratedMessage
271 .parseWithIOException(PARSER, input);
272 }
274 java.io.InputStream input,
275 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
276 throws java.io.IOException {
277 return com.google.protobuf.GeneratedMessage
278 .parseWithIOException(PARSER, input, extensionRegistry);
279 }
280
282 throws java.io.IOException {
283 return com.google.protobuf.GeneratedMessage
284 .parseDelimitedWithIOException(PARSER, input);
285 }
286
288 java.io.InputStream input,
289 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
290 throws java.io.IOException {
291 return com.google.protobuf.GeneratedMessage
292 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
293 }
295 com.google.protobuf.CodedInputStream input)
296 throws java.io.IOException {
297 return com.google.protobuf.GeneratedMessage
298 .parseWithIOException(PARSER, input);
299 }
301 com.google.protobuf.CodedInputStream input,
302 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
303 throws java.io.IOException {
304 return com.google.protobuf.GeneratedMessage
305 .parseWithIOException(PARSER, input, extensionRegistry);
306 }
307
308 @java.lang.Override
309 public Builder newBuilderForType() { return newBuilder(); }
310 public static Builder newBuilder() {
311 return DEFAULT_INSTANCE.toBuilder();
312 }
313 public static Builder newBuilder(com.google.ortools.sat.SparsePermutationProto prototype) {
314 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
315 }
316 @java.lang.Override
318 return this == DEFAULT_INSTANCE
319 ? new Builder() : new Builder().mergeFrom(this);
320 }
321
322 @java.lang.Override
324 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
325 Builder builder = new Builder(parent);
326 return builder;
327 }
328
336 public static final class Builder extends
337 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
338 // @@protoc_insertion_point(builder_implements:operations_research.sat.SparsePermutationProto)
340 public static final com.google.protobuf.Descriptors.Descriptor
342 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_SparsePermutationProto_descriptor;
343 }
344
345 @java.lang.Override
346 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
348 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_SparsePermutationProto_fieldAccessorTable
349 .ensureFieldAccessorsInitialized(
350 com.google.ortools.sat.SparsePermutationProto.class, com.google.ortools.sat.SparsePermutationProto.Builder.class);
351 }
352
353 // Construct using com.google.ortools.sat.SparsePermutationProto.newBuilder()
354 private Builder() {
355
356 }
357
358 private Builder(
359 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
360 super(parent);
361
362 }
363 @java.lang.Override
364 public Builder clear() {
365 super.clear();
366 bitField0_ = 0;
367 support_ = emptyIntList();
368 cycleSizes_ = emptyIntList();
369 return this;
370 }
371
372 @java.lang.Override
373 public com.google.protobuf.Descriptors.Descriptor
375 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_SparsePermutationProto_descriptor;
376 }
377
378 @java.lang.Override
380 return com.google.ortools.sat.SparsePermutationProto.getDefaultInstance();
381 }
382
383 @java.lang.Override
386 if (!result.isInitialized()) {
387 throw newUninitializedMessageException(result);
388 }
389 return result;
390 }
391
392 @java.lang.Override
394 com.google.ortools.sat.SparsePermutationProto result = new com.google.ortools.sat.SparsePermutationProto(this);
395 if (bitField0_ != 0) { buildPartial0(result); }
396 onBuilt();
397 return result;
398 }
399
400 private void buildPartial0(com.google.ortools.sat.SparsePermutationProto result) {
401 int from_bitField0_ = bitField0_;
402 if (((from_bitField0_ & 0x00000001) != 0)) {
403 support_.makeImmutable();
404 result.support_ = support_;
405 }
406 if (((from_bitField0_ & 0x00000002) != 0)) {
407 cycleSizes_.makeImmutable();
408 result.cycleSizes_ = cycleSizes_;
409 }
410 }
411
412 @java.lang.Override
413 public Builder mergeFrom(com.google.protobuf.Message other) {
414 if (other instanceof com.google.ortools.sat.SparsePermutationProto) {
415 return mergeFrom((com.google.ortools.sat.SparsePermutationProto)other);
416 } else {
417 super.mergeFrom(other);
418 return this;
419 }
420 }
421
422 public Builder mergeFrom(com.google.ortools.sat.SparsePermutationProto other) {
423 if (other == com.google.ortools.sat.SparsePermutationProto.getDefaultInstance()) return this;
424 if (!other.support_.isEmpty()) {
425 if (support_.isEmpty()) {
426 support_ = other.support_;
427 support_.makeImmutable();
428 bitField0_ |= 0x00000001;
429 } else {
430 ensureSupportIsMutable();
431 support_.addAll(other.support_);
432 }
433 onChanged();
434 }
435 if (!other.cycleSizes_.isEmpty()) {
436 if (cycleSizes_.isEmpty()) {
437 cycleSizes_ = other.cycleSizes_;
438 cycleSizes_.makeImmutable();
439 bitField0_ |= 0x00000002;
440 } else {
441 ensureCycleSizesIsMutable();
442 cycleSizes_.addAll(other.cycleSizes_);
443 }
444 onChanged();
445 }
446 this.mergeUnknownFields(other.getUnknownFields());
447 onChanged();
448 return this;
449 }
450
451 @java.lang.Override
452 public final boolean isInitialized() {
453 return true;
454 }
455
456 @java.lang.Override
457 public Builder mergeFrom(
458 com.google.protobuf.CodedInputStream input,
459 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
460 throws java.io.IOException {
461 if (extensionRegistry == null) {
462 throw new java.lang.NullPointerException();
463 }
464 try {
465 boolean done = false;
466 while (!done) {
467 int tag = input.readTag();
468 switch (tag) {
469 case 0:
470 done = true;
471 break;
472 case 8: {
473 int v = input.readInt32();
474 ensureSupportIsMutable();
475 support_.addInt(v);
476 break;
477 } // case 8
478 case 10: {
479 int length = input.readRawVarint32();
480 int limit = input.pushLimit(length);
481 ensureSupportIsMutable();
482 while (input.getBytesUntilLimit() > 0) {
483 support_.addInt(input.readInt32());
484 }
485 input.popLimit(limit);
486 break;
487 } // case 10
488 case 16: {
489 int v = input.readInt32();
490 ensureCycleSizesIsMutable();
491 cycleSizes_.addInt(v);
492 break;
493 } // case 16
494 case 18: {
495 int length = input.readRawVarint32();
496 int limit = input.pushLimit(length);
497 ensureCycleSizesIsMutable();
498 while (input.getBytesUntilLimit() > 0) {
499 cycleSizes_.addInt(input.readInt32());
500 }
501 input.popLimit(limit);
502 break;
503 } // case 18
504 default: {
505 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
506 done = true; // was an endgroup tag
507 }
508 break;
509 } // default:
510 } // switch (tag)
511 } // while (!done)
512 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
513 throw e.unwrapIOException();
514 } finally {
515 onChanged();
516 } // finally
517 return this;
518 }
519 private int bitField0_;
520
521 private com.google.protobuf.Internal.IntList support_ = emptyIntList();
522 private void ensureSupportIsMutable() {
523 if (!support_.isModifiable()) {
524 support_ = makeMutableCopy(support_);
525 }
526 bitField0_ |= 0x00000001;
527 }
537 public java.util.List<java.lang.Integer>
539 support_.makeImmutable();
540 return support_;
541 }
542
551 public int getSupportCount() {
552 return support_.size();
553 }
554
564 public int getSupport(int index) {
565 return support_.getInt(index);
566 }
567
578 public Builder setSupport(
579 int index, int value) {
580
581 ensureSupportIsMutable();
582 support_.setInt(index, value);
583 bitField0_ |= 0x00000001;
584 onChanged();
585 return this;
586 }
587
597 public Builder addSupport(int value) {
598
599 ensureSupportIsMutable();
600 support_.addInt(value);
601 bitField0_ |= 0x00000001;
602 onChanged();
603 return this;
604 }
605
615 public Builder addAllSupport(
616 java.lang.Iterable<? extends java.lang.Integer> values) {
617 ensureSupportIsMutable();
618 com.google.protobuf.AbstractMessageLite.Builder.addAll(
619 values, support_);
620 bitField0_ |= 0x00000001;
621 onChanged();
622 return this;
623 }
624
633 public Builder clearSupport() {
634 support_ = emptyIntList();
635 bitField0_ = (bitField0_ & ~0x00000001);
636 onChanged();
637 return this;
638 }
639
640 private com.google.protobuf.Internal.IntList cycleSizes_ = emptyIntList();
641 private void ensureCycleSizesIsMutable() {
642 if (!cycleSizes_.isModifiable()) {
643 cycleSizes_ = makeMutableCopy(cycleSizes_);
644 }
645 bitField0_ |= 0x00000002;
646 }
651 public java.util.List<java.lang.Integer>
653 cycleSizes_.makeImmutable();
654 return cycleSizes_;
655 }
656
660 public int getCycleSizesCount() {
661 return cycleSizes_.size();
662 }
663
668 public int getCycleSizes(int index) {
669 return cycleSizes_.getInt(index);
670 }
671
677 public Builder setCycleSizes(
678 int index, int value) {
679
680 ensureCycleSizesIsMutable();
681 cycleSizes_.setInt(index, value);
682 bitField0_ |= 0x00000002;
683 onChanged();
684 return this;
685 }
686
691 public Builder addCycleSizes(int value) {
692
693 ensureCycleSizesIsMutable();
694 cycleSizes_.addInt(value);
695 bitField0_ |= 0x00000002;
696 onChanged();
697 return this;
698 }
699
704 public Builder addAllCycleSizes(
705 java.lang.Iterable<? extends java.lang.Integer> values) {
706 ensureCycleSizesIsMutable();
707 com.google.protobuf.AbstractMessageLite.Builder.addAll(
708 values, cycleSizes_);
709 bitField0_ |= 0x00000002;
710 onChanged();
711 return this;
712 }
713
717 public Builder clearCycleSizes() {
718 cycleSizes_ = emptyIntList();
719 bitField0_ = (bitField0_ & ~0x00000002);
720 onChanged();
721 return this;
722 }
723
724 // @@protoc_insertion_point(builder_scope:operations_research.sat.SparsePermutationProto)
725 }
726
727 // @@protoc_insertion_point(class_scope:operations_research.sat.SparsePermutationProto)
728 private static final com.google.ortools.sat.SparsePermutationProto DEFAULT_INSTANCE;
729 static {
730 DEFAULT_INSTANCE = new com.google.ortools.sat.SparsePermutationProto();
731 }
732
734 return DEFAULT_INSTANCE;
735 }
736
737 private static final com.google.protobuf.Parser<SparsePermutationProto>
738 PARSER = new com.google.protobuf.AbstractParser<SparsePermutationProto>() {
739 @java.lang.Override
740 public SparsePermutationProto parsePartialFrom(
741 com.google.protobuf.CodedInputStream input,
742 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
743 throws com.google.protobuf.InvalidProtocolBufferException {
744 Builder builder = newBuilder();
745 try {
746 builder.mergeFrom(input, extensionRegistry);
747 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
748 throw e.setUnfinishedMessage(builder.buildPartial());
749 } catch (com.google.protobuf.UninitializedMessageException e) {
750 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
751 } catch (java.io.IOException e) {
752 throw new com.google.protobuf.InvalidProtocolBufferException(e)
753 .setUnfinishedMessage(builder.buildPartial());
754 }
755 return builder.buildPartial();
756 }
757 };
758
759 public static com.google.protobuf.Parser<SparsePermutationProto> parser() {
760 return PARSER;
761 }
762
763 @java.lang.Override
764 public com.google.protobuf.Parser<SparsePermutationProto> getParserForType() {
765 return PARSER;
766 }
767
768 @java.lang.Override
772
773}
774
Builder addAllSupport(java.lang.Iterable<? extends java.lang.Integer > values)
Builder mergeFrom(com.google.ortools.sat.SparsePermutationProto other)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Builder addAllCycleSizes(java.lang.Iterable<? extends java.lang.Integer > values)
com.google.ortools.sat.SparsePermutationProto buildPartial()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
Builder mergeFrom(com.google.protobuf.Message other)
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
com.google.ortools.sat.SparsePermutationProto getDefaultInstanceForType()
com.google.ortools.sat.SparsePermutationProto build()
static com.google.ortools.sat.SparsePermutationProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.SparsePermutationProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
java.util.List< java.lang.Integer > getCycleSizesList()
com.google.ortools.sat.SparsePermutationProto getDefaultInstanceForType()
static com.google.ortools.sat.SparsePermutationProto parseDelimitedFrom(java.io.InputStream input)
static Builder newBuilder(com.google.ortools.sat.SparsePermutationProto prototype)
static com.google.protobuf.Parser< SparsePermutationProto > parser()
static com.google.ortools.sat.SparsePermutationProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.Parser< SparsePermutationProto > getParserForType()
static com.google.ortools.sat.SparsePermutationProto parseFrom(java.nio.ByteBuffer data)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
static com.google.ortools.sat.SparsePermutationProto parseFrom(com.google.protobuf.ByteString data)
static com.google.ortools.sat.SparsePermutationProto parseFrom(byte[] data)
void writeTo(com.google.protobuf.CodedOutputStream output)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
static com.google.ortools.sat.SparsePermutationProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.SparsePermutationProto parseFrom(com.google.protobuf.CodedInputStream input)
static com.google.ortools.sat.SparsePermutationProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
java.util.List< java.lang.Integer > getSupportList()
static com.google.ortools.sat.SparsePermutationProto parseFrom(java.io.InputStream input)
static com.google.ortools.sat.SparsePermutationProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.SparsePermutationProto getDefaultInstance()