Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
CumulativeConstraintProto.java
Go to the documentation of this file.
1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: ortools/sat/cp_model.proto
3
4// Protobuf Java Version: 4.26.1
5package com.google.ortools.sat;
6
21public final class CumulativeConstraintProto extends
22 com.google.protobuf.GeneratedMessage implements
23 // @@protoc_insertion_point(message_implements:operations_research.sat.CumulativeConstraintProto)
25private static final long serialVersionUID = 0L;
26 static {
27 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
28 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
29 /* major= */ 4,
30 /* minor= */ 26,
31 /* patch= */ 1,
32 /* suffix= */ "",
33 CumulativeConstraintProto.class.getName());
34 }
35 // Use CumulativeConstraintProto.newBuilder() to construct.
36 private CumulativeConstraintProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
37 super(builder);
38 }
40 intervals_ = emptyIntList();
41 demands_ = java.util.Collections.emptyList();
42 }
43
44 public static final com.google.protobuf.Descriptors.Descriptor
46 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CumulativeConstraintProto_descriptor;
47 }
48
49 @java.lang.Override
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);
55 }
56
57 private int bitField0_;
58 public static final int CAPACITY_FIELD_NUMBER = 1;
64 @java.lang.Override
65 public boolean hasCapacity() {
66 return ((bitField0_ & 0x00000001) != 0);
67 }
72 @java.lang.Override
74 return capacity_ == null ? com.google.ortools.sat.LinearExpressionProto.getDefaultInstance() : capacity_;
75 }
79 @java.lang.Override
81 return capacity_ == null ? com.google.ortools.sat.LinearExpressionProto.getDefaultInstance() : capacity_;
82 }
83
84 public static final int INTERVALS_FIELD_NUMBER = 2;
85 @SuppressWarnings("serial")
86 private com.google.protobuf.Internal.IntList intervals_ =
87 emptyIntList();
92 @java.lang.Override
93 public java.util.List<java.lang.Integer>
95 return intervals_;
96 }
101 public int getIntervalsCount() {
102 return intervals_.size();
103 }
109 public int getIntervals(int index) {
110 return intervals_.getInt(index);
111 }
112 private int intervalsMemoizedSerializedSize = -1;
113
114 public static final int DEMANDS_FIELD_NUMBER = 3;
115 @SuppressWarnings("serial")
116 private java.util.List<com.google.ortools.sat.LinearExpressionProto> demands_;
124 @java.lang.Override
125 public java.util.List<com.google.ortools.sat.LinearExpressionProto> getDemandsList() {
126 return demands_;
127 }
135 @java.lang.Override
136 public java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder>
138 return demands_;
139 }
147 @java.lang.Override
148 public int getDemandsCount() {
149 return demands_.size();
150 }
158 @java.lang.Override
160 return demands_.get(index);
161 }
169 @java.lang.Override
171 int index) {
172 return demands_.get(index);
173 }
174
175 private byte memoizedIsInitialized = -1;
176 @java.lang.Override
177 public final boolean isInitialized() {
178 byte isInitialized = memoizedIsInitialized;
179 if (isInitialized == 1) return true;
180 if (isInitialized == 0) return false;
181
182 memoizedIsInitialized = 1;
183 return true;
184 }
185
186 @java.lang.Override
187 public void writeTo(com.google.protobuf.CodedOutputStream output)
188 throws java.io.IOException {
190 if (((bitField0_ & 0x00000001) != 0)) {
191 output.writeMessage(1, getCapacity());
192 }
193 if (getIntervalsList().size() > 0) {
194 output.writeUInt32NoTag(18);
195 output.writeUInt32NoTag(intervalsMemoizedSerializedSize);
196 }
197 for (int i = 0; i < intervals_.size(); i++) {
198 output.writeInt32NoTag(intervals_.getInt(i));
199 }
200 for (int i = 0; i < demands_.size(); i++) {
201 output.writeMessage(3, demands_.get(i));
202 }
203 getUnknownFields().writeTo(output);
204 }
205
206 @java.lang.Override
207 public int getSerializedSize() {
208 int size = memoizedSize;
209 if (size != -1) return size;
210
211 size = 0;
212 if (((bitField0_ & 0x00000001) != 0)) {
213 size += com.google.protobuf.CodedOutputStream
214 .computeMessageSize(1, getCapacity());
215 }
216 {
217 int dataSize = 0;
218 for (int i = 0; i < intervals_.size(); i++) {
219 dataSize += com.google.protobuf.CodedOutputStream
220 .computeInt32SizeNoTag(intervals_.getInt(i));
221 }
222 size += dataSize;
223 if (!getIntervalsList().isEmpty()) {
224 size += 1;
225 size += com.google.protobuf.CodedOutputStream
226 .computeInt32SizeNoTag(dataSize);
227 }
228 intervalsMemoizedSerializedSize = dataSize;
229 }
230 for (int i = 0; i < demands_.size(); i++) {
231 size += com.google.protobuf.CodedOutputStream
232 .computeMessageSize(3, demands_.get(i));
233 }
234 size += getUnknownFields().getSerializedSize();
235 memoizedSize = size;
236 return size;
237 }
238
239 @java.lang.Override
240 public boolean equals(final java.lang.Object obj) {
241 if (obj == this) {
242 return true;
243 }
244 if (!(obj instanceof com.google.ortools.sat.CumulativeConstraintProto)) {
245 return super.equals(obj);
246 }
247 com.google.ortools.sat.CumulativeConstraintProto other = (com.google.ortools.sat.CumulativeConstraintProto) obj;
248
249 if (hasCapacity() != other.hasCapacity()) return false;
250 if (hasCapacity()) {
251 if (!getCapacity()
252 .equals(other.getCapacity())) return false;
253 }
254 if (!getIntervalsList()
255 .equals(other.getIntervalsList())) return false;
256 if (!getDemandsList()
257 .equals(other.getDemandsList())) return false;
258 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
259 return true;
260 }
261
262 @java.lang.Override
263 public int hashCode() {
264 if (memoizedHashCode != 0) {
265 return memoizedHashCode;
266 }
267 int hash = 41;
268 hash = (19 * hash) + getDescriptor().hashCode();
269 if (hasCapacity()) {
270 hash = (37 * hash) + CAPACITY_FIELD_NUMBER;
271 hash = (53 * hash) + getCapacity().hashCode();
272 }
273 if (getIntervalsCount() > 0) {
274 hash = (37 * hash) + INTERVALS_FIELD_NUMBER;
275 hash = (53 * hash) + getIntervalsList().hashCode();
276 }
277 if (getDemandsCount() > 0) {
278 hash = (37 * hash) + DEMANDS_FIELD_NUMBER;
279 hash = (53 * hash) + getDemandsList().hashCode();
280 }
281 hash = (29 * hash) + getUnknownFields().hashCode();
282 memoizedHashCode = hash;
283 return hash;
284 }
285
287 java.nio.ByteBuffer data)
288 throws com.google.protobuf.InvalidProtocolBufferException {
289 return PARSER.parseFrom(data);
290 }
292 java.nio.ByteBuffer data,
293 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
294 throws com.google.protobuf.InvalidProtocolBufferException {
295 return PARSER.parseFrom(data, extensionRegistry);
296 }
298 com.google.protobuf.ByteString data)
299 throws com.google.protobuf.InvalidProtocolBufferException {
300 return PARSER.parseFrom(data);
301 }
303 com.google.protobuf.ByteString data,
304 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
305 throws com.google.protobuf.InvalidProtocolBufferException {
306 return PARSER.parseFrom(data, extensionRegistry);
307 }
309 throws com.google.protobuf.InvalidProtocolBufferException {
310 return PARSER.parseFrom(data);
311 }
313 byte[] data,
314 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
315 throws com.google.protobuf.InvalidProtocolBufferException {
316 return PARSER.parseFrom(data, extensionRegistry);
317 }
318 public static com.google.ortools.sat.CumulativeConstraintProto parseFrom(java.io.InputStream input)
319 throws java.io.IOException {
320 return com.google.protobuf.GeneratedMessage
321 .parseWithIOException(PARSER, input);
322 }
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);
329 }
330
332 throws java.io.IOException {
333 return com.google.protobuf.GeneratedMessage
334 .parseDelimitedWithIOException(PARSER, input);
335 }
336
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);
343 }
345 com.google.protobuf.CodedInputStream input)
346 throws java.io.IOException {
347 return com.google.protobuf.GeneratedMessage
348 .parseWithIOException(PARSER, input);
349 }
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);
356 }
357
358 @java.lang.Override
359 public Builder newBuilderForType() { return newBuilder(); }
360 public static Builder newBuilder() {
361 return DEFAULT_INSTANCE.toBuilder();
362 }
363 public static Builder newBuilder(com.google.ortools.sat.CumulativeConstraintProto prototype) {
364 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
365 }
366 @java.lang.Override
368 return this == DEFAULT_INSTANCE
369 ? new Builder() : new Builder().mergeFrom(this);
370 }
371
372 @java.lang.Override
374 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
375 Builder builder = new Builder(parent);
376 return builder;
377 }
392 public static final class Builder extends
393 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
394 // @@protoc_insertion_point(builder_implements:operations_research.sat.CumulativeConstraintProto)
395 com.google.ortools.sat.CumulativeConstraintProtoOrBuilder {
396 public static final com.google.protobuf.Descriptors.Descriptor
398 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CumulativeConstraintProto_descriptor;
399 }
400
401 @java.lang.Override
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);
407 }
408
409 // Construct using com.google.ortools.sat.CumulativeConstraintProto.newBuilder()
410 private Builder() {
411 maybeForceBuilderInitialization();
412 }
413
414 private Builder(
415 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
416 super(parent);
417 maybeForceBuilderInitialization();
418 }
419 private void maybeForceBuilderInitialization() {
420 if (com.google.protobuf.GeneratedMessage
421 .alwaysUseFieldBuilders) {
422 getCapacityFieldBuilder();
423 getDemandsFieldBuilder();
424 }
425 }
426 @java.lang.Override
427 public Builder clear() {
428 super.clear();
429 bitField0_ = 0;
430 capacity_ = null;
431 if (capacityBuilder_ != null) {
432 capacityBuilder_.dispose();
433 capacityBuilder_ = null;
434 }
435 intervals_ = emptyIntList();
436 if (demandsBuilder_ == null) {
437 demands_ = java.util.Collections.emptyList();
438 } else {
439 demands_ = null;
440 demandsBuilder_.clear();
441 }
442 bitField0_ = (bitField0_ & ~0x00000004);
443 return this;
444 }
445
446 @java.lang.Override
447 public com.google.protobuf.Descriptors.Descriptor
449 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_CumulativeConstraintProto_descriptor;
450 }
451
452 @java.lang.Override
454 return com.google.ortools.sat.CumulativeConstraintProto.getDefaultInstance();
455 }
456
457 @java.lang.Override
460 if (!result.isInitialized()) {
461 throw newUninitializedMessageException(result);
462 }
463 return result;
464 }
465
466 @java.lang.Override
468 com.google.ortools.sat.CumulativeConstraintProto result = new com.google.ortools.sat.CumulativeConstraintProto(this);
469 buildPartialRepeatedFields(result);
470 if (bitField0_ != 0) { buildPartial0(result); }
471 onBuilt();
472 return result;
473 }
474
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);
480 }
481 result.demands_ = demands_;
482 } else {
483 result.demands_ = demandsBuilder_.build();
484 }
485 }
486
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
492 ? capacity_
493 : capacityBuilder_.build();
494 to_bitField0_ |= 0x00000001;
495 }
496 if (((from_bitField0_ & 0x00000002) != 0)) {
497 intervals_.makeImmutable();
498 result.intervals_ = intervals_;
499 }
500 result.bitField0_ |= to_bitField0_;
501 }
502
503 @java.lang.Override
504 public Builder mergeFrom(com.google.protobuf.Message other) {
505 if (other instanceof com.google.ortools.sat.CumulativeConstraintProto) {
506 return mergeFrom((com.google.ortools.sat.CumulativeConstraintProto)other);
507 } else {
508 super.mergeFrom(other);
509 return this;
510 }
511 }
512
513 public Builder mergeFrom(com.google.ortools.sat.CumulativeConstraintProto other) {
514 if (other == com.google.ortools.sat.CumulativeConstraintProto.getDefaultInstance()) return this;
515 if (other.hasCapacity()) {
516 mergeCapacity(other.getCapacity());
517 }
518 if (!other.intervals_.isEmpty()) {
519 if (intervals_.isEmpty()) {
520 intervals_ = other.intervals_;
521 intervals_.makeImmutable();
522 bitField0_ |= 0x00000002;
523 } else {
524 ensureIntervalsIsMutable();
525 intervals_.addAll(other.intervals_);
526 }
527 onChanged();
528 }
529 if (demandsBuilder_ == null) {
530 if (!other.demands_.isEmpty()) {
531 if (demands_.isEmpty()) {
532 demands_ = other.demands_;
533 bitField0_ = (bitField0_ & ~0x00000004);
534 } else {
535 ensureDemandsIsMutable();
536 demands_.addAll(other.demands_);
537 }
538 onChanged();
539 }
540 } else {
541 if (!other.demands_.isEmpty()) {
542 if (demandsBuilder_.isEmpty()) {
543 demandsBuilder_.dispose();
544 demandsBuilder_ = null;
545 demands_ = other.demands_;
546 bitField0_ = (bitField0_ & ~0x00000004);
547 demandsBuilder_ =
548 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
549 getDemandsFieldBuilder() : null;
550 } else {
551 demandsBuilder_.addAllMessages(other.demands_);
552 }
553 }
554 }
555 this.mergeUnknownFields(other.getUnknownFields());
556 onChanged();
557 return this;
558 }
559
560 @java.lang.Override
561 public final boolean isInitialized() {
562 return true;
563 }
564
565 @java.lang.Override
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();
572 }
573 try {
574 boolean done = false;
575 while (!done) {
576 int tag = input.readTag();
577 switch (tag) {
578 case 0:
579 done = true;
580 break;
581 case 10: {
582 input.readMessage(
583 getCapacityFieldBuilder().getBuilder(),
584 extensionRegistry);
585 bitField0_ |= 0x00000001;
586 break;
587 } // case 10
588 case 16: {
589 int v = input.readInt32();
590 ensureIntervalsIsMutable();
591 intervals_.addInt(v);
592 break;
593 } // case 16
594 case 18: {
595 int length = input.readRawVarint32();
596 int limit = input.pushLimit(length);
597 ensureIntervalsIsMutable();
598 while (input.getBytesUntilLimit() > 0) {
599 intervals_.addInt(input.readInt32());
600 }
601 input.popLimit(limit);
602 break;
603 } // case 18
604 case 26: {
606 input.readMessage(
607 com.google.ortools.sat.LinearExpressionProto.parser(),
608 extensionRegistry);
609 if (demandsBuilder_ == null) {
610 ensureDemandsIsMutable();
611 demands_.add(m);
612 } else {
613 demandsBuilder_.addMessage(m);
614 }
615 break;
616 } // case 26
617 default: {
618 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
619 done = true; // was an endgroup tag
620 }
621 break;
622 } // default:
623 } // switch (tag)
624 } // while (!done)
625 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
626 throw e.unwrapIOException();
627 } finally {
628 onChanged();
629 } // finally
630 return this;
631 }
632 private int bitField0_;
633
635 private com.google.protobuf.SingleFieldBuilder<
636 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder> capacityBuilder_;
641 public boolean hasCapacity() {
642 return ((bitField0_ & 0x00000001) != 0);
643 }
649 if (capacityBuilder_ == null) {
650 return capacity_ == null ? com.google.ortools.sat.LinearExpressionProto.getDefaultInstance() : capacity_;
651 } else {
652 return capacityBuilder_.getMessage();
653 }
654 }
658 public Builder setCapacity(com.google.ortools.sat.LinearExpressionProto value) {
659 if (capacityBuilder_ == null) {
660 if (value == null) {
661 throw new NullPointerException();
662 }
663 capacity_ = value;
664 } else {
665 capacityBuilder_.setMessage(value);
666 }
667 bitField0_ |= 0x00000001;
668 onChanged();
669 return this;
670 }
675 com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
676 if (capacityBuilder_ == null) {
677 capacity_ = builderForValue.build();
678 } else {
679 capacityBuilder_.setMessage(builderForValue.build());
680 }
681 bitField0_ |= 0x00000001;
682 onChanged();
683 return this;
684 }
688 public Builder mergeCapacity(com.google.ortools.sat.LinearExpressionProto value) {
689 if (capacityBuilder_ == null) {
690 if (((bitField0_ & 0x00000001) != 0) &&
691 capacity_ != null &&
692 capacity_ != com.google.ortools.sat.LinearExpressionProto.getDefaultInstance()) {
693 getCapacityBuilder().mergeFrom(value);
694 } else {
695 capacity_ = value;
696 }
697 } else {
698 capacityBuilder_.mergeFrom(value);
699 }
700 if (capacity_ != null) {
701 bitField0_ |= 0x00000001;
702 onChanged();
703 }
704 return this;
705 }
710 bitField0_ = (bitField0_ & ~0x00000001);
711 capacity_ = null;
712 if (capacityBuilder_ != null) {
713 capacityBuilder_.dispose();
714 capacityBuilder_ = null;
715 }
716 onChanged();
717 return this;
718 }
723 bitField0_ |= 0x00000001;
724 onChanged();
725 return getCapacityFieldBuilder().getBuilder();
726 }
731 if (capacityBuilder_ != null) {
732 return capacityBuilder_.getMessageOrBuilder();
733 } else {
734 return capacity_ == null ?
735 com.google.ortools.sat.LinearExpressionProto.getDefaultInstance() : capacity_;
736 }
737 }
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>(
747 getCapacity(),
748 getParentForChildren(),
749 isClean());
750 capacity_ = null;
751 }
752 return capacityBuilder_;
753 }
754
755 private com.google.protobuf.Internal.IntList intervals_ = emptyIntList();
756 private void ensureIntervalsIsMutable() {
757 if (!intervals_.isModifiable()) {
758 intervals_ = makeMutableCopy(intervals_);
759 }
760 bitField0_ |= 0x00000002;
761 }
766 public java.util.List<java.lang.Integer>
768 intervals_.makeImmutable();
769 return intervals_;
770 }
775 public int getIntervalsCount() {
776 return intervals_.size();
777 }
783 public int getIntervals(int index) {
784 return intervals_.getInt(index);
785 }
793 int index, int value) {
794
795 ensureIntervalsIsMutable();
796 intervals_.setInt(index, value);
797 bitField0_ |= 0x00000002;
798 onChanged();
799 return this;
800 }
806 public Builder addIntervals(int value) {
807
808 ensureIntervalsIsMutable();
809 intervals_.addInt(value);
810 bitField0_ |= 0x00000002;
811 onChanged();
812 return this;
813 }
820 java.lang.Iterable<? extends java.lang.Integer> values) {
821 ensureIntervalsIsMutable();
822 com.google.protobuf.AbstractMessageLite.Builder.addAll(
823 values, intervals_);
824 bitField0_ |= 0x00000002;
825 onChanged();
826 return this;
827 }
833 intervals_ = emptyIntList();
834 bitField0_ = (bitField0_ & ~0x00000002);
835 onChanged();
836 return this;
837 }
838
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;
845 }
846 }
847
848 private com.google.protobuf.RepeatedFieldBuilder<
849 com.google.ortools.sat.LinearExpressionProto, com.google.ortools.sat.LinearExpressionProto.Builder, com.google.ortools.sat.LinearExpressionProtoOrBuilder> demandsBuilder_;
850
858 public java.util.List<com.google.ortools.sat.LinearExpressionProto> getDemandsList() {
859 if (demandsBuilder_ == null) {
860 return java.util.Collections.unmodifiableList(demands_);
861 } else {
862 return demandsBuilder_.getMessageList();
863 }
864 }
872 public int getDemandsCount() {
873 if (demandsBuilder_ == null) {
874 return demands_.size();
875 } else {
876 return demandsBuilder_.getCount();
877 }
878 }
887 if (demandsBuilder_ == null) {
888 return demands_.get(index);
889 } else {
890 return demandsBuilder_.getMessage(index);
891 }
892 }
901 int index, com.google.ortools.sat.LinearExpressionProto value) {
902 if (demandsBuilder_ == null) {
903 if (value == null) {
904 throw new NullPointerException();
905 }
906 ensureDemandsIsMutable();
907 demands_.set(index, value);
908 onChanged();
909 } else {
910 demandsBuilder_.setMessage(index, value);
911 }
912 return this;
913 }
922 int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
923 if (demandsBuilder_ == null) {
924 ensureDemandsIsMutable();
925 demands_.set(index, builderForValue.build());
926 onChanged();
927 } else {
928 demandsBuilder_.setMessage(index, builderForValue.build());
929 }
930 return this;
931 }
939 public Builder addDemands(com.google.ortools.sat.LinearExpressionProto value) {
940 if (demandsBuilder_ == null) {
941 if (value == null) {
942 throw new NullPointerException();
943 }
944 ensureDemandsIsMutable();
945 demands_.add(value);
946 onChanged();
947 } else {
948 demandsBuilder_.addMessage(value);
949 }
950 return this;
951 }
960 int index, com.google.ortools.sat.LinearExpressionProto value) {
961 if (demandsBuilder_ == null) {
962 if (value == null) {
963 throw new NullPointerException();
964 }
965 ensureDemandsIsMutable();
966 demands_.add(index, value);
967 onChanged();
968 } else {
969 demandsBuilder_.addMessage(index, value);
970 }
971 return this;
972 }
981 com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
982 if (demandsBuilder_ == null) {
983 ensureDemandsIsMutable();
984 demands_.add(builderForValue.build());
985 onChanged();
986 } else {
987 demandsBuilder_.addMessage(builderForValue.build());
988 }
989 return this;
990 }
999 int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue) {
1000 if (demandsBuilder_ == null) {
1001 ensureDemandsIsMutable();
1002 demands_.add(index, builderForValue.build());
1003 onChanged();
1004 } else {
1005 demandsBuilder_.addMessage(index, builderForValue.build());
1006 }
1007 return this;
1008 }
1017 java.lang.Iterable<? extends com.google.ortools.sat.LinearExpressionProto> values) {
1018 if (demandsBuilder_ == null) {
1019 ensureDemandsIsMutable();
1020 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1021 values, demands_);
1022 onChanged();
1023 } else {
1024 demandsBuilder_.addAllMessages(values);
1025 }
1026 return this;
1027 }
1036 if (demandsBuilder_ == null) {
1037 demands_ = java.util.Collections.emptyList();
1038 bitField0_ = (bitField0_ & ~0x00000004);
1039 onChanged();
1040 } else {
1041 demandsBuilder_.clear();
1042 }
1043 return this;
1044 }
1052 public Builder removeDemands(int index) {
1053 if (demandsBuilder_ == null) {
1054 ensureDemandsIsMutable();
1055 demands_.remove(index);
1056 onChanged();
1057 } else {
1058 demandsBuilder_.remove(index);
1059 }
1060 return this;
1061 }
1070 int index) {
1071 return getDemandsFieldBuilder().getBuilder(index);
1072 }
1081 int index) {
1082 if (demandsBuilder_ == null) {
1083 return demands_.get(index); } else {
1084 return demandsBuilder_.getMessageOrBuilder(index);
1085 }
1086 }
1094 public java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder>
1096 if (demandsBuilder_ != null) {
1097 return demandsBuilder_.getMessageOrBuilderList();
1098 } else {
1099 return java.util.Collections.unmodifiableList(demands_);
1100 }
1101 }
1110 return getDemandsFieldBuilder().addBuilder(
1111 com.google.ortools.sat.LinearExpressionProto.getDefaultInstance());
1112 }
1121 int index) {
1122 return getDemandsFieldBuilder().addBuilder(
1123 index, com.google.ortools.sat.LinearExpressionProto.getDefaultInstance());
1124 }
1132 public java.util.List<com.google.ortools.sat.LinearExpressionProto.Builder>
1134 return getDemandsFieldBuilder().getBuilderList();
1135 }
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>(
1142 demands_,
1143 ((bitField0_ & 0x00000004) != 0),
1144 getParentForChildren(),
1145 isClean());
1146 demands_ = null;
1147 }
1148 return demandsBuilder_;
1149 }
1150
1151 // @@protoc_insertion_point(builder_scope:operations_research.sat.CumulativeConstraintProto)
1152 }
1153
1154 // @@protoc_insertion_point(class_scope:operations_research.sat.CumulativeConstraintProto)
1155 private static final com.google.ortools.sat.CumulativeConstraintProto DEFAULT_INSTANCE;
1156 static {
1157 DEFAULT_INSTANCE = new com.google.ortools.sat.CumulativeConstraintProto();
1158 }
1159
1161 return DEFAULT_INSTANCE;
1162 }
1163
1164 private static final com.google.protobuf.Parser<CumulativeConstraintProto>
1165 PARSER = new com.google.protobuf.AbstractParser<CumulativeConstraintProto>() {
1166 @java.lang.Override
1167 public CumulativeConstraintProto parsePartialFrom(
1168 com.google.protobuf.CodedInputStream input,
1169 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1170 throws com.google.protobuf.InvalidProtocolBufferException {
1171 Builder builder = newBuilder();
1172 try {
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());
1181 }
1182 return builder.buildPartial();
1183 }
1184 };
1185
1186 public static com.google.protobuf.Parser<CumulativeConstraintProto> parser() {
1187 return PARSER;
1188 }
1189
1190 @java.lang.Override
1191 public com.google.protobuf.Parser<CumulativeConstraintProto> getParserForType() {
1192 return PARSER;
1193 }
1194
1195 @java.lang.Override
1199
1200}
1201
com.google.ortools.sat.LinearExpressionProtoOrBuilder getCapacityOrBuilder()
Builder addDemands(com.google.ortools.sat.LinearExpressionProto value)
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
com.google.ortools.sat.CumulativeConstraintProto buildPartial()
Builder setCapacity(com.google.ortools.sat.LinearExpressionProto value)
Builder mergeFrom(com.google.ortools.sat.CumulativeConstraintProto other)
com.google.ortools.sat.LinearExpressionProto.Builder addDemandsBuilder(int index)
com.google.ortools.sat.LinearExpressionProto.Builder getCapacityBuilder()
Builder addDemands(com.google.ortools.sat.LinearExpressionProto.Builder builderForValue)
com.google.ortools.sat.LinearExpressionProto.Builder addDemandsBuilder()
Builder addDemands(int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue)
com.google.ortools.sat.LinearExpressionProto getDemands(int index)
Builder mergeCapacity(com.google.ortools.sat.LinearExpressionProto value)
com.google.ortools.sat.LinearExpressionProtoOrBuilder getDemandsOrBuilder(int index)
Builder setCapacity(com.google.ortools.sat.LinearExpressionProto.Builder builderForValue)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Builder setDemands(int index, com.google.ortools.sat.LinearExpressionProto.Builder builderForValue)
java.util.List< com.google.ortools.sat.LinearExpressionProto > getDemandsList()
com.google.ortools.sat.LinearExpressionProto.Builder getDemandsBuilder(int index)
com.google.ortools.sat.LinearExpressionProto getCapacity()
java.util.List< com.google.ortools.sat.LinearExpressionProto.Builder > getDemandsBuilderList()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder > getDemandsOrBuilderList()
Builder addAllDemands(java.lang.Iterable<? extends com.google.ortools.sat.LinearExpressionProto > values)
Builder setDemands(int index, com.google.ortools.sat.LinearExpressionProto value)
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder addDemands(int index, com.google.ortools.sat.LinearExpressionProto value)
com.google.ortools.sat.CumulativeConstraintProto build()
Builder addAllIntervals(java.lang.Iterable<? extends java.lang.Integer > values)
com.google.ortools.sat.CumulativeConstraintProto getDefaultInstanceForType()
static com.google.ortools.sat.CumulativeConstraintProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.CumulativeConstraintProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.sat.LinearExpressionProtoOrBuilder getDemandsOrBuilder(int index)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
java.util.List< com.google.ortools.sat.LinearExpressionProto > getDemandsList()
static com.google.protobuf.Parser< CumulativeConstraintProto > parser()
com.google.ortools.sat.CumulativeConstraintProto getDefaultInstanceForType()
com.google.ortools.sat.LinearExpressionProto getCapacity()
static com.google.ortools.sat.CumulativeConstraintProto parseFrom(byte[] data)
void writeTo(com.google.protobuf.CodedOutputStream output)
static com.google.ortools.sat.CumulativeConstraintProto parseFrom(com.google.protobuf.ByteString data)
static com.google.ortools.sat.CumulativeConstraintProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.sat.LinearExpressionProtoOrBuilder getCapacityOrBuilder()
static com.google.ortools.sat.CumulativeConstraintProto parseDelimitedFrom(java.io.InputStream input)
static com.google.ortools.sat.CumulativeConstraintProto parseFrom(com.google.protobuf.CodedInputStream input)
static com.google.ortools.sat.CumulativeConstraintProto getDefaultInstance()
static com.google.ortools.sat.CumulativeConstraintProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.CumulativeConstraintProto parseFrom(java.io.InputStream input)
java.util.List<? extends com.google.ortools.sat.LinearExpressionProtoOrBuilder > getDemandsOrBuilderList()
static com.google.ortools.sat.CumulativeConstraintProto parseFrom(java.nio.ByteBuffer data)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
com.google.ortools.sat.LinearExpressionProto getDemands(int index)
com.google.protobuf.Parser< CumulativeConstraintProto > getParserForType()
static com.google.ortools.sat.CumulativeConstraintProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
static Builder newBuilder(com.google.ortools.sat.CumulativeConstraintProto prototype)
static com.google.ortools.sat.CumulativeConstraintProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)