Google OR-Tools v9.11
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// source: ortools/graph/flow_problem.proto
3
4// Protobuf Java Version: 4.26.1
5package com.google.ortools.graph;
6
14public final class FlowModelProto extends
15 com.google.protobuf.GeneratedMessage implements
16 // @@protoc_insertion_point(message_implements:operations_research.FlowModelProto)
18private static final long serialVersionUID = 0L;
19 static {
20 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
21 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
22 /* major= */ 4,
23 /* minor= */ 26,
24 /* patch= */ 1,
25 /* suffix= */ "",
26 FlowModelProto.class.getName());
27 }
28 // Use FlowModelProto.newBuilder() to construct.
29 private FlowModelProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
30 super(builder);
31 }
32 private FlowModelProto() {
33 nodes_ = java.util.Collections.emptyList();
34 arcs_ = java.util.Collections.emptyList();
35 problemType_ = 0;
36 }
37
38 public static final com.google.protobuf.Descriptors.Descriptor
40 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowModelProto_descriptor;
41 }
42
43 @java.lang.Override
44 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
46 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowModelProto_fieldAccessorTable
47 .ensureFieldAccessorsInitialized(
48 com.google.ortools.graph.FlowModelProto.class, com.google.ortools.graph.FlowModelProto.Builder.class);
49 }
50
58 public enum ProblemType
59 implements com.google.protobuf.ProtocolMessageEnum {
72 ;
73
74 static {
75 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
76 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
77 /* major= */ 4,
78 /* minor= */ 26,
79 /* patch= */ 1,
80 /* suffix= */ "",
81 ProblemType.class.getName());
82 }
86 public static final int LINEAR_SUM_ASSIGNMENT_VALUE = 0;
90 public static final int MAX_FLOW_VALUE = 1;
94 public static final int MIN_COST_FLOW_VALUE = 2;
95
96
97 public final int getNumber() {
98 return value;
99 }
100
106 @java.lang.Deprecated
107 public static ProblemType valueOf(int value) {
108 return forNumber(value);
109 }
110
115 public static ProblemType forNumber(int value) {
116 switch (value) {
117 case 0: return LINEAR_SUM_ASSIGNMENT;
118 case 1: return MAX_FLOW;
119 case 2: return MIN_COST_FLOW;
120 default: return null;
121 }
122 }
123
124 public static com.google.protobuf.Internal.EnumLiteMap<ProblemType>
126 return internalValueMap;
127 }
128 private static final com.google.protobuf.Internal.EnumLiteMap<
129 ProblemType> internalValueMap =
130 new com.google.protobuf.Internal.EnumLiteMap<ProblemType>() {
131 public ProblemType findValueByNumber(int number) {
132 return ProblemType.forNumber(number);
133 }
134 };
135
136 public final com.google.protobuf.Descriptors.EnumValueDescriptor
138 return getDescriptor().getValues().get(ordinal());
139 }
140 public final com.google.protobuf.Descriptors.EnumDescriptor
142 return getDescriptor();
143 }
144 public static final com.google.protobuf.Descriptors.EnumDescriptor
146 return com.google.ortools.graph.FlowModelProto.getDescriptor().getEnumTypes().get(0);
147 }
148
149 private static final ProblemType[] VALUES = values();
150
151 public static ProblemType valueOf(
152 com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
153 if (desc.getType() != getDescriptor()) {
154 throw new java.lang.IllegalArgumentException(
155 "EnumValueDescriptor is not for this type.");
156 }
157 return VALUES[desc.getIndex()];
158 }
159
160 private final int value;
161
162 private ProblemType(int value) {
163 this.value = value;
164 }
165
166 // @@protoc_insertion_point(enum_scope:operations_research.FlowModelProto.ProblemType)
167 }
168
169 private int bitField0_;
170 public static final int NODES_FIELD_NUMBER = 1;
171 @SuppressWarnings("serial")
172 private java.util.List<com.google.ortools.graph.FlowNodeProto> nodes_;
176 @java.lang.Override
177 public java.util.List<com.google.ortools.graph.FlowNodeProto> getNodesList() {
178 return nodes_;
179 }
183 @java.lang.Override
184 public java.util.List<? extends com.google.ortools.graph.FlowNodeProtoOrBuilder>
186 return nodes_;
187 }
191 @java.lang.Override
192 public int getNodesCount() {
193 return nodes_.size();
194 }
198 @java.lang.Override
200 return nodes_.get(index);
201 }
205 @java.lang.Override
207 int index) {
208 return nodes_.get(index);
209 }
210
211 public static final int ARCS_FIELD_NUMBER = 2;
212 @SuppressWarnings("serial")
213 private java.util.List<com.google.ortools.graph.FlowArcProto> arcs_;
217 @java.lang.Override
218 public java.util.List<com.google.ortools.graph.FlowArcProto> getArcsList() {
219 return arcs_;
220 }
224 @java.lang.Override
225 public java.util.List<? extends com.google.ortools.graph.FlowArcProtoOrBuilder>
227 return arcs_;
228 }
232 @java.lang.Override
233 public int getArcsCount() {
234 return arcs_.size();
235 }
239 @java.lang.Override
241 return arcs_.get(index);
242 }
246 @java.lang.Override
248 int index) {
249 return arcs_.get(index);
250 }
251
252 public static final int PROBLEM_TYPE_FIELD_NUMBER = 3;
253 private int problemType_ = 0;
258 @java.lang.Override public boolean hasProblemType() {
259 return ((bitField0_ & 0x00000001) != 0);
260 }
266 com.google.ortools.graph.FlowModelProto.ProblemType result = com.google.ortools.graph.FlowModelProto.ProblemType.forNumber(problemType_);
267 return result == null ? com.google.ortools.graph.FlowModelProto.ProblemType.LINEAR_SUM_ASSIGNMENT : result;
268 }
269
270 private byte memoizedIsInitialized = -1;
271 @java.lang.Override
272 public final boolean isInitialized() {
273 byte isInitialized = memoizedIsInitialized;
274 if (isInitialized == 1) return true;
275 if (isInitialized == 0) return false;
276
277 memoizedIsInitialized = 1;
278 return true;
279 }
280
281 @java.lang.Override
282 public void writeTo(com.google.protobuf.CodedOutputStream output)
283 throws java.io.IOException {
284 for (int i = 0; i < nodes_.size(); i++) {
285 output.writeMessage(1, nodes_.get(i));
286 }
287 for (int i = 0; i < arcs_.size(); i++) {
288 output.writeMessage(2, arcs_.get(i));
289 }
290 if (((bitField0_ & 0x00000001) != 0)) {
291 output.writeEnum(3, problemType_);
292 }
293 getUnknownFields().writeTo(output);
294 }
295
296 @java.lang.Override
297 public int getSerializedSize() {
298 int size = memoizedSize;
299 if (size != -1) return size;
300
301 size = 0;
302 for (int i = 0; i < nodes_.size(); i++) {
303 size += com.google.protobuf.CodedOutputStream
304 .computeMessageSize(1, nodes_.get(i));
305 }
306 for (int i = 0; i < arcs_.size(); i++) {
307 size += com.google.protobuf.CodedOutputStream
308 .computeMessageSize(2, arcs_.get(i));
309 }
310 if (((bitField0_ & 0x00000001) != 0)) {
311 size += com.google.protobuf.CodedOutputStream
312 .computeEnumSize(3, problemType_);
313 }
314 size += getUnknownFields().getSerializedSize();
315 memoizedSize = size;
316 return size;
317 }
318
319 @java.lang.Override
320 public boolean equals(final java.lang.Object obj) {
321 if (obj == this) {
322 return true;
323 }
324 if (!(obj instanceof com.google.ortools.graph.FlowModelProto)) {
325 return super.equals(obj);
326 }
327 com.google.ortools.graph.FlowModelProto other = (com.google.ortools.graph.FlowModelProto) obj;
328
329 if (!getNodesList()
330 .equals(other.getNodesList())) return false;
331 if (!getArcsList()
332 .equals(other.getArcsList())) return false;
333 if (hasProblemType() != other.hasProblemType()) return false;
334 if (hasProblemType()) {
335 if (problemType_ != other.problemType_) return false;
336 }
337 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
338 return true;
339 }
340
341 @java.lang.Override
342 public int hashCode() {
343 if (memoizedHashCode != 0) {
344 return memoizedHashCode;
345 }
346 int hash = 41;
347 hash = (19 * hash) + getDescriptor().hashCode();
348 if (getNodesCount() > 0) {
349 hash = (37 * hash) + NODES_FIELD_NUMBER;
350 hash = (53 * hash) + getNodesList().hashCode();
351 }
352 if (getArcsCount() > 0) {
353 hash = (37 * hash) + ARCS_FIELD_NUMBER;
354 hash = (53 * hash) + getArcsList().hashCode();
355 }
356 if (hasProblemType()) {
357 hash = (37 * hash) + PROBLEM_TYPE_FIELD_NUMBER;
358 hash = (53 * hash) + problemType_;
359 }
360 hash = (29 * hash) + getUnknownFields().hashCode();
361 memoizedHashCode = hash;
362 return hash;
363 }
364
366 java.nio.ByteBuffer data)
367 throws com.google.protobuf.InvalidProtocolBufferException {
368 return PARSER.parseFrom(data);
369 }
371 java.nio.ByteBuffer data,
372 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
373 throws com.google.protobuf.InvalidProtocolBufferException {
374 return PARSER.parseFrom(data, extensionRegistry);
375 }
377 com.google.protobuf.ByteString data)
378 throws com.google.protobuf.InvalidProtocolBufferException {
379 return PARSER.parseFrom(data);
380 }
382 com.google.protobuf.ByteString data,
383 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
384 throws com.google.protobuf.InvalidProtocolBufferException {
385 return PARSER.parseFrom(data, extensionRegistry);
386 }
388 throws com.google.protobuf.InvalidProtocolBufferException {
389 return PARSER.parseFrom(data);
390 }
392 byte[] data,
393 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
394 throws com.google.protobuf.InvalidProtocolBufferException {
395 return PARSER.parseFrom(data, extensionRegistry);
396 }
397 public static com.google.ortools.graph.FlowModelProto parseFrom(java.io.InputStream input)
398 throws java.io.IOException {
399 return com.google.protobuf.GeneratedMessage
400 .parseWithIOException(PARSER, input);
401 }
403 java.io.InputStream input,
404 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
405 throws java.io.IOException {
406 return com.google.protobuf.GeneratedMessage
407 .parseWithIOException(PARSER, input, extensionRegistry);
408 }
409
410 public static com.google.ortools.graph.FlowModelProto parseDelimitedFrom(java.io.InputStream input)
411 throws java.io.IOException {
412 return com.google.protobuf.GeneratedMessage
413 .parseDelimitedWithIOException(PARSER, input);
414 }
415
417 java.io.InputStream input,
418 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
419 throws java.io.IOException {
420 return com.google.protobuf.GeneratedMessage
421 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
422 }
424 com.google.protobuf.CodedInputStream input)
425 throws java.io.IOException {
426 return com.google.protobuf.GeneratedMessage
427 .parseWithIOException(PARSER, input);
428 }
430 com.google.protobuf.CodedInputStream input,
431 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
432 throws java.io.IOException {
433 return com.google.protobuf.GeneratedMessage
434 .parseWithIOException(PARSER, input, extensionRegistry);
435 }
436
437 @java.lang.Override
438 public Builder newBuilderForType() { return newBuilder(); }
439 public static Builder newBuilder() {
440 return DEFAULT_INSTANCE.toBuilder();
441 }
442 public static Builder newBuilder(com.google.ortools.graph.FlowModelProto prototype) {
443 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
444 }
445 @java.lang.Override
447 return this == DEFAULT_INSTANCE
448 ? new Builder() : new Builder().mergeFrom(this);
449 }
450
451 @java.lang.Override
453 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
454 Builder builder = new Builder(parent);
455 return builder;
456 }
464 public static final class Builder extends
465 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
466 // @@protoc_insertion_point(builder_implements:operations_research.FlowModelProto)
467 com.google.ortools.graph.FlowModelProtoOrBuilder {
468 public static final com.google.protobuf.Descriptors.Descriptor
470 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowModelProto_descriptor;
471 }
472
473 @java.lang.Override
474 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
476 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowModelProto_fieldAccessorTable
477 .ensureFieldAccessorsInitialized(
478 com.google.ortools.graph.FlowModelProto.class, com.google.ortools.graph.FlowModelProto.Builder.class);
479 }
480
481 // Construct using com.google.ortools.graph.FlowModelProto.newBuilder()
482 private Builder() {
483
484 }
485
486 private Builder(
487 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
488 super(parent);
489
490 }
491 @java.lang.Override
492 public Builder clear() {
493 super.clear();
494 bitField0_ = 0;
495 if (nodesBuilder_ == null) {
496 nodes_ = java.util.Collections.emptyList();
497 } else {
498 nodes_ = null;
499 nodesBuilder_.clear();
500 }
501 bitField0_ = (bitField0_ & ~0x00000001);
502 if (arcsBuilder_ == null) {
503 arcs_ = java.util.Collections.emptyList();
504 } else {
505 arcs_ = null;
506 arcsBuilder_.clear();
507 }
508 bitField0_ = (bitField0_ & ~0x00000002);
509 problemType_ = 0;
510 return this;
511 }
512
513 @java.lang.Override
514 public com.google.protobuf.Descriptors.Descriptor
516 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowModelProto_descriptor;
517 }
518
519 @java.lang.Override
521 return com.google.ortools.graph.FlowModelProto.getDefaultInstance();
522 }
523
524 @java.lang.Override
527 if (!result.isInitialized()) {
528 throw newUninitializedMessageException(result);
529 }
530 return result;
531 }
532
533 @java.lang.Override
535 com.google.ortools.graph.FlowModelProto result = new com.google.ortools.graph.FlowModelProto(this);
536 buildPartialRepeatedFields(result);
537 if (bitField0_ != 0) { buildPartial0(result); }
538 onBuilt();
539 return result;
540 }
541
542 private void buildPartialRepeatedFields(com.google.ortools.graph.FlowModelProto result) {
543 if (nodesBuilder_ == null) {
544 if (((bitField0_ & 0x00000001) != 0)) {
545 nodes_ = java.util.Collections.unmodifiableList(nodes_);
546 bitField0_ = (bitField0_ & ~0x00000001);
547 }
548 result.nodes_ = nodes_;
549 } else {
550 result.nodes_ = nodesBuilder_.build();
551 }
552 if (arcsBuilder_ == null) {
553 if (((bitField0_ & 0x00000002) != 0)) {
554 arcs_ = java.util.Collections.unmodifiableList(arcs_);
555 bitField0_ = (bitField0_ & ~0x00000002);
556 }
557 result.arcs_ = arcs_;
558 } else {
559 result.arcs_ = arcsBuilder_.build();
560 }
561 }
562
563 private void buildPartial0(com.google.ortools.graph.FlowModelProto result) {
564 int from_bitField0_ = bitField0_;
565 int to_bitField0_ = 0;
566 if (((from_bitField0_ & 0x00000004) != 0)) {
567 result.problemType_ = problemType_;
568 to_bitField0_ |= 0x00000001;
569 }
570 result.bitField0_ |= to_bitField0_;
571 }
572
573 @java.lang.Override
574 public Builder mergeFrom(com.google.protobuf.Message other) {
575 if (other instanceof com.google.ortools.graph.FlowModelProto) {
576 return mergeFrom((com.google.ortools.graph.FlowModelProto)other);
577 } else {
578 super.mergeFrom(other);
579 return this;
580 }
581 }
582
583 public Builder mergeFrom(com.google.ortools.graph.FlowModelProto other) {
584 if (other == com.google.ortools.graph.FlowModelProto.getDefaultInstance()) return this;
585 if (nodesBuilder_ == null) {
586 if (!other.nodes_.isEmpty()) {
587 if (nodes_.isEmpty()) {
588 nodes_ = other.nodes_;
589 bitField0_ = (bitField0_ & ~0x00000001);
590 } else {
591 ensureNodesIsMutable();
592 nodes_.addAll(other.nodes_);
593 }
594 onChanged();
595 }
596 } else {
597 if (!other.nodes_.isEmpty()) {
598 if (nodesBuilder_.isEmpty()) {
599 nodesBuilder_.dispose();
600 nodesBuilder_ = null;
601 nodes_ = other.nodes_;
602 bitField0_ = (bitField0_ & ~0x00000001);
603 nodesBuilder_ =
604 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
605 getNodesFieldBuilder() : null;
606 } else {
607 nodesBuilder_.addAllMessages(other.nodes_);
608 }
609 }
610 }
611 if (arcsBuilder_ == null) {
612 if (!other.arcs_.isEmpty()) {
613 if (arcs_.isEmpty()) {
614 arcs_ = other.arcs_;
615 bitField0_ = (bitField0_ & ~0x00000002);
616 } else {
617 ensureArcsIsMutable();
618 arcs_.addAll(other.arcs_);
619 }
620 onChanged();
621 }
622 } else {
623 if (!other.arcs_.isEmpty()) {
624 if (arcsBuilder_.isEmpty()) {
625 arcsBuilder_.dispose();
626 arcsBuilder_ = null;
627 arcs_ = other.arcs_;
628 bitField0_ = (bitField0_ & ~0x00000002);
629 arcsBuilder_ =
630 com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
631 getArcsFieldBuilder() : null;
632 } else {
633 arcsBuilder_.addAllMessages(other.arcs_);
634 }
635 }
636 }
637 if (other.hasProblemType()) {
638 setProblemType(other.getProblemType());
639 }
640 this.mergeUnknownFields(other.getUnknownFields());
641 onChanged();
642 return this;
643 }
644
645 @java.lang.Override
646 public final boolean isInitialized() {
647 return true;
648 }
649
650 @java.lang.Override
652 com.google.protobuf.CodedInputStream input,
653 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
654 throws java.io.IOException {
655 if (extensionRegistry == null) {
656 throw new java.lang.NullPointerException();
657 }
658 try {
659 boolean done = false;
660 while (!done) {
661 int tag = input.readTag();
662 switch (tag) {
663 case 0:
664 done = true;
665 break;
666 case 10: {
668 input.readMessage(
669 com.google.ortools.graph.FlowNodeProto.parser(),
670 extensionRegistry);
671 if (nodesBuilder_ == null) {
672 ensureNodesIsMutable();
673 nodes_.add(m);
674 } else {
675 nodesBuilder_.addMessage(m);
676 }
677 break;
678 } // case 10
679 case 18: {
681 input.readMessage(
682 com.google.ortools.graph.FlowArcProto.parser(),
683 extensionRegistry);
684 if (arcsBuilder_ == null) {
685 ensureArcsIsMutable();
686 arcs_.add(m);
687 } else {
688 arcsBuilder_.addMessage(m);
689 }
690 break;
691 } // case 18
692 case 24: {
693 int tmpRaw = input.readEnum();
695 com.google.ortools.graph.FlowModelProto.ProblemType.forNumber(tmpRaw);
696 if (tmpValue == null) {
697 mergeUnknownVarintField(3, tmpRaw);
698 } else {
699 problemType_ = tmpRaw;
700 bitField0_ |= 0x00000004;
701 }
702 break;
703 } // case 24
704 default: {
705 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
706 done = true; // was an endgroup tag
707 }
708 break;
709 } // default:
710 } // switch (tag)
711 } // while (!done)
712 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
713 throw e.unwrapIOException();
714 } finally {
715 onChanged();
716 } // finally
717 return this;
718 }
719 private int bitField0_;
720
721 private java.util.List<com.google.ortools.graph.FlowNodeProto> nodes_ =
722 java.util.Collections.emptyList();
723 private void ensureNodesIsMutable() {
724 if (!((bitField0_ & 0x00000001) != 0)) {
725 nodes_ = new java.util.ArrayList<com.google.ortools.graph.FlowNodeProto>(nodes_);
726 bitField0_ |= 0x00000001;
727 }
728 }
729
730 private com.google.protobuf.RepeatedFieldBuilder<
731 com.google.ortools.graph.FlowNodeProto, com.google.ortools.graph.FlowNodeProto.Builder, com.google.ortools.graph.FlowNodeProtoOrBuilder> nodesBuilder_;
732
736 public java.util.List<com.google.ortools.graph.FlowNodeProto> getNodesList() {
737 if (nodesBuilder_ == null) {
738 return java.util.Collections.unmodifiableList(nodes_);
739 } else {
740 return nodesBuilder_.getMessageList();
741 }
742 }
746 public int getNodesCount() {
747 if (nodesBuilder_ == null) {
748 return nodes_.size();
749 } else {
750 return nodesBuilder_.getCount();
751 }
752 }
757 if (nodesBuilder_ == null) {
758 return nodes_.get(index);
759 } else {
760 return nodesBuilder_.getMessage(index);
761 }
762 }
767 int index, com.google.ortools.graph.FlowNodeProto value) {
768 if (nodesBuilder_ == null) {
769 if (value == null) {
770 throw new NullPointerException();
771 }
772 ensureNodesIsMutable();
773 nodes_.set(index, value);
774 onChanged();
775 } else {
776 nodesBuilder_.setMessage(index, value);
777 }
778 return this;
779 }
784 int index, com.google.ortools.graph.FlowNodeProto.Builder builderForValue) {
785 if (nodesBuilder_ == null) {
786 ensureNodesIsMutable();
787 nodes_.set(index, builderForValue.build());
788 onChanged();
789 } else {
790 nodesBuilder_.setMessage(index, builderForValue.build());
791 }
792 return this;
793 }
797 public Builder addNodes(com.google.ortools.graph.FlowNodeProto value) {
798 if (nodesBuilder_ == null) {
799 if (value == null) {
800 throw new NullPointerException();
801 }
802 ensureNodesIsMutable();
803 nodes_.add(value);
804 onChanged();
805 } else {
806 nodesBuilder_.addMessage(value);
807 }
808 return this;
809 }
814 int index, com.google.ortools.graph.FlowNodeProto value) {
815 if (nodesBuilder_ == null) {
816 if (value == null) {
817 throw new NullPointerException();
818 }
819 ensureNodesIsMutable();
820 nodes_.add(index, value);
821 onChanged();
822 } else {
823 nodesBuilder_.addMessage(index, value);
824 }
825 return this;
826 }
831 com.google.ortools.graph.FlowNodeProto.Builder builderForValue) {
832 if (nodesBuilder_ == null) {
833 ensureNodesIsMutable();
834 nodes_.add(builderForValue.build());
835 onChanged();
836 } else {
837 nodesBuilder_.addMessage(builderForValue.build());
838 }
839 return this;
840 }
845 int index, com.google.ortools.graph.FlowNodeProto.Builder builderForValue) {
846 if (nodesBuilder_ == null) {
847 ensureNodesIsMutable();
848 nodes_.add(index, builderForValue.build());
849 onChanged();
850 } else {
851 nodesBuilder_.addMessage(index, builderForValue.build());
852 }
853 return this;
854 }
859 java.lang.Iterable<? extends com.google.ortools.graph.FlowNodeProto> values) {
860 if (nodesBuilder_ == null) {
861 ensureNodesIsMutable();
862 com.google.protobuf.AbstractMessageLite.Builder.addAll(
863 values, nodes_);
864 onChanged();
865 } else {
866 nodesBuilder_.addAllMessages(values);
867 }
868 return this;
869 }
874 if (nodesBuilder_ == null) {
875 nodes_ = java.util.Collections.emptyList();
876 bitField0_ = (bitField0_ & ~0x00000001);
877 onChanged();
878 } else {
879 nodesBuilder_.clear();
880 }
881 return this;
882 }
886 public Builder removeNodes(int index) {
887 if (nodesBuilder_ == null) {
888 ensureNodesIsMutable();
889 nodes_.remove(index);
890 onChanged();
891 } else {
892 nodesBuilder_.remove(index);
893 }
894 return this;
895 }
900 int index) {
901 return getNodesFieldBuilder().getBuilder(index);
902 }
907 int index) {
908 if (nodesBuilder_ == null) {
909 return nodes_.get(index); } else {
910 return nodesBuilder_.getMessageOrBuilder(index);
911 }
912 }
916 public java.util.List<? extends com.google.ortools.graph.FlowNodeProtoOrBuilder>
918 if (nodesBuilder_ != null) {
919 return nodesBuilder_.getMessageOrBuilderList();
920 } else {
921 return java.util.Collections.unmodifiableList(nodes_);
922 }
923 }
928 return getNodesFieldBuilder().addBuilder(
929 com.google.ortools.graph.FlowNodeProto.getDefaultInstance());
930 }
935 int index) {
936 return getNodesFieldBuilder().addBuilder(
937 index, com.google.ortools.graph.FlowNodeProto.getDefaultInstance());
938 }
942 public java.util.List<com.google.ortools.graph.FlowNodeProto.Builder>
944 return getNodesFieldBuilder().getBuilderList();
945 }
946 private com.google.protobuf.RepeatedFieldBuilder<
947 com.google.ortools.graph.FlowNodeProto, com.google.ortools.graph.FlowNodeProto.Builder, com.google.ortools.graph.FlowNodeProtoOrBuilder>
948 getNodesFieldBuilder() {
949 if (nodesBuilder_ == null) {
950 nodesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
951 com.google.ortools.graph.FlowNodeProto, com.google.ortools.graph.FlowNodeProto.Builder, com.google.ortools.graph.FlowNodeProtoOrBuilder>(
952 nodes_,
953 ((bitField0_ & 0x00000001) != 0),
954 getParentForChildren(),
955 isClean());
956 nodes_ = null;
957 }
958 return nodesBuilder_;
959 }
960
961 private java.util.List<com.google.ortools.graph.FlowArcProto> arcs_ =
962 java.util.Collections.emptyList();
963 private void ensureArcsIsMutable() {
964 if (!((bitField0_ & 0x00000002) != 0)) {
965 arcs_ = new java.util.ArrayList<com.google.ortools.graph.FlowArcProto>(arcs_);
966 bitField0_ |= 0x00000002;
967 }
968 }
969
970 private com.google.protobuf.RepeatedFieldBuilder<
971 com.google.ortools.graph.FlowArcProto, com.google.ortools.graph.FlowArcProto.Builder, com.google.ortools.graph.FlowArcProtoOrBuilder> arcsBuilder_;
972
976 public java.util.List<com.google.ortools.graph.FlowArcProto> getArcsList() {
977 if (arcsBuilder_ == null) {
978 return java.util.Collections.unmodifiableList(arcs_);
979 } else {
980 return arcsBuilder_.getMessageList();
981 }
982 }
986 public int getArcsCount() {
987 if (arcsBuilder_ == null) {
988 return arcs_.size();
989 } else {
990 return arcsBuilder_.getCount();
991 }
992 }
997 if (arcsBuilder_ == null) {
998 return arcs_.get(index);
999 } else {
1000 return arcsBuilder_.getMessage(index);
1001 }
1002 }
1007 int index, com.google.ortools.graph.FlowArcProto value) {
1008 if (arcsBuilder_ == null) {
1009 if (value == null) {
1010 throw new NullPointerException();
1011 }
1012 ensureArcsIsMutable();
1013 arcs_.set(index, value);
1014 onChanged();
1015 } else {
1016 arcsBuilder_.setMessage(index, value);
1017 }
1018 return this;
1019 }
1024 int index, com.google.ortools.graph.FlowArcProto.Builder builderForValue) {
1025 if (arcsBuilder_ == null) {
1026 ensureArcsIsMutable();
1027 arcs_.set(index, builderForValue.build());
1028 onChanged();
1029 } else {
1030 arcsBuilder_.setMessage(index, builderForValue.build());
1031 }
1032 return this;
1033 }
1037 public Builder addArcs(com.google.ortools.graph.FlowArcProto value) {
1038 if (arcsBuilder_ == null) {
1039 if (value == null) {
1040 throw new NullPointerException();
1041 }
1042 ensureArcsIsMutable();
1043 arcs_.add(value);
1044 onChanged();
1045 } else {
1046 arcsBuilder_.addMessage(value);
1047 }
1048 return this;
1049 }
1054 int index, com.google.ortools.graph.FlowArcProto value) {
1055 if (arcsBuilder_ == null) {
1056 if (value == null) {
1057 throw new NullPointerException();
1058 }
1059 ensureArcsIsMutable();
1060 arcs_.add(index, value);
1061 onChanged();
1062 } else {
1063 arcsBuilder_.addMessage(index, value);
1064 }
1065 return this;
1066 }
1071 com.google.ortools.graph.FlowArcProto.Builder builderForValue) {
1072 if (arcsBuilder_ == null) {
1073 ensureArcsIsMutable();
1074 arcs_.add(builderForValue.build());
1075 onChanged();
1076 } else {
1077 arcsBuilder_.addMessage(builderForValue.build());
1078 }
1079 return this;
1080 }
1085 int index, com.google.ortools.graph.FlowArcProto.Builder builderForValue) {
1086 if (arcsBuilder_ == null) {
1087 ensureArcsIsMutable();
1088 arcs_.add(index, builderForValue.build());
1089 onChanged();
1090 } else {
1091 arcsBuilder_.addMessage(index, builderForValue.build());
1092 }
1093 return this;
1094 }
1099 java.lang.Iterable<? extends com.google.ortools.graph.FlowArcProto> values) {
1100 if (arcsBuilder_ == null) {
1101 ensureArcsIsMutable();
1102 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1103 values, arcs_);
1104 onChanged();
1105 } else {
1106 arcsBuilder_.addAllMessages(values);
1107 }
1108 return this;
1109 }
1114 if (arcsBuilder_ == null) {
1115 arcs_ = java.util.Collections.emptyList();
1116 bitField0_ = (bitField0_ & ~0x00000002);
1117 onChanged();
1118 } else {
1119 arcsBuilder_.clear();
1120 }
1121 return this;
1122 }
1126 public Builder removeArcs(int index) {
1127 if (arcsBuilder_ == null) {
1128 ensureArcsIsMutable();
1129 arcs_.remove(index);
1130 onChanged();
1131 } else {
1132 arcsBuilder_.remove(index);
1133 }
1134 return this;
1135 }
1140 int index) {
1141 return getArcsFieldBuilder().getBuilder(index);
1142 }
1147 int index) {
1148 if (arcsBuilder_ == null) {
1149 return arcs_.get(index); } else {
1150 return arcsBuilder_.getMessageOrBuilder(index);
1151 }
1152 }
1156 public java.util.List<? extends com.google.ortools.graph.FlowArcProtoOrBuilder>
1158 if (arcsBuilder_ != null) {
1159 return arcsBuilder_.getMessageOrBuilderList();
1160 } else {
1161 return java.util.Collections.unmodifiableList(arcs_);
1162 }
1163 }
1168 return getArcsFieldBuilder().addBuilder(
1169 com.google.ortools.graph.FlowArcProto.getDefaultInstance());
1170 }
1175 int index) {
1176 return getArcsFieldBuilder().addBuilder(
1177 index, com.google.ortools.graph.FlowArcProto.getDefaultInstance());
1178 }
1182 public java.util.List<com.google.ortools.graph.FlowArcProto.Builder>
1184 return getArcsFieldBuilder().getBuilderList();
1185 }
1186 private com.google.protobuf.RepeatedFieldBuilder<
1187 com.google.ortools.graph.FlowArcProto, com.google.ortools.graph.FlowArcProto.Builder, com.google.ortools.graph.FlowArcProtoOrBuilder>
1188 getArcsFieldBuilder() {
1189 if (arcsBuilder_ == null) {
1190 arcsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
1191 com.google.ortools.graph.FlowArcProto, com.google.ortools.graph.FlowArcProto.Builder, com.google.ortools.graph.FlowArcProtoOrBuilder>(
1192 arcs_,
1193 ((bitField0_ & 0x00000002) != 0),
1194 getParentForChildren(),
1195 isClean());
1196 arcs_ = null;
1197 }
1198 return arcsBuilder_;
1199 }
1200
1201 private int problemType_ = 0;
1206 @java.lang.Override public boolean hasProblemType() {
1207 return ((bitField0_ & 0x00000004) != 0);
1208 }
1213 @java.lang.Override
1215 com.google.ortools.graph.FlowModelProto.ProblemType result = com.google.ortools.graph.FlowModelProto.ProblemType.forNumber(problemType_);
1216 return result == null ? com.google.ortools.graph.FlowModelProto.ProblemType.LINEAR_SUM_ASSIGNMENT : result;
1217 }
1223 public Builder setProblemType(com.google.ortools.graph.FlowModelProto.ProblemType value) {
1224 if (value == null) {
1225 throw new NullPointerException();
1226 }
1227 bitField0_ |= 0x00000004;
1228 problemType_ = value.getNumber();
1229 onChanged();
1230 return this;
1231 }
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 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()