5package com.google.ortools.sat;
16 com.google.protobuf.GeneratedMessage implements
19private static final long serialVersionUID = 0L;
21 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
22 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
34 support_ = emptyIntList();
35 cycleSizes_ = emptyIntList();
38 public static final com.google.protobuf.Descriptors.Descriptor
40 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_SparsePermutationProto_descriptor;
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);
52 @SuppressWarnings(
"serial")
53 private com.google.protobuf.Internal.IntList support_ =
65 public java.util.List<java.lang.Integer>
79 return support_.size();
92 return support_.getInt(index);
94 private int supportMemoizedSerializedSize = -1;
97 @SuppressWarnings(
"serial")
98 private com.google.protobuf.Internal.IntList cycleSizes_ =
105 public java.util.List<java.lang.Integer>
114 return cycleSizes_.size();
122 return cycleSizes_.getInt(index);
124 private int cycleSizesMemoizedSerializedSize = -1;
126 private byte memoizedIsInitialized = -1;
133 memoizedIsInitialized = 1;
138 public void writeTo(com.google.protobuf.CodedOutputStream output)
139 throws java.io.IOException {
142 output.writeUInt32NoTag(10);
143 output.writeUInt32NoTag(supportMemoizedSerializedSize);
145 for (
int i = 0; i < support_.size(); i++) {
146 output.writeInt32NoTag(support_.getInt(i));
149 output.writeUInt32NoTag(18);
150 output.writeUInt32NoTag(cycleSizesMemoizedSerializedSize);
152 for (
int i = 0; i < cycleSizes_.size(); i++) {
153 output.writeInt32NoTag(cycleSizes_.getInt(i));
155 getUnknownFields().writeTo(output);
160 int size = memoizedSize;
161 if (size != -1)
return size;
166 for (
int i = 0; i < support_.size(); i++) {
167 dataSize += com.google.protobuf.CodedOutputStream
168 .computeInt32SizeNoTag(support_.getInt(i));
173 size += com.google.protobuf.CodedOutputStream
174 .computeInt32SizeNoTag(dataSize);
176 supportMemoizedSerializedSize = dataSize;
180 for (
int i = 0; i < cycleSizes_.size(); i++) {
181 dataSize += com.google.protobuf.CodedOutputStream
182 .computeInt32SizeNoTag(cycleSizes_.getInt(i));
187 size += com.google.protobuf.CodedOutputStream
188 .computeInt32SizeNoTag(dataSize);
190 cycleSizesMemoizedSerializedSize = dataSize;
192 size += getUnknownFields().getSerializedSize();
198 public boolean equals(
final java.lang.Object obj) {
202 if (!(obj instanceof com.google.ortools.sat.SparsePermutationProto)) {
203 return super.equals(obj);
211 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
217 if (memoizedHashCode != 0) {
218 return memoizedHashCode;
230 hash = (29 * hash) + getUnknownFields().hashCode();
231 memoizedHashCode = hash;
236 java.nio.ByteBuffer data)
237 throws com.google.protobuf.InvalidProtocolBufferException {
238 return PARSER.parseFrom(data);
241 java.nio.ByteBuffer data,
242 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
243 throws com.google.protobuf.InvalidProtocolBufferException {
244 return PARSER.parseFrom(data, extensionRegistry);
247 com.google.protobuf.ByteString data)
248 throws com.google.protobuf.InvalidProtocolBufferException {
249 return PARSER.parseFrom(data);
252 com.google.protobuf.ByteString data,
253 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
254 throws com.google.protobuf.InvalidProtocolBufferException {
255 return PARSER.parseFrom(data, extensionRegistry);
258 throws com.google.protobuf.InvalidProtocolBufferException {
259 return PARSER.parseFrom(data);
263 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
264 throws com.google.protobuf.InvalidProtocolBufferException {
265 return PARSER.parseFrom(data, extensionRegistry);
268 throws java.io.IOException {
269 return com.google.protobuf.GeneratedMessage
270 .parseWithIOException(PARSER, input);
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);
281 throws java.io.IOException {
282 return com.google.protobuf.GeneratedMessage
283 .parseDelimitedWithIOException(PARSER, input);
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);
294 com.google.protobuf.CodedInputStream input)
295 throws java.io.IOException {
296 return com.google.protobuf.GeneratedMessage
297 .parseWithIOException(PARSER, input);
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);
317 return this == DEFAULT_INSTANCE
323 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
336 com.google.protobuf.GeneratedMessage.
Builder<Builder> implements
339 public static final com.google.protobuf.Descriptors.Descriptor
341 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_SparsePermutationProto_descriptor;
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);
358 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
366 support_ = emptyIntList();
367 cycleSizes_ = emptyIntList();
372 public com.google.protobuf.Descriptors.Descriptor
374 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_SparsePermutationProto_descriptor;
379 return com.google.ortools.sat.SparsePermutationProto.getDefaultInstance();
386 throw newUninitializedMessageException(result);
394 if (bitField0_ != 0) { buildPartial0(result); }
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_;
405 if (((from_bitField0_ & 0x00000002) != 0)) {
406 cycleSizes_.makeImmutable();
407 result.cycleSizes_ = cycleSizes_;
413 if (other instanceof com.google.ortools.sat.SparsePermutationProto) {
414 return mergeFrom((com.google.ortools.sat.SparsePermutationProto)other);
416 super.mergeFrom(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;
429 ensureSupportIsMutable();
430 support_.addAll(other.support_);
434 if (!other.cycleSizes_.isEmpty()) {
435 if (cycleSizes_.isEmpty()) {
436 cycleSizes_ = other.cycleSizes_;
437 cycleSizes_.makeImmutable();
438 bitField0_ |= 0x00000002;
440 ensureCycleSizesIsMutable();
441 cycleSizes_.addAll(other.cycleSizes_);
445 this.mergeUnknownFields(other.getUnknownFields());
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();
464 boolean done =
false;
466 int tag = input.readTag();
472 int v = input.readInt32();
473 ensureSupportIsMutable();
478 int length = input.readRawVarint32();
479 int limit = input.pushLimit(length);
480 ensureSupportIsMutable();
481 while (input.getBytesUntilLimit() > 0) {
482 support_.addInt(input.readInt32());
484 input.popLimit(limit);
488 int v = input.readInt32();
489 ensureCycleSizesIsMutable();
490 cycleSizes_.addInt(v);
494 int length = input.readRawVarint32();
495 int limit = input.pushLimit(length);
496 ensureCycleSizesIsMutable();
497 while (input.getBytesUntilLimit() > 0) {
498 cycleSizes_.addInt(input.readInt32());
500 input.popLimit(limit);
504 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
511 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
512 throw e.unwrapIOException();
518 private int bitField0_;
520 private com.google.protobuf.Internal.IntList support_ = emptyIntList();
521 private void ensureSupportIsMutable() {
522 if (!support_.isModifiable()) {
523 support_ = makeMutableCopy(support_);
525 bitField0_ |= 0x00000001;
536 public java.util.List<java.lang.Integer>
538 support_.makeImmutable();
551 return support_.size();
564 return support_.getInt(index);
578 int index,
int value) {
580 ensureSupportIsMutable();
581 support_.setInt(index, value);
582 bitField0_ |= 0x00000001;
598 ensureSupportIsMutable();
599 support_.addInt(value);
600 bitField0_ |= 0x00000001;
615 java.lang.Iterable<? extends java.lang.Integer> values) {
616 ensureSupportIsMutable();
617 com.google.protobuf.AbstractMessageLite.Builder.addAll(
619 bitField0_ |= 0x00000001;
633 support_ = emptyIntList();
634 bitField0_ = (bitField0_ & ~0x00000001);
639 private com.google.protobuf.Internal.IntList cycleSizes_ = emptyIntList();
640 private void ensureCycleSizesIsMutable() {
641 if (!cycleSizes_.isModifiable()) {
642 cycleSizes_ = makeMutableCopy(cycleSizes_);
644 bitField0_ |= 0x00000002;
650 public java.util.List<java.lang.Integer>
652 cycleSizes_.makeImmutable();
660 return cycleSizes_.size();
668 return cycleSizes_.getInt(index);
677 int index,
int value) {
679 ensureCycleSizesIsMutable();
680 cycleSizes_.setInt(index, value);
681 bitField0_ |= 0x00000002;
692 ensureCycleSizesIsMutable();
693 cycleSizes_.addInt(value);
694 bitField0_ |= 0x00000002;
704 java.lang.Iterable<? extends java.lang.Integer> values) {
705 ensureCycleSizesIsMutable();
706 com.google.protobuf.AbstractMessageLite.Builder.addAll(
707 values, cycleSizes_);
708 bitField0_ |= 0x00000002;
717 cycleSizes_ = emptyIntList();
718 bitField0_ = (bitField0_ & ~0x00000002);
729 DEFAULT_INSTANCE =
new com.google.ortools.sat.SparsePermutationProto();
733 return DEFAULT_INSTANCE;
740 com.google.protobuf.CodedInputStream input,
741 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
742 throws com.google.protobuf.InvalidProtocolBufferException {
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());
754 return builder.buildPartial();
769 return DEFAULT_INSTANCE;