6package com.google.ortools.sat;
16public final class SparsePermutationProto
extends
17 com.google.protobuf.GeneratedMessage implements
20private static final long serialVersionUID = 0L;
22 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
23 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
28 SparsePermutationProto.class.getName());
31 private SparsePermutationProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
34 private SparsePermutationProto() {
35 support_ = emptyIntList();
36 cycleSizes_ = emptyIntList();
39 public static final com.google.protobuf.Descriptors.Descriptor
41 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_SparsePermutationProto_descriptor;
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);
53 @SuppressWarnings(
"serial")
54 private com.google.protobuf.Internal.IntList support_ =
66 public java.
util.List<java.lang.Integer>
80 return support_.size();
93 return support_.getInt(index);
95 private int supportMemoizedSerializedSize = -1;
98 @SuppressWarnings(
"serial")
99 private com.google.protobuf.Internal.IntList cycleSizes_ =
106 public java.
util.List<java.lang.Integer>
115 return cycleSizes_.size();
123 return cycleSizes_.getInt(index);
125 private int cycleSizesMemoizedSerializedSize = -1;
127 private byte memoizedIsInitialized = -1;
134 memoizedIsInitialized = 1;
139 public void writeTo(com.google.protobuf.CodedOutputStream output)
140 throws java.io.IOException {
143 output.writeUInt32NoTag(10);
144 output.writeUInt32NoTag(supportMemoizedSerializedSize);
146 for (
int i = 0; i < support_.size(); i++) {
147 output.writeInt32NoTag(support_.getInt(i));
150 output.writeUInt32NoTag(18);
151 output.writeUInt32NoTag(cycleSizesMemoizedSerializedSize);
153 for (
int i = 0; i < cycleSizes_.size(); i++) {
154 output.writeInt32NoTag(cycleSizes_.getInt(i));
156 getUnknownFields().writeTo(output);
161 int size = memoizedSize;
162 if (size != -1)
return size;
167 for (
int i = 0; i < support_.size(); i++) {
168 dataSize += com.google.protobuf.CodedOutputStream
169 .computeInt32SizeNoTag(support_.getInt(i));
174 size += com.google.protobuf.CodedOutputStream
175 .computeInt32SizeNoTag(dataSize);
177 supportMemoizedSerializedSize = dataSize;
181 for (
int i = 0; i < cycleSizes_.size(); i++) {
182 dataSize += com.google.protobuf.CodedOutputStream
183 .computeInt32SizeNoTag(cycleSizes_.getInt(i));
188 size += com.google.protobuf.CodedOutputStream
189 .computeInt32SizeNoTag(dataSize);
191 cycleSizesMemoizedSerializedSize = dataSize;
193 size += getUnknownFields().getSerializedSize();
199 public boolean equals(
final java.lang.Object obj) {
203 if (!(obj instanceof com.google.ortools.sat.SparsePermutationProto)) {
204 return super.equals(obj);
212 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
218 if (memoizedHashCode != 0) {
219 return memoizedHashCode;
231 hash = (29 * hash) + getUnknownFields().hashCode();
232 memoizedHashCode = hash;
237 java.nio.ByteBuffer data)
238 throws com.google.protobuf.InvalidProtocolBufferException {
239 return PARSER.parseFrom(data);
242 java.nio.ByteBuffer data,
243 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
244 throws com.google.protobuf.InvalidProtocolBufferException {
245 return PARSER.parseFrom(data, extensionRegistry);
248 com.google.protobuf.ByteString data)
249 throws com.google.protobuf.InvalidProtocolBufferException {
250 return PARSER.parseFrom(data);
253 com.google.protobuf.ByteString data,
254 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
255 throws com.google.protobuf.InvalidProtocolBufferException {
256 return PARSER.parseFrom(data, extensionRegistry);
259 throws com.google.protobuf.InvalidProtocolBufferException {
260 return PARSER.parseFrom(data);
264 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
265 throws com.google.protobuf.InvalidProtocolBufferException {
266 return PARSER.parseFrom(data, extensionRegistry);
269 throws java.io.IOException {
270 return com.google.protobuf.GeneratedMessage
271 .parseWithIOException(PARSER, input);
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);
282 throws java.io.IOException {
283 return com.google.protobuf.GeneratedMessage
284 .parseDelimitedWithIOException(PARSER, input);
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);
295 com.google.protobuf.CodedInputStream input)
296 throws java.io.IOException {
297 return com.google.protobuf.GeneratedMessage
298 .parseWithIOException(PARSER, input);
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);
311 return DEFAULT_INSTANCE.toBuilder();
314 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
318 return this == DEFAULT_INSTANCE
324 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
336 public static final class Builder
extends
337 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
340 public static final com.google.protobuf.Descriptors.Descriptor
342 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_SparsePermutationProto_descriptor;
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);
359 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
367 support_ = emptyIntList();
368 cycleSizes_ = emptyIntList();
373 public com.google.protobuf.Descriptors.Descriptor
375 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_SparsePermutationProto_descriptor;
380 return com.google.ortools.sat.SparsePermutationProto.getDefaultInstance();
387 throw newUninitializedMessageException(result);
395 if (bitField0_ != 0) { buildPartial0(result); }
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_;
406 if (((from_bitField0_ & 0x00000002) != 0)) {
407 cycleSizes_.makeImmutable();
408 result.cycleSizes_ = cycleSizes_;
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);
417 super.mergeFrom(other);
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;
430 ensureSupportIsMutable();
431 support_.addAll(other.support_);
435 if (!other.cycleSizes_.isEmpty()) {
436 if (cycleSizes_.isEmpty()) {
437 cycleSizes_ = other.cycleSizes_;
438 cycleSizes_.makeImmutable();
439 bitField0_ |= 0x00000002;
441 ensureCycleSizesIsMutable();
442 cycleSizes_.addAll(other.cycleSizes_);
446 this.mergeUnknownFields(other.getUnknownFields());
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();
465 boolean done =
false;
467 int tag = input.readTag();
473 int v = input.readInt32();
474 ensureSupportIsMutable();
479 int length = input.readRawVarint32();
480 int limit = input.pushLimit(length);
481 ensureSupportIsMutable();
482 while (input.getBytesUntilLimit() > 0) {
483 support_.addInt(input.readInt32());
485 input.popLimit(limit);
489 int v = input.readInt32();
490 ensureCycleSizesIsMutable();
491 cycleSizes_.addInt(v);
495 int length = input.readRawVarint32();
496 int limit = input.pushLimit(length);
497 ensureCycleSizesIsMutable();
498 while (input.getBytesUntilLimit() > 0) {
499 cycleSizes_.addInt(input.readInt32());
501 input.popLimit(limit);
505 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
512 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
513 throw e.unwrapIOException();
519 private int bitField0_;
521 private com.google.protobuf.Internal.IntList support_ = emptyIntList();
522 private void ensureSupportIsMutable() {
523 if (!support_.isModifiable()) {
524 support_ = makeMutableCopy(support_);
526 bitField0_ |= 0x00000001;
537 public java.util.List<java.lang.Integer>
539 support_.makeImmutable();
552 return support_.size();
565 return support_.getInt(index);
579 int index,
int value) {
581 ensureSupportIsMutable();
582 support_.setInt(index, value);
583 bitField0_ |= 0x00000001;
599 ensureSupportIsMutable();
600 support_.addInt(value);
601 bitField0_ |= 0x00000001;
616 java.lang.Iterable<? extends java.lang.Integer> values) {
617 ensureSupportIsMutable();
618 com.google.protobuf.AbstractMessageLite.Builder.addAll(
620 bitField0_ |= 0x00000001;
634 support_ = emptyIntList();
635 bitField0_ = (bitField0_ & ~0x00000001);
640 private com.google.protobuf.Internal.IntList cycleSizes_ = emptyIntList();
641 private void ensureCycleSizesIsMutable() {
642 if (!cycleSizes_.isModifiable()) {
643 cycleSizes_ = makeMutableCopy(cycleSizes_);
645 bitField0_ |= 0x00000002;
651 public java.util.List<java.lang.Integer>
653 cycleSizes_.makeImmutable();
661 return cycleSizes_.size();
669 return cycleSizes_.getInt(index);
678 int index,
int value) {
680 ensureCycleSizesIsMutable();
681 cycleSizes_.setInt(index, value);
682 bitField0_ |= 0x00000002;
693 ensureCycleSizesIsMutable();
694 cycleSizes_.addInt(value);
695 bitField0_ |= 0x00000002;
705 java.lang.Iterable<? extends java.lang.Integer> values) {
706 ensureCycleSizesIsMutable();
707 com.google.protobuf.AbstractMessageLite.Builder.addAll(
708 values, cycleSizes_);
709 bitField0_ |= 0x00000002;
718 cycleSizes_ = emptyIntList();
719 bitField0_ = (bitField0_ & ~0x00000002);
730 DEFAULT_INSTANCE =
new com.google.ortools.sat.SparsePermutationProto();
734 return DEFAULT_INSTANCE;
741 com.google.protobuf.CodedInputStream input,
742 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
743 throws com.google.protobuf.InvalidProtocolBufferException {
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());
755 return builder.buildPartial();
759 public static com.google.protobuf.Parser<SparsePermutationProto>
parser() {
770 return DEFAULT_INSTANCE;