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