6package com.google.ortools.sat;
16@com.google.protobuf.Generated
17public final class SparsePermutationProto
extends
18 com.google.protobuf.GeneratedMessage implements
21private static final long serialVersionUID = 0L;
23 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
24 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
29 SparsePermutationProto.class.getName());
32 private SparsePermutationProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
35 private SparsePermutationProto() {
36 support_ = emptyIntList();
37 cycleSizes_ = emptyIntList();
40 public static final com.google.protobuf.Descriptors.Descriptor
42 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_SparsePermutationProto_descriptor;
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);
54 @SuppressWarnings(
"serial")
55 private com.google.protobuf.Internal.IntList support_ =
67 public java.
util.List<java.lang.Integer>
81 return support_.size();
94 return support_.getInt(index);
96 private int supportMemoizedSerializedSize = -1;
99 @SuppressWarnings(
"serial")
100 private com.google.protobuf.Internal.IntList cycleSizes_ =
107 public java.
util.List<java.lang.Integer>
116 return cycleSizes_.size();
124 return cycleSizes_.getInt(index);
126 private int cycleSizesMemoizedSerializedSize = -1;
128 private byte memoizedIsInitialized = -1;
135 memoizedIsInitialized = 1;
140 public void writeTo(com.google.protobuf.CodedOutputStream output)
141 throws java.io.IOException {
144 output.writeUInt32NoTag(10);
145 output.writeUInt32NoTag(supportMemoizedSerializedSize);
147 for (
int i = 0; i < support_.size(); i++) {
148 output.writeInt32NoTag(support_.getInt(i));
151 output.writeUInt32NoTag(18);
152 output.writeUInt32NoTag(cycleSizesMemoizedSerializedSize);
154 for (
int i = 0; i < cycleSizes_.size(); i++) {
155 output.writeInt32NoTag(cycleSizes_.getInt(i));
157 getUnknownFields().writeTo(output);
162 int size = memoizedSize;
163 if (size != -1)
return size;
168 for (
int i = 0; i < support_.size(); i++) {
169 dataSize += com.google.protobuf.CodedOutputStream
170 .computeInt32SizeNoTag(support_.getInt(i));
175 size += com.google.protobuf.CodedOutputStream
176 .computeInt32SizeNoTag(dataSize);
178 supportMemoizedSerializedSize = dataSize;
182 for (
int i = 0; i < cycleSizes_.size(); i++) {
183 dataSize += com.google.protobuf.CodedOutputStream
184 .computeInt32SizeNoTag(cycleSizes_.getInt(i));
189 size += com.google.protobuf.CodedOutputStream
190 .computeInt32SizeNoTag(dataSize);
192 cycleSizesMemoizedSerializedSize = dataSize;
194 size += getUnknownFields().getSerializedSize();
200 public boolean equals(
final java.lang.Object obj) {
204 if (!(obj instanceof com.google.ortools.sat.SparsePermutationProto)) {
205 return super.equals(obj);
213 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
219 if (memoizedHashCode != 0) {
220 return memoizedHashCode;
232 hash = (29 * hash) + getUnknownFields().hashCode();
233 memoizedHashCode = hash;
238 java.nio.ByteBuffer data)
239 throws com.google.protobuf.InvalidProtocolBufferException {
240 return PARSER.parseFrom(data);
243 java.nio.ByteBuffer data,
244 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
245 throws com.google.protobuf.InvalidProtocolBufferException {
246 return PARSER.parseFrom(data, extensionRegistry);
249 com.google.protobuf.ByteString data)
250 throws com.google.protobuf.InvalidProtocolBufferException {
251 return PARSER.parseFrom(data);
254 com.google.protobuf.ByteString data,
255 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
256 throws com.google.protobuf.InvalidProtocolBufferException {
257 return PARSER.parseFrom(data, extensionRegistry);
260 throws com.google.protobuf.InvalidProtocolBufferException {
261 return PARSER.parseFrom(data);
265 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
266 throws com.google.protobuf.InvalidProtocolBufferException {
267 return PARSER.parseFrom(data, extensionRegistry);
270 throws java.io.IOException {
271 return com.google.protobuf.GeneratedMessage
272 .parseWithIOException(PARSER, input);
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);
283 throws java.io.IOException {
284 return com.google.protobuf.GeneratedMessage
285 .parseDelimitedWithIOException(PARSER, input);
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);
296 com.google.protobuf.CodedInputStream input)
297 throws java.io.IOException {
298 return com.google.protobuf.GeneratedMessage
299 .parseWithIOException(PARSER, input);
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);
312 return DEFAULT_INSTANCE.toBuilder();
315 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
319 return this == DEFAULT_INSTANCE
325 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
337 public static final class Builder
extends
338 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
341 public static final com.google.protobuf.Descriptors.Descriptor
343 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_SparsePermutationProto_descriptor;
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);
360 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
368 support_ = emptyIntList();
369 cycleSizes_ = emptyIntList();
374 public com.google.protobuf.Descriptors.Descriptor
376 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_SparsePermutationProto_descriptor;
381 return com.google.ortools.sat.SparsePermutationProto.getDefaultInstance();
388 throw newUninitializedMessageException(result);
396 if (bitField0_ != 0) { buildPartial0(result); }
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_;
407 if (((from_bitField0_ & 0x00000002) != 0)) {
408 cycleSizes_.makeImmutable();
409 result.cycleSizes_ = cycleSizes_;
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);
418 super.mergeFrom(other);
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;
431 ensureSupportIsMutable();
432 support_.addAll(other.support_);
436 if (!other.cycleSizes_.isEmpty()) {
437 if (cycleSizes_.isEmpty()) {
438 cycleSizes_ = other.cycleSizes_;
439 cycleSizes_.makeImmutable();
440 bitField0_ |= 0x00000002;
442 ensureCycleSizesIsMutable();
443 cycleSizes_.addAll(other.cycleSizes_);
447 this.mergeUnknownFields(other.getUnknownFields());
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();
466 boolean done =
false;
468 int tag = input.readTag();
474 int v = input.readInt32();
475 ensureSupportIsMutable();
480 int length = input.readRawVarint32();
481 int limit = input.pushLimit(length);
482 ensureSupportIsMutable();
483 while (input.getBytesUntilLimit() > 0) {
484 support_.addInt(input.readInt32());
486 input.popLimit(limit);
490 int v = input.readInt32();
491 ensureCycleSizesIsMutable();
492 cycleSizes_.addInt(v);
496 int length = input.readRawVarint32();
497 int limit = input.pushLimit(length);
498 ensureCycleSizesIsMutable();
499 while (input.getBytesUntilLimit() > 0) {
500 cycleSizes_.addInt(input.readInt32());
502 input.popLimit(limit);
506 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
513 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
514 throw e.unwrapIOException();
520 private int bitField0_;
522 private com.google.protobuf.Internal.IntList support_ = emptyIntList();
523 private void ensureSupportIsMutable() {
524 if (!support_.isModifiable()) {
525 support_ = makeMutableCopy(support_);
527 bitField0_ |= 0x00000001;
538 public java.util.List<java.lang.Integer>
540 support_.makeImmutable();
553 return support_.size();
566 return support_.getInt(index);
580 int index,
int value) {
582 ensureSupportIsMutable();
583 support_.setInt(index, value);
584 bitField0_ |= 0x00000001;
600 ensureSupportIsMutable();
601 support_.addInt(value);
602 bitField0_ |= 0x00000001;
617 java.lang.Iterable<? extends java.lang.Integer> values) {
618 ensureSupportIsMutable();
619 com.google.protobuf.AbstractMessageLite.Builder.addAll(
621 bitField0_ |= 0x00000001;
635 support_ = emptyIntList();
636 bitField0_ = (bitField0_ & ~0x00000001);
641 private com.google.protobuf.Internal.IntList cycleSizes_ = emptyIntList();
642 private void ensureCycleSizesIsMutable() {
643 if (!cycleSizes_.isModifiable()) {
644 cycleSizes_ = makeMutableCopy(cycleSizes_);
646 bitField0_ |= 0x00000002;
652 public java.util.List<java.lang.Integer>
654 cycleSizes_.makeImmutable();
662 return cycleSizes_.size();
670 return cycleSizes_.getInt(index);
679 int index,
int value) {
681 ensureCycleSizesIsMutable();
682 cycleSizes_.setInt(index, value);
683 bitField0_ |= 0x00000002;
694 ensureCycleSizesIsMutable();
695 cycleSizes_.addInt(value);
696 bitField0_ |= 0x00000002;
706 java.lang.Iterable<? extends java.lang.Integer> values) {
707 ensureCycleSizesIsMutable();
708 com.google.protobuf.AbstractMessageLite.Builder.addAll(
709 values, cycleSizes_);
710 bitField0_ |= 0x00000002;
719 cycleSizes_ = emptyIntList();
720 bitField0_ = (bitField0_ & ~0x00000002);
731 DEFAULT_INSTANCE =
new com.google.ortools.sat.SparsePermutationProto();
735 return DEFAULT_INSTANCE;
742 com.google.protobuf.CodedInputStream input,
743 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
744 throws com.google.protobuf.InvalidProtocolBufferException {
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());
756 return builder.buildPartial();
760 public static com.google.protobuf.Parser<SparsePermutationProto>
parser() {
771 return DEFAULT_INSTANCE;