5package com.google.ortools.sat;
22 com.google.protobuf.GeneratedMessageV3 implements
25private static final long serialVersionUID = 0L;
31 intervals_ = emptyIntList();
32 demands_ = java.util.Collections.emptyList();
36 @SuppressWarnings({
"unused"})
38 UnusedPrivateParameter unused) {
42 public static final com.google.protobuf.Descriptors.Descriptor
44 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CumulativeConstraintProto_descriptor;
48 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
50 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CumulativeConstraintProto_fieldAccessorTable
51 .ensureFieldAccessorsInitialized(
52 com.google.ortools.sat.CumulativeConstraintProto.class, com.google.ortools.sat.CumulativeConstraintProto.Builder.class);
55 private int bitField0_;
64 return ((bitField0_ & 0x00000001) != 0);
72 return capacity_ ==
null ? com.google.ortools.sat.LinearExpressionProto.getDefaultInstance() : capacity_;
79 return capacity_ ==
null ? com.google.ortools.sat.LinearExpressionProto.getDefaultInstance() : capacity_;
83 @SuppressWarnings(
"serial")
84 private com.google.protobuf.Internal.IntList intervals_ =
91 public java.util.List<java.lang.Integer>
100 return intervals_.size();
108 return intervals_.getInt(index);
110 private int intervalsMemoizedSerializedSize = -1;
113 @SuppressWarnings(
"serial")
134 public java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder>
147 return demands_.size();
158 return demands_.get(index);
170 return demands_.get(index);
173 private byte memoizedIsInitialized = -1;
180 memoizedIsInitialized = 1;
185 public void writeTo(com.google.protobuf.CodedOutputStream output)
186 throws java.io.IOException {
188 if (((bitField0_ & 0x00000001) != 0)) {
192 output.writeUInt32NoTag(18);
193 output.writeUInt32NoTag(intervalsMemoizedSerializedSize);
195 for (
int i = 0; i < intervals_.size(); i++) {
196 output.writeInt32NoTag(intervals_.getInt(i));
198 for (
int i = 0; i < demands_.size(); i++) {
199 output.writeMessage(3, demands_.get(i));
201 getUnknownFields().writeTo(output);
206 int size = memoizedSize;
207 if (size != -1)
return size;
210 if (((bitField0_ & 0x00000001) != 0)) {
211 size += com.google.protobuf.CodedOutputStream
216 for (
int i = 0; i < intervals_.size(); i++) {
217 dataSize += com.google.protobuf.CodedOutputStream
218 .computeInt32SizeNoTag(intervals_.getInt(i));
223 size += com.google.protobuf.CodedOutputStream
224 .computeInt32SizeNoTag(dataSize);
226 intervalsMemoizedSerializedSize = dataSize;
228 for (
int i = 0; i < demands_.size(); i++) {
229 size += com.google.protobuf.CodedOutputStream
230 .computeMessageSize(3, demands_.get(i));
232 size += getUnknownFields().getSerializedSize();
238 public boolean equals(
final java.lang.Object obj) {
242 if (!(obj instanceof com.google.ortools.sat.CumulativeConstraintProto)) {
243 return super.equals(obj);
256 if (!getUnknownFields().equals(other.getUnknownFields()))
return false;
262 if (memoizedHashCode != 0) {
263 return memoizedHashCode;
279 hash = (29 * hash) + getUnknownFields().hashCode();
280 memoizedHashCode = hash;
285 java.nio.ByteBuffer data)
286 throws com.google.protobuf.InvalidProtocolBufferException {
287 return PARSER.parseFrom(data);
290 java.nio.ByteBuffer data,
291 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
292 throws com.google.protobuf.InvalidProtocolBufferException {
293 return PARSER.parseFrom(data, extensionRegistry);
296 com.google.protobuf.ByteString data)
297 throws com.google.protobuf.InvalidProtocolBufferException {
298 return PARSER.parseFrom(data);
301 com.google.protobuf.ByteString data,
302 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
303 throws com.google.protobuf.InvalidProtocolBufferException {
304 return PARSER.parseFrom(data, extensionRegistry);
307 throws com.google.protobuf.InvalidProtocolBufferException {
308 return PARSER.parseFrom(data);
312 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
313 throws com.google.protobuf.InvalidProtocolBufferException {
314 return PARSER.parseFrom(data, extensionRegistry);
317 throws java.io.IOException {
318 return com.google.protobuf.GeneratedMessageV3
319 .parseWithIOException(PARSER, input);
322 java.io.InputStream input,
323 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
324 throws java.io.IOException {
325 return com.google.protobuf.GeneratedMessageV3
326 .parseWithIOException(PARSER, input, extensionRegistry);
330 throws java.io.IOException {
331 return com.google.protobuf.GeneratedMessageV3
332 .parseDelimitedWithIOException(PARSER, input);
336 java.io.InputStream input,
337 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
338 throws java.io.IOException {
339 return com.google.protobuf.GeneratedMessageV3
340 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
343 com.google.protobuf.CodedInputStream input)
344 throws java.io.IOException {
345 return com.google.protobuf.GeneratedMessageV3
346 .parseWithIOException(PARSER, input);
349 com.google.protobuf.CodedInputStream input,
350 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
351 throws java.io.IOException {
352 return com.google.protobuf.GeneratedMessageV3
353 .parseWithIOException(PARSER, input, extensionRegistry);
366 return this == DEFAULT_INSTANCE
372 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
391 com.google.protobuf.GeneratedMessageV3.
Builder<Builder> implements
394 public static final com.google.protobuf.Descriptors.Descriptor
396 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CumulativeConstraintProto_descriptor;
400 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
402 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CumulativeConstraintProto_fieldAccessorTable
403 .ensureFieldAccessorsInitialized(
404 com.google.ortools.sat.CumulativeConstraintProto.class, com.google.ortools.sat.CumulativeConstraintProto.Builder.class);
409 maybeForceBuilderInitialization();
413 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
415 maybeForceBuilderInitialization();
417 private void maybeForceBuilderInitialization() {
418 if (com.google.protobuf.GeneratedMessageV3
419 .alwaysUseFieldBuilders) {
420 getCapacityFieldBuilder();
421 getDemandsFieldBuilder();
429 if (capacityBuilder_ !=
null) {
430 capacityBuilder_.dispose();
431 capacityBuilder_ =
null;
433 intervals_ = emptyIntList();
434 if (demandsBuilder_ ==
null) {
435 demands_ = java.util.Collections.emptyList();
438 demandsBuilder_.clear();
440 bitField0_ = (bitField0_ & ~0x00000004);
445 public com.google.protobuf.Descriptors.Descriptor
447 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CumulativeConstraintProto_descriptor;
452 return com.google.ortools.sat.CumulativeConstraintProto.getDefaultInstance();
459 throw newUninitializedMessageException(result);
467 buildPartialRepeatedFields(result);
468 if (bitField0_ != 0) { buildPartial0(result); }
473 private void buildPartialRepeatedFields(com.google.ortools.sat.CumulativeConstraintProto result) {
474 if (demandsBuilder_ ==
null) {
475 if (((bitField0_ & 0x00000004) != 0)) {
476 demands_ = java.util.Collections.unmodifiableList(demands_);
477 bitField0_ = (bitField0_ & ~0x00000004);
479 result.demands_ = demands_;
481 result.demands_ = demandsBuilder_.build();
485 private void buildPartial0(com.google.ortools.sat.CumulativeConstraintProto result) {
486 int from_bitField0_ = bitField0_;
487 int to_bitField0_ = 0;
488 if (((from_bitField0_ & 0x00000001) != 0)) {
489 result.capacity_ = capacityBuilder_ ==
null
491 : capacityBuilder_.build();
492 to_bitField0_ |= 0x00000001;
494 if (((from_bitField0_ & 0x00000002) != 0)) {
495 intervals_.makeImmutable();
496 result.intervals_ = intervals_;
498 result.bitField0_ |= to_bitField0_;
503 return super.
clone();
507 com.google.protobuf.Descriptors.FieldDescriptor field,
508 java.lang.Object value) {
509 return super.
setField(field, value);
513 com.google.protobuf.Descriptors.FieldDescriptor field) {
518 com.google.protobuf.Descriptors.OneofDescriptor oneof) {
523 com.google.protobuf.Descriptors.FieldDescriptor field,
524 int index, java.lang.Object value) {
529 com.google.protobuf.Descriptors.FieldDescriptor field,
530 java.lang.Object value) {
535 if (other instanceof com.google.ortools.sat.CumulativeConstraintProto) {
536 return mergeFrom((com.google.ortools.sat.CumulativeConstraintProto)other);
538 super.mergeFrom(other);
544 if (other == com.google.ortools.sat.CumulativeConstraintProto.getDefaultInstance())
return this;
545 if (other.hasCapacity()) {
548 if (!other.intervals_.isEmpty()) {
549 if (intervals_.isEmpty()) {
550 intervals_ = other.intervals_;
551 intervals_.makeImmutable();
552 bitField0_ |= 0x00000002;
554 ensureIntervalsIsMutable();
555 intervals_.addAll(other.intervals_);
559 if (demandsBuilder_ ==
null) {
560 if (!other.demands_.isEmpty()) {
561 if (demands_.isEmpty()) {
562 demands_ = other.demands_;
563 bitField0_ = (bitField0_ & ~0x00000004);
565 ensureDemandsIsMutable();
566 demands_.addAll(other.demands_);
571 if (!other.demands_.isEmpty()) {
572 if (demandsBuilder_.isEmpty()) {
573 demandsBuilder_.dispose();
574 demandsBuilder_ =
null;
575 demands_ = other.demands_;
576 bitField0_ = (bitField0_ & ~0x00000004);
578 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
579 getDemandsFieldBuilder() :
null;
581 demandsBuilder_.addAllMessages(other.demands_);
597 com.google.protobuf.CodedInputStream input,
598 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
599 throws java.io.IOException {
600 if (extensionRegistry ==
null) {
601 throw new java.lang.NullPointerException();
604 boolean done =
false;
606 int tag = input.readTag();
613 getCapacityFieldBuilder().getBuilder(),
615 bitField0_ |= 0x00000001;
619 int v = input.readInt32();
620 ensureIntervalsIsMutable();
621 intervals_.addInt(v);
625 int length = input.readRawVarint32();
626 int limit = input.pushLimit(length);
627 ensureIntervalsIsMutable();
628 while (input.getBytesUntilLimit() > 0) {
629 intervals_.addInt(input.readInt32());
631 input.popLimit(limit);
637 com.google.ortools.sat.LinearExpressionProto.parser(),
639 if (demandsBuilder_ ==
null) {
640 ensureDemandsIsMutable();
643 demandsBuilder_.addMessage(m);
648 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
655 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
656 throw e.unwrapIOException();
662 private int bitField0_;
665 private com.google.protobuf.SingleFieldBuilderV3<
666 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder> capacityBuilder_;
672 return ((bitField0_ & 0x00000001) != 0);
679 if (capacityBuilder_ ==
null) {
680 return capacity_ ==
null ? com.google.ortools.sat.LinearExpressionProto.getDefaultInstance() : capacity_;
682 return capacityBuilder_.getMessage();
689 if (capacityBuilder_ ==
null) {
691 throw new NullPointerException();
695 capacityBuilder_.setMessage(value);
697 bitField0_ |= 0x00000001;
705 com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
706 if (capacityBuilder_ ==
null) {
707 capacity_ = builderForValue.build();
709 capacityBuilder_.setMessage(builderForValue.build());
711 bitField0_ |= 0x00000001;
719 if (capacityBuilder_ ==
null) {
720 if (((bitField0_ & 0x00000001) != 0) &&
722 capacity_ != com.google.ortools.sat.LinearExpressionProto.getDefaultInstance()) {
728 capacityBuilder_.mergeFrom(value);
730 if (capacity_ !=
null) {
731 bitField0_ |= 0x00000001;
740 bitField0_ = (bitField0_ & ~0x00000001);
742 if (capacityBuilder_ !=
null) {
743 capacityBuilder_.dispose();
744 capacityBuilder_ =
null;
753 bitField0_ |= 0x00000001;
755 return getCapacityFieldBuilder().getBuilder();
761 if (capacityBuilder_ !=
null) {
762 return capacityBuilder_.getMessageOrBuilder();
764 return capacity_ ==
null ?
765 com.google.ortools.sat.LinearExpressionProto.getDefaultInstance() : capacity_;
771 private com.google.protobuf.SingleFieldBuilderV3<
772 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder>
773 getCapacityFieldBuilder() {
774 if (capacityBuilder_ ==
null) {
775 capacityBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
776 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder>(
778 getParentForChildren(),
782 return capacityBuilder_;
785 private com.google.protobuf.Internal.IntList intervals_ = emptyIntList();
786 private void ensureIntervalsIsMutable() {
787 if (!intervals_.isModifiable()) {
788 intervals_ = makeMutableCopy(intervals_);
790 bitField0_ |= 0x00000002;
796 public java.util.List<java.lang.Integer>
798 intervals_.makeImmutable();
806 return intervals_.size();
814 return intervals_.getInt(index);
823 int index,
int value) {
825 ensureIntervalsIsMutable();
826 intervals_.setInt(index, value);
827 bitField0_ |= 0x00000002;
838 ensureIntervalsIsMutable();
839 intervals_.addInt(value);
840 bitField0_ |= 0x00000002;
850 java.lang.Iterable<? extends java.lang.Integer> values) {
851 ensureIntervalsIsMutable();
852 com.google.protobuf.AbstractMessageLite.Builder.addAll(
854 bitField0_ |= 0x00000002;
863 intervals_ = emptyIntList();
864 bitField0_ = (bitField0_ & ~0x00000002);
869 private java.util.List<com.google.ortools.sat.LinearExpressionProto> demands_ =
870 java.util.Collections.emptyList();
871 private void ensureDemandsIsMutable() {
872 if (!((bitField0_ & 0x00000004) != 0)) {
873 demands_ =
new java.util.ArrayList<com.google.ortools.sat.LinearExpressionProto>(demands_);
874 bitField0_ |= 0x00000004;
878 private com.google.protobuf.RepeatedFieldBuilderV3<
879 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder> demandsBuilder_;
888 public java.util.List<com.google.ortools.sat.LinearExpressionProto>
getDemandsList() {
889 if (demandsBuilder_ ==
null) {
890 return java.util.Collections.unmodifiableList(demands_);
892 return demandsBuilder_.getMessageList();
903 if (demandsBuilder_ ==
null) {
904 return demands_.size();
906 return demandsBuilder_.getCount();
917 if (demandsBuilder_ ==
null) {
918 return demands_.get(index);
920 return demandsBuilder_.getMessage(index);
931 int index, com.google.ortools.sat.LinearExpressionProto value) {
932 if (demandsBuilder_ ==
null) {
934 throw new NullPointerException();
936 ensureDemandsIsMutable();
937 demands_.set(index, value);
940 demandsBuilder_.setMessage(index, value);
952 int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
953 if (demandsBuilder_ ==
null) {
954 ensureDemandsIsMutable();
955 demands_.set(index, builderForValue.build());
958 demandsBuilder_.setMessage(index, builderForValue.build());
970 if (demandsBuilder_ ==
null) {
972 throw new NullPointerException();
974 ensureDemandsIsMutable();
978 demandsBuilder_.addMessage(value);
990 int index, com.google.ortools.sat.LinearExpressionProto value) {
991 if (demandsBuilder_ ==
null) {
993 throw new NullPointerException();
995 ensureDemandsIsMutable();
996 demands_.add(index, value);
999 demandsBuilder_.addMessage(index, value);
1011 com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
1012 if (demandsBuilder_ ==
null) {
1013 ensureDemandsIsMutable();
1014 demands_.add(builderForValue.build());
1017 demandsBuilder_.addMessage(builderForValue.build());
1029 int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
1030 if (demandsBuilder_ ==
null) {
1031 ensureDemandsIsMutable();
1032 demands_.add(index, builderForValue.build());
1035 demandsBuilder_.addMessage(index, builderForValue.build());
1047 java.lang.Iterable<? extends com.google.ortools.sat.LinearExpressionProto> values) {
1048 if (demandsBuilder_ ==
null) {
1049 ensureDemandsIsMutable();
1050 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1054 demandsBuilder_.addAllMessages(values);
1066 if (demandsBuilder_ ==
null) {
1067 demands_ = java.util.Collections.emptyList();
1068 bitField0_ = (bitField0_ & ~0x00000004);
1071 demandsBuilder_.clear();
1083 if (demandsBuilder_ ==
null) {
1084 ensureDemandsIsMutable();
1085 demands_.remove(index);
1088 demandsBuilder_.remove(index);
1101 return getDemandsFieldBuilder().getBuilder(index);
1112 if (demandsBuilder_ ==
null) {
1113 return demands_.get(index); }
else {
1114 return demandsBuilder_.getMessageOrBuilder(index);
1124 public java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder>
1126 if (demandsBuilder_ !=
null) {
1127 return demandsBuilder_.getMessageOrBuilderList();
1129 return java.util.Collections.unmodifiableList(demands_);
1140 return getDemandsFieldBuilder().addBuilder(
1141 com.google.ortools.sat.LinearExpressionProto.getDefaultInstance());
1152 return getDemandsFieldBuilder().addBuilder(
1153 index, com.google.ortools.sat.LinearExpressionProto.getDefaultInstance());
1162 public java.util.List<com.google.ortools.sat.LinearExpressionProto.Builder>
1164 return getDemandsFieldBuilder().getBuilderList();
1166 private com.google.protobuf.RepeatedFieldBuilderV3<
1167 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder>
1168 getDemandsFieldBuilder() {
1169 if (demandsBuilder_ ==
null) {
1170 demandsBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
1171 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder>(
1173 ((bitField0_ & 0x00000004) != 0),
1174 getParentForChildren(),
1178 return demandsBuilder_;
1182 final com.google.protobuf.UnknownFieldSet unknownFields) {
1188 final com.google.protobuf.UnknownFieldSet unknownFields) {
1199 DEFAULT_INSTANCE =
new com.google.ortools.sat.CumulativeConstraintProto();
1203 return DEFAULT_INSTANCE;
1210 com.google.protobuf.CodedInputStream input,
1211 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1212 throws com.google.protobuf.InvalidProtocolBufferException {
1215 builder.mergeFrom(input, extensionRegistry);
1216 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
1217 throw e.setUnfinishedMessage(builder.buildPartial());
1218 }
catch (com.google.protobuf.UninitializedMessageException e) {
1219 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1220 }
catch (java.io.IOException e) {
1221 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1222 .setUnfinishedMessage(builder.buildPartial());
1224 return builder.buildPartial();
1239 return DEFAULT_INSTANCE;