Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
FlowModelProto.java
Go to the documentation of this file.
1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// NO CHECKED-IN PROTOBUF GENCODE
3// source: ortools/graph/flow_problem.proto
4// Protobuf Java Version: 4.31.1
5
6package com.google.ortools.graph;
7
15@com.google.protobuf.Generated
16public final class FlowModelProto extends
17 com.google.protobuf.GeneratedMessage implements
18 // @@protoc_insertion_point(message_implements:operations_research.FlowModelProto)
20private static final long serialVersionUID = 0L;
21 static {
22 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
23 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
24 /* major= */ 4,
25 /* minor= */ 31,
26 /* patch= */ 1,
27 /* suffix= */ "",
28 FlowModelProto.class.getName());
29 }
30 // Use FlowModelProto.newBuilder() to construct.
31 private FlowModelProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
32 super(builder);
33 }
34 private FlowModelProto() {
35 nodes_ = java.util.Collections.emptyList();
36 arcs_ = java.util.Collections.emptyList();
37 problemType_ = 0;
38 }
39
40 public static final com.google.protobuf.Descriptors.Descriptor
42 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowModelProto_descriptor;
43 }
44
45 @java.lang.Override
46 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
48 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowModelProto_fieldAccessorTable
49 .ensureFieldAccessorsInitialized(
50 com.google.ortools.graph.FlowModelProto.class, com.google.ortools.graph.FlowModelProto.Builder.class);
51 }
52
60 public enum ProblemType
61 implements com.google.protobuf.ProtocolMessageEnum {
74 ;
75
76 static {
77 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
78 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
79 /* major= */ 4,
80 /* minor= */ 31,
81 /* patch= */ 1,
82 /* suffix= */ "",
83 ProblemType.class.getName());
84 }
88 public static final int LINEAR_SUM_ASSIGNMENT_VALUE = 0;
92 public static final int MAX_FLOW_VALUE = 1;
96 public static final int MIN_COST_FLOW_VALUE = 2;
97
98
99 public final int getNumber() {
100 return value;
101 }
102
108 @java.lang.Deprecated
109 public static ProblemType valueOf(int value) {
110 return forNumber(value);
111 }
112
117 public static ProblemType forNumber(int value) {
118 switch (value) {
119 case 0: return LINEAR_SUM_ASSIGNMENT;
120 case 1: return MAX_FLOW;
121 case 2: return MIN_COST_FLOW;
122 default: return null;
123 }
124 }
125
126 public static com.google.protobuf.Internal.EnumLiteMap<ProblemType>
128 return internalValueMap;
129 }
130 private static final com.google.protobuf.Internal.EnumLiteMap<
131 ProblemType> internalValueMap =
132 new com.google.protobuf.Internal.EnumLiteMap<ProblemType>() {
133 public ProblemType findValueByNumber(int number) {
134 return ProblemType.forNumber(number);
135 }
136 };
137
138 public final com.google.protobuf.Descriptors.EnumValueDescriptor
140 return getDescriptor().getValues().get(ordinal());
141 }
142 public final com.google.protobuf.Descriptors.EnumDescriptor
144 return getDescriptor();
145 }
146 public static com.google.protobuf.Descriptors.EnumDescriptor
148 return com.google.ortools.graph.FlowModelProto.getDescriptor().getEnumTypes().get(0);
149 }
150
151 private static final ProblemType[] VALUES = values();
152
153 public static ProblemType valueOf(
154 com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
155 if (desc.getType() != getDescriptor()) {
156 throw new java.lang.IllegalArgumentException(
157 "EnumValueDescriptor is not for this type.");
158 }
159 return VALUES[desc.getIndex()];
160 }
161
162 private final int value;
163
164 private ProblemType(int value) {
165 this.value = value;
166 }
167
168 // @@protoc_insertion_point(enum_scope:operations_research.FlowModelProto.ProblemType)
169 }
170
171 private int bitField0_;
172 public static final int NODES_FIELD_NUMBER = 1;
173 @SuppressWarnings("serial")
174 private java.util.List<com.google.ortools.graph.FlowNodeProto> nodes_;
178 @java.lang.Override
179 public java.util.List<com.google.ortools.graph.FlowNodeProto> getNodesList() {
180 return nodes_;
181 }
182
185 @java.lang.Override
186 public java.util.List<? extends com.google.ortools.graph.FlowNodeProtoOrBuilder>
188 return nodes_;
189 }
190
193 @java.lang.Override
194 public int getNodesCount() {
195 return nodes_.size();
196 }
197
200 @java.lang.Override
202 return nodes_.get(index);
203 }
204
207 @java.lang.Override
209 int index) {
210 return nodes_.get(index);
211 }
212
213 public static final int ARCS_FIELD_NUMBER = 2;
214 @SuppressWarnings("serial")
215 private java.util.List<com.google.ortools.graph.FlowArcProto> arcs_;
219 @java.lang.Override
220 public java.util.List<com.google.ortools.graph.FlowArcProto> getArcsList() {
221 return arcs_;
222 }
223
226 @java.lang.Override
227 public java.util.List<? extends com.google.ortools.graph.FlowArcProtoOrBuilder>
229 return arcs_;
230 }
231
234 @java.lang.Override
235 public int getArcsCount() {
236 return arcs_.size();
237 }
238
241 @java.lang.Override
243 return arcs_.get(index);
244 }
245
248 @java.lang.Override
250 int index) {
251 return arcs_.get(index);
252 }
253
254 public static final int PROBLEM_TYPE_FIELD_NUMBER = 3;
255 private int problemType_ = 0;
260 @java.lang.Override public boolean hasProblemType() {
261 return ((bitField0_ & 0x00000001) != 0);
262 }
263
268 com.google.ortools.graph.FlowModelProto.ProblemType result = com.google.ortools.graph.FlowModelProto.ProblemType.forNumber(problemType_);
270 }
271
272 private byte memoizedIsInitialized = -1;
273 @java.lang.Override
274 public final boolean isInitialized() {
275 byte isInitialized = memoizedIsInitialized;
276 if (isInitialized == 1) return true;
277 if (isInitialized == 0) return false;
278
279 memoizedIsInitialized = 1;
280 return true;
281 }
282
283 @java.lang.Override
284 public void writeTo(com.google.protobuf.CodedOutputStream output)
285 throws java.io.IOException {
286 for (int i = 0; i < nodes_.size(); i++) {
287 output.writeMessage(1, nodes_.get(i));
288 }
289 for (int i = 0; i < arcs_.size(); i++) {
290 output.writeMessage(2, arcs_.get(i));
291 }
292 if (((bitField0_ & 0x00000001) != 0)) {
293 output.writeEnum(3, problemType_);
294 }
295 getUnknownFields().writeTo(output);
296 }
297
298 @java.lang.Override
299 public int getSerializedSize() {
300 int size = memoizedSize;
301 if (size != -1) return size;
302
303 size = 0;
304 for (int i = 0; i < nodes_.size(); i++) {
305 size += com.google.protobuf.CodedOutputStream
306 .computeMessageSize(1, nodes_.get(i));
307 }
308 for (int i = 0; i < arcs_.size(); i++) {
309 size += com.google.protobuf.CodedOutputStream
310 .computeMessageSize(2, arcs_.get(i));
311 }
312 if (((bitField0_ & 0x00000001) != 0)) {
313 size += com.google.protobuf.CodedOutputStream
314 .computeEnumSize(3, problemType_);
315 }
316 size += getUnknownFields().getSerializedSize();
317 memoizedSize = size;
318 return size;
319 }
320
321 @java.lang.Override
322 public boolean equals(final java.lang.Object obj) {
323 if (obj == this) {
324 return true;
325 }
326 if (!(obj instanceof com.google.ortools.graph.FlowModelProto)) {
327 return super.equals(obj);
328 }
329 com.google.ortools.graph.FlowModelProto other = (com.google.ortools.graph.FlowModelProto) obj;
330
331 if (!getNodesList()
332 .equals(other.getNodesList())) return false;
333 if (!getArcsList()
334 .equals(other.getArcsList())) return false;
335 if (hasProblemType() != other.hasProblemType()) return false;
336 if (hasProblemType()) {
337 if (problemType_ != other.problemType_) return false;
338 }
339 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
340 return true;
341 }
342
343 @java.lang.Override
344 public int hashCode() {
345 if (memoizedHashCode != 0) {
346 return memoizedHashCode;
347 }
348 int hash = 41;
349 hash = (19 * hash) + getDescriptor().hashCode();
350 if (getNodesCount() > 0) {
351 hash = (37 * hash) + NODES_FIELD_NUMBER;
352 hash = (53 * hash) + getNodesList().hashCode();
353 }
354 if (getArcsCount() > 0) {
355 hash = (37 * hash) + ARCS_FIELD_NUMBER;
356 hash = (53 * hash) + getArcsList().hashCode();
357 }
358 if (hasProblemType()) {
359 hash = (37 * hash) + PROBLEM_TYPE_FIELD_NUMBER;
360 hash = (53 * hash) + problemType_;
361 }
362 hash = (29 * hash) + getUnknownFields().hashCode();
363 memoizedHashCode = hash;
364 return hash;
365 }
366
368 java.nio.ByteBuffer data)
369 throws com.google.protobuf.InvalidProtocolBufferException {
370 return PARSER.parseFrom(data);
371 }
373 java.nio.ByteBuffer data,
374 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
375 throws com.google.protobuf.InvalidProtocolBufferException {
376 return PARSER.parseFrom(data, extensionRegistry);
377 }
379 com.google.protobuf.ByteString data)
380 throws com.google.protobuf.InvalidProtocolBufferException {
381 return PARSER.parseFrom(data);
382 }
384 com.google.protobuf.ByteString data,
385 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
386 throws com.google.protobuf.InvalidProtocolBufferException {
387 return PARSER.parseFrom(data, extensionRegistry);
388 }
390 throws com.google.protobuf.InvalidProtocolBufferException {
391 return PARSER.parseFrom(data);
392 }
394 byte[] data,
395 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
396 throws com.google.protobuf.InvalidProtocolBufferException {
397 return PARSER.parseFrom(data, extensionRegistry);
398 }
399 public static com.google.ortools.graph.FlowModelProto parseFrom(java.io.InputStream input)
400 throws java.io.IOException {
401 return com.google.protobuf.GeneratedMessage
402 .parseWithIOException(PARSER, input);
403 }
405 java.io.InputStream input,
406 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
407 throws java.io.IOException {
408 return com.google.protobuf.GeneratedMessage
409 .parseWithIOException(PARSER, input, extensionRegistry);
410 }
411
412 public static com.google.ortools.graph.FlowModelProto parseDelimitedFrom(java.io.InputStream input)
413 throws java.io.IOException {
414 return com.google.protobuf.GeneratedMessage
415 .parseDelimitedWithIOException(PARSER, input);
416 }
417
419 java.io.InputStream input,
420 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
421 throws java.io.IOException {
422 return com.google.protobuf.GeneratedMessage
423 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
424 }
426 com.google.protobuf.CodedInputStream input)
427 throws java.io.IOException {
428 return com.google.protobuf.GeneratedMessage
429 .parseWithIOException(PARSER, input);
430 }
432 com.google.protobuf.CodedInputStream input,
433 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
434 throws java.io.IOException {
435 return com.google.protobuf.GeneratedMessage
436 .parseWithIOException(PARSER, input, extensionRegistry);
437 }
438
439 @java.lang.Override
440 public Builder newBuilderForType() { return newBuilder(); }
441 public static Builder newBuilder() {
442 return DEFAULT_INSTANCE.toBuilder();
443 }
444 public static Builder newBuilder(com.google.ortools.graph.FlowModelProto prototype) {
445 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
446 }
447 @java.lang.Override
449 return this == DEFAULT_INSTANCE
450 ? new Builder() : new Builder().mergeFrom(this);
451 }
452
453 @java.lang.Override
455 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
456 Builder builder = new Builder(parent);
457 return builder;
458 }
459
466 public static final class Builder extends
467 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
468 // @@protoc_insertion_point(builder_implements:operations_research.FlowModelProto)
470 public static final com.google.protobuf.Descriptors.Descriptor
472 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowModelProto_descriptor;
473 }
474
475 @java.lang.Override
476 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
478 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowModelProto_fieldAccessorTable
479 .ensureFieldAccessorsInitialized(
480 com.google.ortools.graph.FlowModelProto.class, com.google.ortools.graph.FlowModelProto.Builder.class);
481 }
482
483 // Construct using com.google.ortools.graph.FlowModelProto.newBuilder()
484 private Builder() {
485
486 }
487
488 private Builder(
489 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
490 super(parent);
491
492 }
493 @java.lang.Override
494 public Builder clear() {
495 super.clear();
496 bitField0_ = 0;
497 if (nodesBuilder_ == null) {
498 nodes_ = java.util.Collections.emptyList();
499 } else {
500 nodes_ = null;
501 nodesBuilder_.clear();
502 }
503 bitField0_ = (bitField0_ & ~0x00000001);
504 if (arcsBuilder_ == null) {
505 arcs_ = java.util.Collections.emptyList();
506 } else {
507 arcs_ = null;
508 arcsBuilder_.clear();
509 }
510 bitField0_ = (bitField0_ & ~0x00000002);
511 problemType_ = 0;
512 return this;
513 }
514
515 @java.lang.Override
516 public com.google.protobuf.Descriptors.Descriptor
518 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowModelProto_descriptor;
519 }
520
521 @java.lang.Override
523 return com.google.ortools.graph.FlowModelProto.getDefaultInstance();
524 }
525
526 @java.lang.Override
529 if (!result.isInitialized()) {
530 throw newUninitializedMessageException(result);
531 }
532 return result;
533 }
534
535 @java.lang.Override
537 com.google.ortools.graph.FlowModelProto result = new com.google.ortools.graph.FlowModelProto(this);
538 buildPartialRepeatedFields(result);
539 if (bitField0_ != 0) { buildPartial0(result); }
540 onBuilt();
541 return result;
542 }
543
544 private void buildPartialRepeatedFields(com.google.ortools.graph.FlowModelProto result) {
545 if (nodesBuilder_ == null) {
546 if (((bitField0_ & 0x00000001) != 0)) {
547 nodes_ = java.util.Collections.unmodifiableList(nodes_);
548 bitField0_ = (bitField0_ & ~0x00000001);
549 }
550 result.nodes_ = nodes_;
551 } else {
552 result.nodes_ = nodesBuilder_.build();
553 }
554 if (arcsBuilder_ == null) {
555 if (((bitField0_ & 0x00000002) != 0)) {
556 arcs_ = java.util.Collections.unmodifiableList(arcs_);
557 bitField0_ = (bitField0_ & ~0x00000002);
558 }
559 result.arcs_ = arcs_;
560 } else {
561 result.arcs_ = arcsBuilder_.build();
562 }
563 }
564
565 private void buildPartial0(com.google.ortools.graph.FlowModelProto result) {
566 int from_bitField0_ = bitField0_;
567 int to_bitField0_ = 0;
568 if (((from_bitField0_ & 0x00000004) != 0)) {
569 result.problemType_ = problemType_;
570 to_bitField0_ |= 0x00000001;
571 }
572 result.bitField0_ |= to_bitField0_;
573 }
574
575 @java.lang.Override
576 public Builder mergeFrom(com.google.protobuf.Message other) {
577 if (other instanceof com.google.ortools.graph.FlowModelProto) {
578 return mergeFrom((com.google.ortools.graph.FlowModelProto)other);
579 } else {
580 super.mergeFrom(other);
581 return this;
582 }
583 }
584
585 public Builder mergeFrom(com.google.ortools.graph.FlowModelProto other) {
586 if (other == com.google.ortools.graph.FlowModelProto.getDefaultInstance()) return this;
587 if (nodesBuilder_ == null) {
588 if (!other.nodes_.isEmpty()) {
589 if (nodes_.isEmpty()) {
590 nodes_ = other.nodes_;
591 bitField0_ = (bitField0_ & ~0x00000001);
592 } else {
593 ensureNodesIsMutable();
594 nodes_.addAll(other.nodes_);
595 }
596 onChanged();
597 }
598 } else {
599 if (!other.nodes_.isEmpty()) {
600 if (nodesBuilder_.isEmpty()) {
601 nodesBuilder_.dispose();
602 nodesBuilder_ = null;
603 nodes_ = other.nodes_;
604 bitField0_ = (bitField0_ & ~0x00000001);
605 nodesBuilder_ =
606 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
607 internalGetNodesFieldBuilder() : null;
608 } else {
609 nodesBuilder_.addAllMessages(other.nodes_);
610 }
611 }
612 }
613 if (arcsBuilder_ == null) {
614 if (!other.arcs_.isEmpty()) {
615 if (arcs_.isEmpty()) {
616 arcs_ = other.arcs_;
617 bitField0_ = (bitField0_ & ~0x00000002);
618 } else {
619 ensureArcsIsMutable();
620 arcs_.addAll(other.arcs_);
621 }
622 onChanged();
623 }
624 } else {
625 if (!other.arcs_.isEmpty()) {
626 if (arcsBuilder_.isEmpty()) {
627 arcsBuilder_.dispose();
628 arcsBuilder_ = null;
629 arcs_ = other.arcs_;
630 bitField0_ = (bitField0_ & ~0x00000002);
631 arcsBuilder_ =
632 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
633 internalGetArcsFieldBuilder() : null;
634 } else {
635 arcsBuilder_.addAllMessages(other.arcs_);
636 }
637 }
638 }
639 if (other.hasProblemType()) {
640 setProblemType(other.getProblemType());
641 }
642 this.mergeUnknownFields(other.getUnknownFields());
643 onChanged();
644 return this;
645 }
646
647 @java.lang.Override
648 public final boolean isInitialized() {
649 return true;
650 }
651
652 @java.lang.Override
653 public Builder mergeFrom(
654 com.google.protobuf.CodedInputStream input,
655 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
656 throws java.io.IOException {
657 if (extensionRegistry == null) {
658 throw new java.lang.NullPointerException();
659 }
660 try {
661 boolean done = false;
662 while (!done) {
663 int tag = input.readTag();
664 switch (tag) {
665 case 0:
666 done = true;
667 break;
668 case 10: {
670 input.readMessage(
671 com.google.ortools.graph.FlowNodeProto.parser(),
672 extensionRegistry);
673 if (nodesBuilder_ == null) {
674 ensureNodesIsMutable();
675 nodes_.add(m);
676 } else {
677 nodesBuilder_.addMessage(m);
678 }
679 break;
680 } // case 10
681 case 18: {
683 input.readMessage(
684 com.google.ortools.graph.FlowArcProto.parser(),
685 extensionRegistry);
686 if (arcsBuilder_ == null) {
687 ensureArcsIsMutable();
688 arcs_.add(m);
689 } else {
690 arcsBuilder_.addMessage(m);
691 }
692 break;
693 } // case 18
694 case 24: {
695 int tmpRaw = input.readEnum();
697 com.google.ortools.graph.FlowModelProto.ProblemType.forNumber(tmpRaw);
698 if (tmpValue == null) {
699 mergeUnknownVarintField(3, tmpRaw);
700 } else {
701 problemType_ = tmpRaw;
702 bitField0_ |= 0x00000004;
703 }
704 break;
705 } // case 24
706 default: {
707 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
708 done = true; // was an endgroup tag
709 }
710 break;
711 } // default:
712 } // switch (tag)
713 } // while (!done)
714 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
715 throw e.unwrapIOException();
716 } finally {
717 onChanged();
718 } // finally
719 return this;
720 }
721 private int bitField0_;
722
723 private java.util.List<com.google.ortools.graph.FlowNodeProto> nodes_ =
724 java.util.Collections.emptyList();
725 private void ensureNodesIsMutable() {
726 if (!((bitField0_ & 0x00000001) != 0)) {
727 nodes_ = new java.util.ArrayList<com.google.ortools.graph.FlowNodeProto>(nodes_);
728 bitField0_ |= 0x00000001;
729 }
730 }
731
732 private com.google.protobuf.RepeatedFieldBuilder<
733 com.google.ortools.graph.FlowNodeProto, com.google.ortools.graph.FlowNodeProto.Builder, com.google.ortools.graph.FlowNodeProtoOrBuilder> nodesBuilder_;
734
738 public java.util.List<com.google.ortools.graph.FlowNodeProto> getNodesList() {
739 if (nodesBuilder_ == null) {
740 return java.util.Collections.unmodifiableList(nodes_);
741 } else {
742 return nodesBuilder_.getMessageList();
743 }
744 }
745
748 public int getNodesCount() {
749 if (nodesBuilder_ == null) {
750 return nodes_.size();
751 } else {
752 return nodesBuilder_.getCount();
753 }
754 }
755
759 if (nodesBuilder_ == null) {
760 return nodes_.get(index);
761 } else {
762 return nodesBuilder_.getMessage(index);
763 }
764 }
765
768 public Builder setNodes(
769 int index, com.google.ortools.graph.FlowNodeProto value) {
770 if (nodesBuilder_ == null) {
771 if (value == null) {
772 throw new NullPointerException();
773 }
774 ensureNodesIsMutable();
775 nodes_.set(index, value);
776 onChanged();
777 } else {
778 nodesBuilder_.setMessage(index, value);
779 }
780 return this;
781 }
782
785 public Builder setNodes(
786 int index, com.google.ortools.graph.FlowNodeProto.Builder builderForValue) {
787 if (nodesBuilder_ == null) {
788 ensureNodesIsMutable();
789 nodes_.set(index, builderForValue.build());
790 onChanged();
791 } else {
792 nodesBuilder_.setMessage(index, builderForValue.build());
793 }
794 return this;
795 }
796
799 public Builder addNodes(com.google.ortools.graph.FlowNodeProto value) {
800 if (nodesBuilder_ == null) {
801 if (value == null) {
802 throw new NullPointerException();
803 }
804 ensureNodesIsMutable();
805 nodes_.add(value);
806 onChanged();
807 } else {
808 nodesBuilder_.addMessage(value);
809 }
810 return this;
811 }
812
815 public Builder addNodes(
816 int index, com.google.ortools.graph.FlowNodeProto value) {
817 if (nodesBuilder_ == null) {
818 if (value == null) {
819 throw new NullPointerException();
820 }
821 ensureNodesIsMutable();
822 nodes_.add(index, value);
823 onChanged();
824 } else {
825 nodesBuilder_.addMessage(index, value);
826 }
827 return this;
828 }
829
832 public Builder addNodes(
833 com.google.ortools.graph.FlowNodeProto.Builder builderForValue) {
834 if (nodesBuilder_ == null) {
835 ensureNodesIsMutable();
836 nodes_.add(builderForValue.build());
837 onChanged();
838 } else {
839 nodesBuilder_.addMessage(builderForValue.build());
840 }
841 return this;
842 }
843
846 public Builder addNodes(
847 int index, com.google.ortools.graph.FlowNodeProto.Builder builderForValue) {
848 if (nodesBuilder_ == null) {
849 ensureNodesIsMutable();
850 nodes_.add(index, builderForValue.build());
851 onChanged();
852 } else {
853 nodesBuilder_.addMessage(index, builderForValue.build());
854 }
855 return this;
856 }
857
860 public Builder addAllNodes(
861 java.lang.Iterable<? extends com.google.ortools.graph.FlowNodeProto> values) {
862 if (nodesBuilder_ == null) {
863 ensureNodesIsMutable();
864 com.google.protobuf.AbstractMessageLite.Builder.addAll(
865 values, nodes_);
866 onChanged();
867 } else {
868 nodesBuilder_.addAllMessages(values);
869 }
870 return this;
871 }
872
875 public Builder clearNodes() {
876 if (nodesBuilder_ == null) {
877 nodes_ = java.util.Collections.emptyList();
878 bitField0_ = (bitField0_ & ~0x00000001);
879 onChanged();
880 } else {
881 nodesBuilder_.clear();
882 }
883 return this;
884 }
885
888 public Builder removeNodes(int index) {
889 if (nodesBuilder_ == null) {
890 ensureNodesIsMutable();
891 nodes_.remove(index);
892 onChanged();
893 } else {
894 nodesBuilder_.remove(index);
895 }
896 return this;
897 }
898
902 int index) {
903 return internalGetNodesFieldBuilder().getBuilder(index);
904 }
905
909 int index) {
910 if (nodesBuilder_ == null) {
911 return nodes_.get(index); } else {
912 return nodesBuilder_.getMessageOrBuilder(index);
913 }
914 }
915
918 public java.util.List<? extends com.google.ortools.graph.FlowNodeProtoOrBuilder>
920 if (nodesBuilder_ != null) {
921 return nodesBuilder_.getMessageOrBuilderList();
922 } else {
923 return java.util.Collections.unmodifiableList(nodes_);
924 }
925 }
926
930 return internalGetNodesFieldBuilder().addBuilder(
931 com.google.ortools.graph.FlowNodeProto.getDefaultInstance());
932 }
933
937 int index) {
938 return internalGetNodesFieldBuilder().addBuilder(
939 index, com.google.ortools.graph.FlowNodeProto.getDefaultInstance());
940 }
941
944 public java.util.List<com.google.ortools.graph.FlowNodeProto.Builder>
946 return internalGetNodesFieldBuilder().getBuilderList();
947 }
948 private com.google.protobuf.RepeatedFieldBuilder<
949 com.google.ortools.graph.FlowNodeProto, com.google.ortools.graph.FlowNodeProto.Builder, com.google.ortools.graph.FlowNodeProtoOrBuilder>
950 internalGetNodesFieldBuilder() {
951 if (nodesBuilder_ == null) {
952 nodesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
953 com.google.ortools.graph.FlowNodeProto, com.google.ortools.graph.FlowNodeProto.Builder, com.google.ortools.graph.FlowNodeProtoOrBuilder>(
954 nodes_,
955 ((bitField0_ & 0x00000001) != 0),
956 getParentForChildren(),
957 isClean());
958 nodes_ = null;
959 }
960 return nodesBuilder_;
961 }
962
963 private java.util.List<com.google.ortools.graph.FlowArcProto> arcs_ =
964 java.util.Collections.emptyList();
965 private void ensureArcsIsMutable() {
966 if (!((bitField0_ & 0x00000002) != 0)) {
967 arcs_ = new java.util.ArrayList<com.google.ortools.graph.FlowArcProto>(arcs_);
968 bitField0_ |= 0x00000002;
969 }
970 }
971
972 private com.google.protobuf.RepeatedFieldBuilder<
973 com.google.ortools.graph.FlowArcProto, com.google.ortools.graph.FlowArcProto.Builder, com.google.ortools.graph.FlowArcProtoOrBuilder> arcsBuilder_;
974
978 public java.util.List<com.google.ortools.graph.FlowArcProto> getArcsList() {
979 if (arcsBuilder_ == null) {
980 return java.util.Collections.unmodifiableList(arcs_);
981 } else {
982 return arcsBuilder_.getMessageList();
983 }
984 }
985
988 public int getArcsCount() {
989 if (arcsBuilder_ == null) {
990 return arcs_.size();
991 } else {
992 return arcsBuilder_.getCount();
993 }
994 }
995
999 if (arcsBuilder_ == null) {
1000 return arcs_.get(index);
1001 } else {
1002 return arcsBuilder_.getMessage(index);
1003 }
1004 }
1005
1008 public Builder setArcs(
1009 int index, com.google.ortools.graph.FlowArcProto value) {
1010 if (arcsBuilder_ == null) {
1011 if (value == null) {
1012 throw new NullPointerException();
1013 }
1014 ensureArcsIsMutable();
1015 arcs_.set(index, value);
1016 onChanged();
1017 } else {
1018 arcsBuilder_.setMessage(index, value);
1019 }
1020 return this;
1021 }
1022
1025 public Builder setArcs(
1026 int index, com.google.ortools.graph.FlowArcProto.Builder builderForValue) {
1027 if (arcsBuilder_ == null) {
1028 ensureArcsIsMutable();
1029 arcs_.set(index, builderForValue.build());
1030 onChanged();
1031 } else {
1032 arcsBuilder_.setMessage(index, builderForValue.build());
1033 }
1034 return this;
1035 }
1036
1039 public Builder addArcs(com.google.ortools.graph.FlowArcProto value) {
1040 if (arcsBuilder_ == null) {
1041 if (value == null) {
1042 throw new NullPointerException();
1043 }
1044 ensureArcsIsMutable();
1045 arcs_.add(value);
1046 onChanged();
1047 } else {
1048 arcsBuilder_.addMessage(value);
1049 }
1050 return this;
1051 }
1052
1055 public Builder addArcs(
1056 int index, com.google.ortools.graph.FlowArcProto value) {
1057 if (arcsBuilder_ == null) {
1058 if (value == null) {
1059 throw new NullPointerException();
1060 }
1061 ensureArcsIsMutable();
1062 arcs_.add(index, value);
1063 onChanged();
1064 } else {
1065 arcsBuilder_.addMessage(index, value);
1066 }
1067 return this;
1068 }
1069
1072 public Builder addArcs(
1073 com.google.ortools.graph.FlowArcProto.Builder builderForValue) {
1074 if (arcsBuilder_ == null) {
1075 ensureArcsIsMutable();
1076 arcs_.add(builderForValue.build());
1077 onChanged();
1078 } else {
1079 arcsBuilder_.addMessage(builderForValue.build());
1080 }
1081 return this;
1082 }
1083
1086 public Builder addArcs(
1087 int index, com.google.ortools.graph.FlowArcProto.Builder builderForValue) {
1088 if (arcsBuilder_ == null) {
1089 ensureArcsIsMutable();
1090 arcs_.add(index, builderForValue.build());
1091 onChanged();
1092 } else {
1093 arcsBuilder_.addMessage(index, builderForValue.build());
1094 }
1095 return this;
1096 }
1097
1100 public Builder addAllArcs(
1101 java.lang.Iterable<? extends com.google.ortools.graph.FlowArcProto> values) {
1102 if (arcsBuilder_ == null) {
1103 ensureArcsIsMutable();
1104 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1105 values, arcs_);
1106 onChanged();
1107 } else {
1108 arcsBuilder_.addAllMessages(values);
1109 }
1110 return this;
1111 }
1112
1115 public Builder clearArcs() {
1116 if (arcsBuilder_ == null) {
1117 arcs_ = java.util.Collections.emptyList();
1118 bitField0_ = (bitField0_ & ~0x00000002);
1119 onChanged();
1120 } else {
1121 arcsBuilder_.clear();
1122 }
1123 return this;
1124 }
1125
1128 public Builder removeArcs(int index) {
1129 if (arcsBuilder_ == null) {
1130 ensureArcsIsMutable();
1131 arcs_.remove(index);
1132 onChanged();
1133 } else {
1134 arcsBuilder_.remove(index);
1135 }
1136 return this;
1137 }
1138
1142 int index) {
1143 return internalGetArcsFieldBuilder().getBuilder(index);
1144 }
1145
1149 int index) {
1150 if (arcsBuilder_ == null) {
1151 return arcs_.get(index); } else {
1152 return arcsBuilder_.getMessageOrBuilder(index);
1153 }
1154 }
1155
1158 public java.util.List<? extends com.google.ortools.graph.FlowArcProtoOrBuilder>
1160 if (arcsBuilder_ != null) {
1161 return arcsBuilder_.getMessageOrBuilderList();
1162 } else {
1163 return java.util.Collections.unmodifiableList(arcs_);
1164 }
1165 }
1166
1170 return internalGetArcsFieldBuilder().addBuilder(
1171 com.google.ortools.graph.FlowArcProto.getDefaultInstance());
1172 }
1173
1177 int index) {
1178 return internalGetArcsFieldBuilder().addBuilder(
1179 index, com.google.ortools.graph.FlowArcProto.getDefaultInstance());
1180 }
1181
1184 public java.util.List<com.google.ortools.graph.FlowArcProto.Builder>
1186 return internalGetArcsFieldBuilder().getBuilderList();
1187 }
1188 private com.google.protobuf.RepeatedFieldBuilder<
1189 com.google.ortools.graph.FlowArcProto, com.google.ortools.graph.FlowArcProto.Builder, com.google.ortools.graph.FlowArcProtoOrBuilder>
1190 internalGetArcsFieldBuilder() {
1191 if (arcsBuilder_ == null) {
1192 arcsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
1193 com.google.ortools.graph.FlowArcProto, com.google.ortools.graph.FlowArcProto.Builder, com.google.ortools.graph.FlowArcProtoOrBuilder>(
1194 arcs_,
1195 ((bitField0_ & 0x00000002) != 0),
1196 getParentForChildren(),
1197 isClean());
1198 arcs_ = null;
1199 }
1200 return arcsBuilder_;
1201 }
1202
1203 private int problemType_ = 0;
1208 @java.lang.Override public boolean hasProblemType() {
1209 return ((bitField0_ & 0x00000004) != 0);
1210 }
1211
1215 @java.lang.Override
1217 com.google.ortools.graph.FlowModelProto.ProblemType result = com.google.ortools.graph.FlowModelProto.ProblemType.forNumber(problemType_);
1219 }
1220
1225 public Builder setProblemType(com.google.ortools.graph.FlowModelProto.ProblemType value) {
1226 if (value == null) { throw new NullPointerException(); }
1227 bitField0_ |= 0x00000004;
1228 problemType_ = value.getNumber();
1229 onChanged();
1230 return this;
1231 }
1232
1236 public Builder clearProblemType() {
1237 bitField0_ = (bitField0_ & ~0x00000004);
1238 problemType_ = 0;
1239 onChanged();
1240 return this;
1241 }
1242
1243 // @@protoc_insertion_point(builder_scope:operations_research.FlowModelProto)
1244 }
1245
1246 // @@protoc_insertion_point(class_scope:operations_research.FlowModelProto)
1247 private static final com.google.ortools.graph.FlowModelProto DEFAULT_INSTANCE;
1248 static {
1249 DEFAULT_INSTANCE = new com.google.ortools.graph.FlowModelProto();
1250 }
1251
1253 return DEFAULT_INSTANCE;
1254 }
1255
1256 private static final com.google.protobuf.Parser<FlowModelProto>
1257 PARSER = new com.google.protobuf.AbstractParser<FlowModelProto>() {
1258 @java.lang.Override
1259 public FlowModelProto parsePartialFrom(
1260 com.google.protobuf.CodedInputStream input,
1261 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1262 throws com.google.protobuf.InvalidProtocolBufferException {
1263 Builder builder = newBuilder();
1264 try {
1265 builder.mergeFrom(input, extensionRegistry);
1266 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1267 throw e.setUnfinishedMessage(builder.buildPartial());
1268 } catch (com.google.protobuf.UninitializedMessageException e) {
1269 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1270 } catch (java.io.IOException e) {
1271 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1272 .setUnfinishedMessage(builder.buildPartial());
1273 }
1274 return builder.buildPartial();
1275 }
1276 };
1277
1278 public static com.google.protobuf.Parser<FlowModelProto> parser() {
1279 return PARSER;
1280 }
1281
1282 @java.lang.Override
1283 public com.google.protobuf.Parser<FlowModelProto> getParserForType() {
1284 return PARSER;
1285 }
1286
1287 @java.lang.Override
1289 return DEFAULT_INSTANCE;
1290 }
1291
1292}
1293
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
Builder addNodes(int index, com.google.ortools.graph.FlowNodeProto.Builder builderForValue)
com.google.ortools.graph.FlowModelProto.ProblemType getProblemType()
Builder addAllArcs(java.lang.Iterable<? extends com.google.ortools.graph.FlowArcProto > values)
java.util.List< com.google.ortools.graph.FlowNodeProto > getNodesList()
java.util.List< com.google.ortools.graph.FlowArcProto.Builder > getArcsBuilderList()
java.util.List< com.google.ortools.graph.FlowArcProto > getArcsList()
com.google.ortools.graph.FlowArcProto.Builder getArcsBuilder(int index)
com.google.ortools.graph.FlowNodeProto getNodes(int index)
java.util.List<? extends com.google.ortools.graph.FlowNodeProtoOrBuilder > getNodesOrBuilderList()
com.google.ortools.graph.FlowArcProto getArcs(int index)
java.util.List<? extends com.google.ortools.graph.FlowArcProtoOrBuilder > getArcsOrBuilderList()
com.google.ortools.graph.FlowNodeProto.Builder addNodesBuilder()
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder addNodes(com.google.ortools.graph.FlowNodeProto value)
Builder mergeFrom(com.google.protobuf.Message other)
com.google.ortools.graph.FlowNodeProto.Builder addNodesBuilder(int index)
com.google.ortools.graph.FlowNodeProtoOrBuilder getNodesOrBuilder(int index)
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
Builder addArcs(int index, com.google.ortools.graph.FlowArcProto.Builder builderForValue)
Builder addArcs(com.google.ortools.graph.FlowArcProto.Builder builderForValue)
java.util.List< com.google.ortools.graph.FlowNodeProto.Builder > getNodesBuilderList()
Builder addNodes(int index, com.google.ortools.graph.FlowNodeProto value)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Builder setNodes(int index, com.google.ortools.graph.FlowNodeProto.Builder builderForValue)
Builder addNodes(com.google.ortools.graph.FlowNodeProto.Builder builderForValue)
com.google.ortools.graph.FlowArcProtoOrBuilder getArcsOrBuilder(int index)
Builder setProblemType(com.google.ortools.graph.FlowModelProto.ProblemType value)
com.google.ortools.graph.FlowNodeProto.Builder getNodesBuilder(int index)
Builder setArcs(int index, com.google.ortools.graph.FlowArcProto.Builder builderForValue)
com.google.ortools.graph.FlowModelProto buildPartial()
Builder addArcs(int index, com.google.ortools.graph.FlowArcProto value)
com.google.ortools.graph.FlowModelProto getDefaultInstanceForType()
Builder addAllNodes(java.lang.Iterable<? extends com.google.ortools.graph.FlowNodeProto > values)
com.google.ortools.graph.FlowModelProto build()
Builder addArcs(com.google.ortools.graph.FlowArcProto value)
com.google.ortools.graph.FlowArcProto.Builder addArcsBuilder(int index)
Builder setArcs(int index, com.google.ortools.graph.FlowArcProto value)
Builder mergeFrom(com.google.ortools.graph.FlowModelProto other)
Builder setNodes(int index, com.google.ortools.graph.FlowNodeProto value)
com.google.ortools.graph.FlowArcProto.Builder addArcsBuilder()
static com.google.ortools.graph.FlowModelProto parseFrom(java.nio.ByteBuffer data)
void writeTo(com.google.protobuf.CodedOutputStream output)
static com.google.ortools.graph.FlowModelProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.graph.FlowNodeProtoOrBuilder getNodesOrBuilder(int index)
static com.google.ortools.graph.FlowModelProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.graph.FlowModelProto parseFrom(java.io.InputStream input)
java.util.List< com.google.ortools.graph.FlowNodeProto > getNodesList()
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
java.util.List< com.google.ortools.graph.FlowArcProto > getArcsList()
static com.google.ortools.graph.FlowModelProto parseFrom(com.google.protobuf.CodedInputStream input)
static com.google.ortools.graph.FlowModelProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.graph.FlowArcProto getArcs(int index)
boolean equals(final java.lang.Object obj)
com.google.ortools.graph.FlowModelProto getDefaultInstanceForType()
static com.google.ortools.graph.FlowModelProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.graph.FlowNodeProto getNodes(int index)
static com.google.ortools.graph.FlowModelProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.graph.FlowModelProto parseDelimitedFrom(java.io.InputStream input)
static Builder newBuilder(com.google.ortools.graph.FlowModelProto prototype)
static com.google.ortools.graph.FlowModelProto parseFrom(byte[] data)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
com.google.ortools.graph.FlowArcProtoOrBuilder getArcsOrBuilder(int index)
static com.google.ortools.graph.FlowModelProto getDefaultInstance()
static com.google.protobuf.Parser< FlowModelProto > parser()
static com.google.ortools.graph.FlowModelProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.Parser< FlowModelProto > getParserForType()
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
java.util.List<? extends com.google.ortools.graph.FlowNodeProtoOrBuilder > getNodesOrBuilderList()
static com.google.ortools.graph.FlowModelProto parseFrom(com.google.protobuf.ByteString data)
java.util.List<? extends com.google.ortools.graph.FlowArcProtoOrBuilder > getArcsOrBuilderList()
com.google.ortools.graph.FlowModelProto.ProblemType getProblemType()
static com.google.protobuf.Descriptors.EnumDescriptor getDescriptor()
final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()
static ProblemType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)
final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()
static com.google.protobuf.Internal.EnumLiteMap< ProblemType > internalGetValueMap()