5package com.google.ortools.sat;
22 com.google.protobuf.GeneratedMessage implements
25private static final long serialVersionUID = 0L;
27 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
28 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
40 intervals_ = emptyIntList();
41 demands_ = java.util.Collections.emptyList();
44 public static final com.google.protobuf.Descriptors.Descriptor
46 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CumulativeConstraintProto_descriptor;
50 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
52 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CumulativeConstraintProto_fieldAccessorTable
53 .ensureFieldAccessorsInitialized(
54 com.google.ortools.sat.CumulativeConstraintProto.class, com.google.ortools.sat.CumulativeConstraintProto.Builder.class);
57 private int bitField0_;
66 return ((bitField0_ & 0x00000001) != 0);
74 return capacity_ ==
null ? com.google.ortools.sat.LinearExpressionProto.getDefaultInstance() : capacity_;
81 return capacity_ ==
null ? com.google.ortools.sat.LinearExpressionProto.getDefaultInstance() : capacity_;
85 @SuppressWarnings(
"serial")
86 private com.google.protobuf.Internal.IntList intervals_ =
93 public java.util.List<java.lang.Integer>
102 return intervals_.size();
110 return intervals_.getInt(index);
112 private int intervalsMemoizedSerializedSize = -1;
115 @SuppressWarnings(
"serial")
136 public java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder>
149 return demands_.size();
160 return demands_.get(index);
172 return demands_.get(index);
175 private byte memoizedIsInitialized = -1;
182 memoizedIsInitialized = 1;
187 public void writeTo(com.google.protobuf.CodedOutputStream output)
188 throws java.io.IOException {
190 if (((bitField0_ & 0x00000001) != 0)) {
194 output.writeUInt32NoTag(18);
195 output.writeUInt32NoTag(intervalsMemoizedSerializedSize);
197 for (
int i = 0; i < intervals_.size(); i++) {
198 output.writeInt32NoTag(intervals_.getInt(i));
200 for (
int i = 0; i < demands_.size(); i++) {
201 output.writeMessage(3, demands_.get(i));
203 getUnknownFields().writeTo(output);
208 int size = memoizedSize;
209 if (size != -1)
return size;
212 if (((bitField0_ & 0x00000001) != 0)) {
213 size += com.google.protobuf.CodedOutputStream
218 for (
int i = 0; i < intervals_.size(); i++) {
219 dataSize += com.google.protobuf.CodedOutputStream
220 .computeInt32SizeNoTag(intervals_.getInt(i));
225 size += com.google.protobuf.CodedOutputStream
226 .computeInt32SizeNoTag(dataSize);
228 intervalsMemoizedSerializedSize = dataSize;
230 for (
int i = 0; i < demands_.size(); i++) {
231 size += com.google.protobuf.CodedOutputStream
232 .computeMessageSize(3, demands_.get(i));
234 size += getUnknownFields().getSerializedSize();
240 public boolean equals(
final java.lang.Object obj) {
244 if (!(obj instanceof com.google.ortools.sat.CumulativeConstraintProto)) {
245 return super.equals(obj);
258 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
264 if (memoizedHashCode != 0) {
265 return memoizedHashCode;
281 hash = (29 * hash) + getUnknownFields().hashCode();
282 memoizedHashCode = hash;
287 java.nio.ByteBuffer data)
288 throws com.google.protobuf.InvalidProtocolBufferException {
289 return PARSER.parseFrom(data);
292 java.nio.ByteBuffer data,
293 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
294 throws com.google.protobuf.InvalidProtocolBufferException {
295 return PARSER.parseFrom(data, extensionRegistry);
298 com.google.protobuf.ByteString data)
299 throws com.google.protobuf.InvalidProtocolBufferException {
300 return PARSER.parseFrom(data);
303 com.google.protobuf.ByteString data,
304 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
305 throws com.google.protobuf.InvalidProtocolBufferException {
306 return PARSER.parseFrom(data, extensionRegistry);
309 throws com.google.protobuf.InvalidProtocolBufferException {
310 return PARSER.parseFrom(data);
314 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
315 throws com.google.protobuf.InvalidProtocolBufferException {
316 return PARSER.parseFrom(data, extensionRegistry);
319 throws java.io.IOException {
320 return com.google.protobuf.GeneratedMessage
321 .parseWithIOException(PARSER, input);
324 java.io.InputStream input,
325 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
326 throws java.io.IOException {
327 return com.google.protobuf.GeneratedMessage
328 .parseWithIOException(PARSER, input, extensionRegistry);
332 throws java.io.IOException {
333 return com.google.protobuf.GeneratedMessage
334 .parseDelimitedWithIOException(PARSER, input);
338 java.io.InputStream input,
339 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
340 throws java.io.IOException {
341 return com.google.protobuf.GeneratedMessage
342 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
345 com.google.protobuf.CodedInputStream input)
346 throws java.io.IOException {
347 return com.google.protobuf.GeneratedMessage
348 .parseWithIOException(PARSER, input);
351 com.google.protobuf.CodedInputStream input,
352 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
353 throws java.io.IOException {
354 return com.google.protobuf.GeneratedMessage
355 .parseWithIOException(PARSER, input, extensionRegistry);
368 return this == DEFAULT_INSTANCE
374 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
393 com.google.protobuf.GeneratedMessage.
Builder<Builder> implements
396 public static final com.google.protobuf.Descriptors.Descriptor
398 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CumulativeConstraintProto_descriptor;
402 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
404 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CumulativeConstraintProto_fieldAccessorTable
405 .ensureFieldAccessorsInitialized(
406 com.google.ortools.sat.CumulativeConstraintProto.class, com.google.ortools.sat.CumulativeConstraintProto.Builder.class);
411 maybeForceBuilderInitialization();
415 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
417 maybeForceBuilderInitialization();
419 private void maybeForceBuilderInitialization() {
420 if (com.google.protobuf.GeneratedMessage
421 .alwaysUseFieldBuilders) {
422 getCapacityFieldBuilder();
423 getDemandsFieldBuilder();
431 if (capacityBuilder_ !=
null) {
432 capacityBuilder_.dispose();
433 capacityBuilder_ =
null;
435 intervals_ = emptyIntList();
436 if (demandsBuilder_ ==
null) {
437 demands_ = java.util.Collections.emptyList();
440 demandsBuilder_.clear();
442 bitField0_ = (bitField0_ & ~0x00000004);
447 public com.google.protobuf.Descriptors.Descriptor
449 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CumulativeConstraintProto_descriptor;
454 return com.google.ortools.sat.CumulativeConstraintProto.getDefaultInstance();
461 throw newUninitializedMessageException(result);
469 buildPartialRepeatedFields(result);
470 if (bitField0_ != 0) { buildPartial0(result); }
475 private void buildPartialRepeatedFields(com.google.ortools.sat.CumulativeConstraintProto result) {
476 if (demandsBuilder_ ==
null) {
477 if (((bitField0_ & 0x00000004) != 0)) {
478 demands_ = java.util.Collections.unmodifiableList(demands_);
479 bitField0_ = (bitField0_ & ~0x00000004);
481 result.demands_ = demands_;
483 result.demands_ = demandsBuilder_.build();
487 private void buildPartial0(com.google.ortools.sat.CumulativeConstraintProto result) {
488 int from_bitField0_ = bitField0_;
489 int to_bitField0_ = 0;
490 if (((from_bitField0_ & 0x00000001) != 0)) {
491 result.capacity_ = capacityBuilder_ ==
null
493 : capacityBuilder_.build();
494 to_bitField0_ |= 0x00000001;
496 if (((from_bitField0_ & 0x00000002) != 0)) {
497 intervals_.makeImmutable();
498 result.intervals_ = intervals_;
500 result.bitField0_ |= to_bitField0_;
505 if (other instanceof com.google.ortools.sat.CumulativeConstraintProto) {
506 return mergeFrom((com.google.ortools.sat.CumulativeConstraintProto)other);
508 super.mergeFrom(other);
514 if (other == com.google.ortools.sat.CumulativeConstraintProto.getDefaultInstance())
return this;
515 if (other.hasCapacity()) {
518 if (!other.intervals_.isEmpty()) {
519 if (intervals_.isEmpty()) {
520 intervals_ = other.intervals_;
521 intervals_.makeImmutable();
522 bitField0_ |= 0x00000002;
524 ensureIntervalsIsMutable();
525 intervals_.addAll(other.intervals_);
529 if (demandsBuilder_ ==
null) {
530 if (!other.demands_.isEmpty()) {
531 if (demands_.isEmpty()) {
532 demands_ = other.demands_;
533 bitField0_ = (bitField0_ & ~0x00000004);
535 ensureDemandsIsMutable();
536 demands_.addAll(other.demands_);
541 if (!other.demands_.isEmpty()) {
542 if (demandsBuilder_.isEmpty()) {
543 demandsBuilder_.dispose();
544 demandsBuilder_ =
null;
545 demands_ = other.demands_;
546 bitField0_ = (bitField0_ & ~0x00000004);
548 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
549 getDemandsFieldBuilder() :
null;
551 demandsBuilder_.addAllMessages(other.demands_);
555 this.mergeUnknownFields(other.getUnknownFields());
567 com.google.protobuf.CodedInputStream input,
568 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
569 throws java.io.IOException {
570 if (extensionRegistry ==
null) {
571 throw new java.lang.NullPointerException();
574 boolean done =
false;
576 int tag = input.readTag();
583 getCapacityFieldBuilder().getBuilder(),
585 bitField0_ |= 0x00000001;
589 int v = input.readInt32();
590 ensureIntervalsIsMutable();
591 intervals_.addInt(v);
595 int length = input.readRawVarint32();
596 int limit = input.pushLimit(length);
597 ensureIntervalsIsMutable();
598 while (input.getBytesUntilLimit() > 0) {
599 intervals_.addInt(input.readInt32());
601 input.popLimit(limit);
607 com.google.ortools.sat.LinearExpressionProto.parser(),
609 if (demandsBuilder_ ==
null) {
610 ensureDemandsIsMutable();
613 demandsBuilder_.addMessage(m);
618 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
625 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
626 throw e.unwrapIOException();
632 private int bitField0_;
635 private com.google.protobuf.SingleFieldBuilder<
636 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder> capacityBuilder_;
642 return ((bitField0_ & 0x00000001) != 0);
649 if (capacityBuilder_ ==
null) {
650 return capacity_ ==
null ? com.google.ortools.sat.LinearExpressionProto.getDefaultInstance() : capacity_;
652 return capacityBuilder_.getMessage();
659 if (capacityBuilder_ ==
null) {
661 throw new NullPointerException();
665 capacityBuilder_.setMessage(value);
667 bitField0_ |= 0x00000001;
675 com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
676 if (capacityBuilder_ ==
null) {
677 capacity_ = builderForValue.build();
679 capacityBuilder_.setMessage(builderForValue.build());
681 bitField0_ |= 0x00000001;
689 if (capacityBuilder_ ==
null) {
690 if (((bitField0_ & 0x00000001) != 0) &&
692 capacity_ != com.google.ortools.sat.LinearExpressionProto.getDefaultInstance()) {
698 capacityBuilder_.mergeFrom(value);
700 if (capacity_ !=
null) {
701 bitField0_ |= 0x00000001;
710 bitField0_ = (bitField0_ & ~0x00000001);
712 if (capacityBuilder_ !=
null) {
713 capacityBuilder_.dispose();
714 capacityBuilder_ =
null;
723 bitField0_ |= 0x00000001;
725 return getCapacityFieldBuilder().getBuilder();
731 if (capacityBuilder_ !=
null) {
732 return capacityBuilder_.getMessageOrBuilder();
734 return capacity_ ==
null ?
735 com.google.ortools.sat.LinearExpressionProto.getDefaultInstance() : capacity_;
741 private com.google.protobuf.SingleFieldBuilder<
742 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder>
743 getCapacityFieldBuilder() {
744 if (capacityBuilder_ ==
null) {
745 capacityBuilder_ =
new com.google.protobuf.SingleFieldBuilder<
746 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder>(
748 getParentForChildren(),
752 return capacityBuilder_;
755 private com.google.protobuf.Internal.IntList intervals_ = emptyIntList();
756 private void ensureIntervalsIsMutable() {
757 if (!intervals_.isModifiable()) {
758 intervals_ = makeMutableCopy(intervals_);
760 bitField0_ |= 0x00000002;
766 public java.util.List<java.lang.Integer>
768 intervals_.makeImmutable();
776 return intervals_.size();
784 return intervals_.getInt(index);
793 int index,
int value) {
795 ensureIntervalsIsMutable();
796 intervals_.setInt(index, value);
797 bitField0_ |= 0x00000002;
808 ensureIntervalsIsMutable();
809 intervals_.addInt(value);
810 bitField0_ |= 0x00000002;
820 java.lang.Iterable<? extends java.lang.Integer> values) {
821 ensureIntervalsIsMutable();
822 com.google.protobuf.AbstractMessageLite.Builder.addAll(
824 bitField0_ |= 0x00000002;
833 intervals_ = emptyIntList();
834 bitField0_ = (bitField0_ & ~0x00000002);
839 private java.util.List<com.google.ortools.sat.LinearExpressionProto> demands_ =
840 java.util.Collections.emptyList();
841 private void ensureDemandsIsMutable() {
842 if (!((bitField0_ & 0x00000004) != 0)) {
843 demands_ =
new java.util.ArrayList<com.google.ortools.sat.LinearExpressionProto>(demands_);
844 bitField0_ |= 0x00000004;
848 private com.google.protobuf.RepeatedFieldBuilder<
849 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder> demandsBuilder_;
858 public java.util.List<com.google.ortools.sat.LinearExpressionProto>
getDemandsList() {
859 if (demandsBuilder_ ==
null) {
860 return java.util.Collections.unmodifiableList(demands_);
862 return demandsBuilder_.getMessageList();
873 if (demandsBuilder_ ==
null) {
874 return demands_.size();
876 return demandsBuilder_.getCount();
887 if (demandsBuilder_ ==
null) {
888 return demands_.get(index);
890 return demandsBuilder_.getMessage(index);
901 int index, com.google.ortools.sat.LinearExpressionProto value) {
902 if (demandsBuilder_ ==
null) {
904 throw new NullPointerException();
906 ensureDemandsIsMutable();
907 demands_.set(index, value);
910 demandsBuilder_.setMessage(index, value);
922 int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
923 if (demandsBuilder_ ==
null) {
924 ensureDemandsIsMutable();
925 demands_.set(index, builderForValue.build());
928 demandsBuilder_.setMessage(index, builderForValue.build());
940 if (demandsBuilder_ ==
null) {
942 throw new NullPointerException();
944 ensureDemandsIsMutable();
948 demandsBuilder_.addMessage(value);
960 int index, com.google.ortools.sat.LinearExpressionProto value) {
961 if (demandsBuilder_ ==
null) {
963 throw new NullPointerException();
965 ensureDemandsIsMutable();
966 demands_.add(index, value);
969 demandsBuilder_.addMessage(index, value);
981 com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
982 if (demandsBuilder_ ==
null) {
983 ensureDemandsIsMutable();
984 demands_.add(builderForValue.build());
987 demandsBuilder_.addMessage(builderForValue.build());
999 int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
1000 if (demandsBuilder_ ==
null) {
1001 ensureDemandsIsMutable();
1002 demands_.add(index, builderForValue.build());
1005 demandsBuilder_.addMessage(index, builderForValue.build());
1017 java.lang.Iterable<? extends com.google.ortools.sat.LinearExpressionProto> values) {
1018 if (demandsBuilder_ ==
null) {
1019 ensureDemandsIsMutable();
1020 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1024 demandsBuilder_.addAllMessages(values);
1036 if (demandsBuilder_ ==
null) {
1037 demands_ = java.util.Collections.emptyList();
1038 bitField0_ = (bitField0_ & ~0x00000004);
1041 demandsBuilder_.clear();
1053 if (demandsBuilder_ ==
null) {
1054 ensureDemandsIsMutable();
1055 demands_.remove(index);
1058 demandsBuilder_.remove(index);
1071 return getDemandsFieldBuilder().getBuilder(index);
1082 if (demandsBuilder_ ==
null) {
1083 return demands_.get(index); }
else {
1084 return demandsBuilder_.getMessageOrBuilder(index);
1094 public java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder>
1096 if (demandsBuilder_ !=
null) {
1097 return demandsBuilder_.getMessageOrBuilderList();
1099 return java.util.Collections.unmodifiableList(demands_);
1110 return getDemandsFieldBuilder().addBuilder(
1111 com.google.ortools.sat.LinearExpressionProto.getDefaultInstance());
1122 return getDemandsFieldBuilder().addBuilder(
1123 index, com.google.ortools.sat.LinearExpressionProto.getDefaultInstance());
1132 public java.util.List<com.google.ortools.sat.LinearExpressionProto.Builder>
1134 return getDemandsFieldBuilder().getBuilderList();
1136 private com.google.protobuf.RepeatedFieldBuilder<
1137 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder>
1138 getDemandsFieldBuilder() {
1139 if (demandsBuilder_ ==
null) {
1140 demandsBuilder_ =
new com.google.protobuf.RepeatedFieldBuilder<
1141 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder>(
1143 ((bitField0_ & 0x00000004) != 0),
1144 getParentForChildren(),
1148 return demandsBuilder_;
1157 DEFAULT_INSTANCE =
new com.google.ortools.sat.CumulativeConstraintProto();
1161 return DEFAULT_INSTANCE;
1168 com.google.protobuf.CodedInputStream input,
1169 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1170 throws com.google.protobuf.InvalidProtocolBufferException {
1173 builder.mergeFrom(input, extensionRegistry);
1174 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
1175 throw e.setUnfinishedMessage(builder.buildPartial());
1176 }
catch (com.google.protobuf.UninitializedMessageException e) {
1177 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1178 }
catch (java.io.IOException e) {
1179 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1180 .setUnfinishedMessage(builder.buildPartial());
1182 return builder.buildPartial();
1197 return DEFAULT_INSTANCE;