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