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