5package com.google.ortools.sat;
34 com.google.protobuf.GeneratedMessage implements
37private static final long serialVersionUID = 0L;
39 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
40 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
52 tails_ = emptyIntList();
53 heads_ = emptyIntList();
54 literals_ = emptyIntList();
55 demands_ = emptyIntList();
58 public static final com.google.protobuf.Descriptors.Descriptor
60 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_RoutesConstraintProto_descriptor;
64 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
66 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_RoutesConstraintProto_fieldAccessorTable
67 .ensureFieldAccessorsInitialized(
68 com.google.ortools.sat.RoutesConstraintProto.class, com.google.ortools.sat.RoutesConstraintProto.Builder.class);
72 @SuppressWarnings(
"serial")
73 private com.google.protobuf.Internal.IntList tails_ =
80 public java.util.List<java.lang.Integer>
97 return tails_.getInt(index);
99 private int tailsMemoizedSerializedSize = -1;
102 @SuppressWarnings(
"serial")
103 private com.google.protobuf.Internal.IntList heads_ =
110 public java.util.List<java.lang.Integer>
119 return heads_.size();
127 return heads_.getInt(index);
129 private int headsMemoizedSerializedSize = -1;
132 @SuppressWarnings(
"serial")
133 private com.google.protobuf.Internal.IntList literals_ =
140 public java.util.List<java.lang.Integer>
149 return literals_.size();
157 return literals_.getInt(index);
159 private int literalsMemoizedSerializedSize = -1;
162 @SuppressWarnings(
"serial")
163 private com.google.protobuf.Internal.IntList demands_ =
182 public java.util.List<java.lang.Integer>
203 return demands_.size();
223 return demands_.getInt(index);
225 private int demandsMemoizedSerializedSize = -1;
228 private long capacity_ = 0L;
238 private byte memoizedIsInitialized = -1;
245 memoizedIsInitialized = 1;
250 public void writeTo(com.google.protobuf.CodedOutputStream output)
251 throws java.io.IOException {
254 output.writeUInt32NoTag(10);
255 output.writeUInt32NoTag(tailsMemoizedSerializedSize);
257 for (
int i = 0; i < tails_.size(); i++) {
258 output.writeInt32NoTag(tails_.getInt(i));
261 output.writeUInt32NoTag(18);
262 output.writeUInt32NoTag(headsMemoizedSerializedSize);
264 for (
int i = 0; i < heads_.size(); i++) {
265 output.writeInt32NoTag(heads_.getInt(i));
268 output.writeUInt32NoTag(26);
269 output.writeUInt32NoTag(literalsMemoizedSerializedSize);
271 for (
int i = 0; i < literals_.size(); i++) {
272 output.writeInt32NoTag(literals_.getInt(i));
275 output.writeUInt32NoTag(34);
276 output.writeUInt32NoTag(demandsMemoizedSerializedSize);
278 for (
int i = 0; i < demands_.size(); i++) {
279 output.writeInt32NoTag(demands_.getInt(i));
281 if (capacity_ != 0L) {
282 output.writeInt64(5, capacity_);
284 getUnknownFields().writeTo(output);
289 int size = memoizedSize;
290 if (size != -1)
return size;
295 for (
int i = 0; i < tails_.size(); i++) {
296 dataSize += com.google.protobuf.CodedOutputStream
297 .computeInt32SizeNoTag(tails_.getInt(i));
302 size += com.google.protobuf.CodedOutputStream
303 .computeInt32SizeNoTag(dataSize);
305 tailsMemoizedSerializedSize = dataSize;
309 for (
int i = 0; i < heads_.size(); i++) {
310 dataSize += com.google.protobuf.CodedOutputStream
311 .computeInt32SizeNoTag(heads_.getInt(i));
316 size += com.google.protobuf.CodedOutputStream
317 .computeInt32SizeNoTag(dataSize);
319 headsMemoizedSerializedSize = dataSize;
323 for (
int i = 0; i < literals_.size(); i++) {
324 dataSize += com.google.protobuf.CodedOutputStream
325 .computeInt32SizeNoTag(literals_.getInt(i));
330 size += com.google.protobuf.CodedOutputStream
331 .computeInt32SizeNoTag(dataSize);
333 literalsMemoizedSerializedSize = dataSize;
337 for (
int i = 0; i < demands_.size(); i++) {
338 dataSize += com.google.protobuf.CodedOutputStream
339 .computeInt32SizeNoTag(demands_.getInt(i));
344 size += com.google.protobuf.CodedOutputStream
345 .computeInt32SizeNoTag(dataSize);
347 demandsMemoizedSerializedSize = dataSize;
349 if (capacity_ != 0L) {
350 size += com.google.protobuf.CodedOutputStream
351 .computeInt64Size(5, capacity_);
353 size += getUnknownFields().getSerializedSize();
359 public boolean equals(
final java.lang.Object obj) {
363 if (!(obj instanceof com.google.ortools.sat.RoutesConstraintProto)) {
364 return super.equals(obj);
378 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
384 if (memoizedHashCode != 0) {
385 return memoizedHashCode;
406 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
408 hash = (29 * hash) + getUnknownFields().hashCode();
409 memoizedHashCode = hash;
414 java.nio.ByteBuffer data)
415 throws com.google.protobuf.InvalidProtocolBufferException {
416 return PARSER.parseFrom(data);
419 java.nio.ByteBuffer data,
420 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
421 throws com.google.protobuf.InvalidProtocolBufferException {
422 return PARSER.parseFrom(data, extensionRegistry);
425 com.google.protobuf.ByteString data)
426 throws com.google.protobuf.InvalidProtocolBufferException {
427 return PARSER.parseFrom(data);
430 com.google.protobuf.ByteString data,
431 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
432 throws com.google.protobuf.InvalidProtocolBufferException {
433 return PARSER.parseFrom(data, extensionRegistry);
436 throws com.google.protobuf.InvalidProtocolBufferException {
437 return PARSER.parseFrom(data);
441 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
442 throws com.google.protobuf.InvalidProtocolBufferException {
443 return PARSER.parseFrom(data, extensionRegistry);
446 throws java.io.IOException {
447 return com.google.protobuf.GeneratedMessage
448 .parseWithIOException(PARSER, input);
451 java.io.InputStream input,
452 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
453 throws java.io.IOException {
454 return com.google.protobuf.GeneratedMessage
455 .parseWithIOException(PARSER, input, extensionRegistry);
459 throws java.io.IOException {
460 return com.google.protobuf.GeneratedMessage
461 .parseDelimitedWithIOException(PARSER, input);
465 java.io.InputStream input,
466 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
467 throws java.io.IOException {
468 return com.google.protobuf.GeneratedMessage
469 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
472 com.google.protobuf.CodedInputStream input)
473 throws java.io.IOException {
474 return com.google.protobuf.GeneratedMessage
475 .parseWithIOException(PARSER, input);
478 com.google.protobuf.CodedInputStream input,
479 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
480 throws java.io.IOException {
481 return com.google.protobuf.GeneratedMessage
482 .parseWithIOException(PARSER, input, extensionRegistry);
495 return this == DEFAULT_INSTANCE
501 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
532 com.google.protobuf.GeneratedMessage.
Builder<Builder> implements
535 public static final com.google.protobuf.Descriptors.Descriptor
537 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_RoutesConstraintProto_descriptor;
541 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
543 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_RoutesConstraintProto_fieldAccessorTable
544 .ensureFieldAccessorsInitialized(
545 com.google.ortools.sat.RoutesConstraintProto.class, com.google.ortools.sat.RoutesConstraintProto.Builder.class);
554 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
562 tails_ = emptyIntList();
563 heads_ = emptyIntList();
564 literals_ = emptyIntList();
565 demands_ = emptyIntList();
571 public com.google.protobuf.Descriptors.Descriptor
573 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_RoutesConstraintProto_descriptor;
578 return com.google.ortools.sat.RoutesConstraintProto.getDefaultInstance();
585 throw newUninitializedMessageException(result);
593 if (bitField0_ != 0) { buildPartial0(result); }
598 private void buildPartial0(com.google.ortools.sat.RoutesConstraintProto result) {
599 int from_bitField0_ = bitField0_;
600 if (((from_bitField0_ & 0x00000001) != 0)) {
601 tails_.makeImmutable();
602 result.tails_ = tails_;
604 if (((from_bitField0_ & 0x00000002) != 0)) {
605 heads_.makeImmutable();
606 result.heads_ = heads_;
608 if (((from_bitField0_ & 0x00000004) != 0)) {
609 literals_.makeImmutable();
610 result.literals_ = literals_;
612 if (((from_bitField0_ & 0x00000008) != 0)) {
613 demands_.makeImmutable();
614 result.demands_ = demands_;
616 if (((from_bitField0_ & 0x00000010) != 0)) {
617 result.capacity_ = capacity_;
623 if (other instanceof com.google.ortools.sat.RoutesConstraintProto) {
624 return mergeFrom((com.google.ortools.sat.RoutesConstraintProto)other);
626 super.mergeFrom(other);
632 if (other == com.google.ortools.sat.RoutesConstraintProto.getDefaultInstance())
return this;
633 if (!other.tails_.isEmpty()) {
634 if (tails_.isEmpty()) {
635 tails_ = other.tails_;
636 tails_.makeImmutable();
637 bitField0_ |= 0x00000001;
639 ensureTailsIsMutable();
640 tails_.addAll(other.tails_);
644 if (!other.heads_.isEmpty()) {
645 if (heads_.isEmpty()) {
646 heads_ = other.heads_;
647 heads_.makeImmutable();
648 bitField0_ |= 0x00000002;
650 ensureHeadsIsMutable();
651 heads_.addAll(other.heads_);
655 if (!other.literals_.isEmpty()) {
656 if (literals_.isEmpty()) {
657 literals_ = other.literals_;
658 literals_.makeImmutable();
659 bitField0_ |= 0x00000004;
661 ensureLiteralsIsMutable();
662 literals_.addAll(other.literals_);
666 if (!other.demands_.isEmpty()) {
667 if (demands_.isEmpty()) {
668 demands_ = other.demands_;
669 demands_.makeImmutable();
670 bitField0_ |= 0x00000008;
672 ensureDemandsIsMutable();
673 demands_.addAll(other.demands_);
677 if (other.getCapacity() != 0L) {
680 this.mergeUnknownFields(other.getUnknownFields());
692 com.google.protobuf.CodedInputStream input,
693 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
694 throws java.io.IOException {
695 if (extensionRegistry ==
null) {
696 throw new java.lang.NullPointerException();
699 boolean done =
false;
701 int tag = input.readTag();
707 int v = input.readInt32();
708 ensureTailsIsMutable();
713 int length = input.readRawVarint32();
714 int limit = input.pushLimit(length);
715 ensureTailsIsMutable();
716 while (input.getBytesUntilLimit() > 0) {
717 tails_.addInt(input.readInt32());
719 input.popLimit(limit);
723 int v = input.readInt32();
724 ensureHeadsIsMutable();
729 int length = input.readRawVarint32();
730 int limit = input.pushLimit(length);
731 ensureHeadsIsMutable();
732 while (input.getBytesUntilLimit() > 0) {
733 heads_.addInt(input.readInt32());
735 input.popLimit(limit);
739 int v = input.readInt32();
740 ensureLiteralsIsMutable();
745 int length = input.readRawVarint32();
746 int limit = input.pushLimit(length);
747 ensureLiteralsIsMutable();
748 while (input.getBytesUntilLimit() > 0) {
749 literals_.addInt(input.readInt32());
751 input.popLimit(limit);
755 int v = input.readInt32();
756 ensureDemandsIsMutable();
761 int length = input.readRawVarint32();
762 int limit = input.pushLimit(length);
763 ensureDemandsIsMutable();
764 while (input.getBytesUntilLimit() > 0) {
765 demands_.addInt(input.readInt32());
767 input.popLimit(limit);
771 capacity_ = input.readInt64();
772 bitField0_ |= 0x00000010;
776 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
783 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
784 throw e.unwrapIOException();
790 private int bitField0_;
792 private com.google.protobuf.Internal.IntList tails_ = emptyIntList();
793 private void ensureTailsIsMutable() {
794 if (!tails_.isModifiable()) {
795 tails_ = makeMutableCopy(tails_);
797 bitField0_ |= 0x00000001;
803 public java.util.List<java.lang.Integer>
805 tails_.makeImmutable();
813 return tails_.size();
821 return tails_.getInt(index);
830 int index,
int value) {
832 ensureTailsIsMutable();
833 tails_.setInt(index, value);
834 bitField0_ |= 0x00000001;
845 ensureTailsIsMutable();
846 tails_.addInt(value);
847 bitField0_ |= 0x00000001;
857 java.lang.Iterable<? extends java.lang.Integer> values) {
858 ensureTailsIsMutable();
859 com.google.protobuf.AbstractMessageLite.Builder.addAll(
861 bitField0_ |= 0x00000001;
870 tails_ = emptyIntList();
871 bitField0_ = (bitField0_ & ~0x00000001);
876 private com.google.protobuf.Internal.IntList heads_ = emptyIntList();
877 private void ensureHeadsIsMutable() {
878 if (!heads_.isModifiable()) {
879 heads_ = makeMutableCopy(heads_);
881 bitField0_ |= 0x00000002;
887 public java.util.List<java.lang.Integer>
889 heads_.makeImmutable();
897 return heads_.size();
905 return heads_.getInt(index);
914 int index,
int value) {
916 ensureHeadsIsMutable();
917 heads_.setInt(index, value);
918 bitField0_ |= 0x00000002;
929 ensureHeadsIsMutable();
930 heads_.addInt(value);
931 bitField0_ |= 0x00000002;
941 java.lang.Iterable<? extends java.lang.Integer> values) {
942 ensureHeadsIsMutable();
943 com.google.protobuf.AbstractMessageLite.Builder.addAll(
945 bitField0_ |= 0x00000002;
954 heads_ = emptyIntList();
955 bitField0_ = (bitField0_ & ~0x00000002);
960 private com.google.protobuf.Internal.IntList literals_ = emptyIntList();
961 private void ensureLiteralsIsMutable() {
962 if (!literals_.isModifiable()) {
963 literals_ = makeMutableCopy(literals_);
965 bitField0_ |= 0x00000004;
971 public java.util.List<java.lang.Integer>
973 literals_.makeImmutable();
981 return literals_.size();
989 return literals_.getInt(index);
998 int index,
int value) {
1000 ensureLiteralsIsMutable();
1001 literals_.setInt(index, value);
1002 bitField0_ |= 0x00000004;
1013 ensureLiteralsIsMutable();
1014 literals_.addInt(value);
1015 bitField0_ |= 0x00000004;
1025 java.lang.Iterable<? extends java.lang.Integer> values) {
1026 ensureLiteralsIsMutable();
1027 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1029 bitField0_ |= 0x00000004;
1038 literals_ = emptyIntList();
1039 bitField0_ = (bitField0_ & ~0x00000004);
1044 private com.google.protobuf.Internal.IntList demands_ = emptyIntList();
1045 private void ensureDemandsIsMutable() {
1046 if (!demands_.isModifiable()) {
1047 demands_ = makeMutableCopy(demands_);
1049 bitField0_ |= 0x00000008;
1067 public java.util.List<java.lang.Integer>
1069 demands_.makeImmutable();
1089 return demands_.size();
1109 return demands_.getInt(index);
1130 int index,
int value) {
1132 ensureDemandsIsMutable();
1133 demands_.setInt(index, value);
1134 bitField0_ |= 0x00000008;
1157 ensureDemandsIsMutable();
1158 demands_.addInt(value);
1159 bitField0_ |= 0x00000008;
1181 java.lang.Iterable<? extends java.lang.Integer> values) {
1182 ensureDemandsIsMutable();
1183 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1185 bitField0_ |= 0x00000008;
1206 demands_ = emptyIntList();
1207 bitField0_ = (bitField0_ & ~0x00000008);
1212 private long capacity_ ;
1229 bitField0_ |= 0x00000010;
1238 bitField0_ = (bitField0_ & ~0x00000010);
1250 DEFAULT_INSTANCE =
new com.google.ortools.sat.RoutesConstraintProto();
1254 return DEFAULT_INSTANCE;
1261 com.google.protobuf.CodedInputStream input,
1262 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1263 throws com.google.protobuf.InvalidProtocolBufferException {
1266 builder.mergeFrom(input, extensionRegistry);
1267 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
1268 throw e.setUnfinishedMessage(builder.buildPartial());
1269 }
catch (com.google.protobuf.UninitializedMessageException e) {
1270 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1271 }
catch (java.io.IOException e) {
1272 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1273 .setUnfinishedMessage(builder.buildPartial());
1275 return builder.buildPartial();
1290 return DEFAULT_INSTANCE;