Google OR-Tools v9.9
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: 3.25.3
5package com.google.ortools.graph;
6
14public final class FlowModelProto extends
15 com.google.protobuf.GeneratedMessageV3 implements
16 // @@protoc_insertion_point(message_implements:operations_research.FlowModelProto)
18private static final long serialVersionUID = 0L;
19 // Use FlowModelProto.newBuilder() to construct.
20 private FlowModelProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
21 super(builder);
22 }
23 private FlowModelProto() {
24 nodes_ = java.util.Collections.emptyList();
25 arcs_ = java.util.Collections.emptyList();
26 problemType_ = 0;
27 }
28
29 @java.lang.Override
30 @SuppressWarnings({"unused"})
31 protected java.lang.Object newInstance(
32 UnusedPrivateParameter unused) {
33 return new FlowModelProto();
34 }
35
36 public static final com.google.protobuf.Descriptors.Descriptor
38 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowModelProto_descriptor;
39 }
40
41 @java.lang.Override
42 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
44 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowModelProto_fieldAccessorTable
45 .ensureFieldAccessorsInitialized(
46 com.google.ortools.graph.FlowModelProto.class, com.google.ortools.graph.FlowModelProto.Builder.class);
47 }
48
56 public enum ProblemType
57 implements com.google.protobuf.ProtocolMessageEnum {
70 ;
71
75 public static final int LINEAR_SUM_ASSIGNMENT_VALUE = 0;
79 public static final int MAX_FLOW_VALUE = 1;
83 public static final int MIN_COST_FLOW_VALUE = 2;
84
85
86 public final int getNumber() {
87 return value;
88 }
89
95 @java.lang.Deprecated
96 public static ProblemType valueOf(int value) {
97 return forNumber(value);
98 }
99
104 public static ProblemType forNumber(int value) {
105 switch (value) {
106 case 0: return LINEAR_SUM_ASSIGNMENT;
107 case 1: return MAX_FLOW;
108 case 2: return MIN_COST_FLOW;
109 default: return null;
110 }
111 }
112
113 public static com.google.protobuf.Internal.EnumLiteMap<ProblemType>
115 return internalValueMap;
116 }
117 private static final com.google.protobuf.Internal.EnumLiteMap<
118 ProblemType> internalValueMap =
119 new com.google.protobuf.Internal.EnumLiteMap<ProblemType>() {
120 public ProblemType findValueByNumber(int number) {
121 return ProblemType.forNumber(number);
122 }
123 };
124
125 public final com.google.protobuf.Descriptors.EnumValueDescriptor
127 return getDescriptor().getValues().get(ordinal());
128 }
129 public final com.google.protobuf.Descriptors.EnumDescriptor
131 return getDescriptor();
132 }
133 public static final com.google.protobuf.Descriptors.EnumDescriptor
135 return com.google.ortools.graph.FlowModelProto.getDescriptor().getEnumTypes().get(0);
136 }
137
138 private static final ProblemType[] VALUES = values();
139
140 public static ProblemType valueOf(
141 com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
142 if (desc.getType() != getDescriptor()) {
143 throw new java.lang.IllegalArgumentException(
144 "EnumValueDescriptor is not for this type.");
145 }
146 return VALUES[desc.getIndex()];
147 }
148
149 private final int value;
150
151 private ProblemType(int value) {
152 this.value = value;
153 }
154
155 // @@protoc_insertion_point(enum_scope:operations_research.FlowModelProto.ProblemType)
156 }
157
158 private int bitField0_;
159 public static final int NODES_FIELD_NUMBER = 1;
160 @SuppressWarnings("serial")
161 private java.util.List<com.google.ortools.graph.FlowNodeProto> nodes_;
165 @java.lang.Override
166 public java.util.List<com.google.ortools.graph.FlowNodeProto> getNodesList() {
167 return nodes_;
168 }
172 @java.lang.Override
173 public java.util.List<? extends com.google.ortools.graph.FlowNodeProtoOrBuilder>
175 return nodes_;
176 }
180 @java.lang.Override
181 public int getNodesCount() {
182 return nodes_.size();
183 }
187 @java.lang.Override
189 return nodes_.get(index);
190 }
194 @java.lang.Override
196 int index) {
197 return nodes_.get(index);
198 }
199
200 public static final int ARCS_FIELD_NUMBER = 2;
201 @SuppressWarnings("serial")
202 private java.util.List<com.google.ortools.graph.FlowArcProto> arcs_;
206 @java.lang.Override
207 public java.util.List<com.google.ortools.graph.FlowArcProto> getArcsList() {
208 return arcs_;
209 }
213 @java.lang.Override
214 public java.util.List<? extends com.google.ortools.graph.FlowArcProtoOrBuilder>
216 return arcs_;
217 }
221 @java.lang.Override
222 public int getArcsCount() {
223 return arcs_.size();
224 }
228 @java.lang.Override
230 return arcs_.get(index);
231 }
235 @java.lang.Override
237 int index) {
238 return arcs_.get(index);
239 }
240
241 public static final int PROBLEM_TYPE_FIELD_NUMBER = 3;
242 private int problemType_ = 0;
247 @java.lang.Override public boolean hasProblemType() {
248 return ((bitField0_ & 0x00000001) != 0);
249 }
255 com.google.ortools.graph.FlowModelProto.ProblemType result = com.google.ortools.graph.FlowModelProto.ProblemType.forNumber(problemType_);
256 return result == null ? com.google.ortools.graph.FlowModelProto.ProblemType.LINEAR_SUM_ASSIGNMENT : result;
257 }
258
259 private byte memoizedIsInitialized = -1;
260 @java.lang.Override
261 public final boolean isInitialized() {
262 byte isInitialized = memoizedIsInitialized;
263 if (isInitialized == 1) return true;
264 if (isInitialized == 0) return false;
265
266 memoizedIsInitialized = 1;
267 return true;
268 }
269
270 @java.lang.Override
271 public void writeTo(com.google.protobuf.CodedOutputStream output)
272 throws java.io.IOException {
273 for (int i = 0; i < nodes_.size(); i++) {
274 output.writeMessage(1, nodes_.get(i));
275 }
276 for (int i = 0; i < arcs_.size(); i++) {
277 output.writeMessage(2, arcs_.get(i));
278 }
279 if (((bitField0_ & 0x00000001) != 0)) {
280 output.writeEnum(3, problemType_);
281 }
282 getUnknownFields().writeTo(output);
283 }
284
285 @java.lang.Override
286 public int getSerializedSize() {
287 int size = memoizedSize;
288 if (size != -1) return size;
289
290 size = 0;
291 for (int i = 0; i < nodes_.size(); i++) {
292 size += com.google.protobuf.CodedOutputStream
293 .computeMessageSize(1, nodes_.get(i));
294 }
295 for (int i = 0; i < arcs_.size(); i++) {
296 size += com.google.protobuf.CodedOutputStream
297 .computeMessageSize(2, arcs_.get(i));
298 }
299 if (((bitField0_ & 0x00000001) != 0)) {
300 size += com.google.protobuf.CodedOutputStream
301 .computeEnumSize(3, problemType_);
302 }
303 size += getUnknownFields().getSerializedSize();
304 memoizedSize = size;
305 return size;
306 }
307
308 @java.lang.Override
309 public boolean equals(final java.lang.Object obj) {
310 if (obj == this) {
311 return true;
312 }
313 if (!(obj instanceof com.google.ortools.graph.FlowModelProto)) {
314 return super.equals(obj);
315 }
316 com.google.ortools.graph.FlowModelProto other = (com.google.ortools.graph.FlowModelProto) obj;
317
318 if (!getNodesList()
319 .equals(other.getNodesList())) return false;
320 if (!getArcsList()
321 .equals(other.getArcsList())) return false;
322 if (hasProblemType() != other.hasProblemType()) return false;
323 if (hasProblemType()) {
324 if (problemType_ != other.problemType_) return false;
325 }
326 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
327 return true;
328 }
329
330 @java.lang.Override
331 public int hashCode() {
332 if (memoizedHashCode != 0) {
333 return memoizedHashCode;
334 }
335 int hash = 41;
336 hash = (19 * hash) + getDescriptor().hashCode();
337 if (getNodesCount() > 0) {
338 hash = (37 * hash) + NODES_FIELD_NUMBER;
339 hash = (53 * hash) + getNodesList().hashCode();
340 }
341 if (getArcsCount() > 0) {
342 hash = (37 * hash) + ARCS_FIELD_NUMBER;
343 hash = (53 * hash) + getArcsList().hashCode();
344 }
345 if (hasProblemType()) {
346 hash = (37 * hash) + PROBLEM_TYPE_FIELD_NUMBER;
347 hash = (53 * hash) + problemType_;
348 }
349 hash = (29 * hash) + getUnknownFields().hashCode();
350 memoizedHashCode = hash;
351 return hash;
352 }
353
355 java.nio.ByteBuffer data)
356 throws com.google.protobuf.InvalidProtocolBufferException {
357 return PARSER.parseFrom(data);
358 }
360 java.nio.ByteBuffer data,
361 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
362 throws com.google.protobuf.InvalidProtocolBufferException {
363 return PARSER.parseFrom(data, extensionRegistry);
364 }
366 com.google.protobuf.ByteString data)
367 throws com.google.protobuf.InvalidProtocolBufferException {
368 return PARSER.parseFrom(data);
369 }
371 com.google.protobuf.ByteString data,
372 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
373 throws com.google.protobuf.InvalidProtocolBufferException {
374 return PARSER.parseFrom(data, extensionRegistry);
375 }
377 throws com.google.protobuf.InvalidProtocolBufferException {
378 return PARSER.parseFrom(data);
379 }
381 byte[] data,
382 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
383 throws com.google.protobuf.InvalidProtocolBufferException {
384 return PARSER.parseFrom(data, extensionRegistry);
385 }
386 public static com.google.ortools.graph.FlowModelProto parseFrom(java.io.InputStream input)
387 throws java.io.IOException {
388 return com.google.protobuf.GeneratedMessageV3
389 .parseWithIOException(PARSER, input);
390 }
392 java.io.InputStream input,
393 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
394 throws java.io.IOException {
395 return com.google.protobuf.GeneratedMessageV3
396 .parseWithIOException(PARSER, input, extensionRegistry);
397 }
398
399 public static com.google.ortools.graph.FlowModelProto parseDelimitedFrom(java.io.InputStream input)
400 throws java.io.IOException {
401 return com.google.protobuf.GeneratedMessageV3
402 .parseDelimitedWithIOException(PARSER, input);
403 }
404
406 java.io.InputStream input,
407 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
408 throws java.io.IOException {
409 return com.google.protobuf.GeneratedMessageV3
410 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
411 }
413 com.google.protobuf.CodedInputStream input)
414 throws java.io.IOException {
415 return com.google.protobuf.GeneratedMessageV3
416 .parseWithIOException(PARSER, input);
417 }
419 com.google.protobuf.CodedInputStream input,
420 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
421 throws java.io.IOException {
422 return com.google.protobuf.GeneratedMessageV3
423 .parseWithIOException(PARSER, input, extensionRegistry);
424 }
425
426 @java.lang.Override
427 public Builder newBuilderForType() { return newBuilder(); }
428 public static Builder newBuilder() {
429 return DEFAULT_INSTANCE.toBuilder();
430 }
431 public static Builder newBuilder(com.google.ortools.graph.FlowModelProto prototype) {
432 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
433 }
434 @java.lang.Override
436 return this == DEFAULT_INSTANCE
437 ? new Builder() : new Builder().mergeFrom(this);
438 }
439
440 @java.lang.Override
442 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
443 Builder builder = new Builder(parent);
444 return builder;
445 }
453 public static final class Builder extends
454 com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
455 // @@protoc_insertion_point(builder_implements:operations_research.FlowModelProto)
456 com.google.ortools.graph.FlowModelProtoOrBuilder {
457 public static final com.google.protobuf.Descriptors.Descriptor
459 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowModelProto_descriptor;
460 }
461
462 @java.lang.Override
463 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
465 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowModelProto_fieldAccessorTable
466 .ensureFieldAccessorsInitialized(
467 com.google.ortools.graph.FlowModelProto.class, com.google.ortools.graph.FlowModelProto.Builder.class);
468 }
469
470 // Construct using com.google.ortools.graph.FlowModelProto.newBuilder()
471 private Builder() {
472
473 }
474
475 private Builder(
476 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
477 super(parent);
478
479 }
480 @java.lang.Override
481 public Builder clear() {
482 super.clear();
483 bitField0_ = 0;
484 if (nodesBuilder_ == null) {
485 nodes_ = java.util.Collections.emptyList();
486 } else {
487 nodes_ = null;
488 nodesBuilder_.clear();
489 }
490 bitField0_ = (bitField0_ & ~0x00000001);
491 if (arcsBuilder_ == null) {
492 arcs_ = java.util.Collections.emptyList();
493 } else {
494 arcs_ = null;
495 arcsBuilder_.clear();
496 }
497 bitField0_ = (bitField0_ & ~0x00000002);
498 problemType_ = 0;
499 return this;
500 }
501
502 @java.lang.Override
503 public com.google.protobuf.Descriptors.Descriptor
505 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowModelProto_descriptor;
506 }
507
508 @java.lang.Override
510 return com.google.ortools.graph.FlowModelProto.getDefaultInstance();
511 }
512
513 @java.lang.Override
516 if (!result.isInitialized()) {
517 throw newUninitializedMessageException(result);
518 }
519 return result;
520 }
521
522 @java.lang.Override
524 com.google.ortools.graph.FlowModelProto result = new com.google.ortools.graph.FlowModelProto(this);
525 buildPartialRepeatedFields(result);
526 if (bitField0_ != 0) { buildPartial0(result); }
527 onBuilt();
528 return result;
529 }
530
531 private void buildPartialRepeatedFields(com.google.ortools.graph.FlowModelProto result) {
532 if (nodesBuilder_ == null) {
533 if (((bitField0_ & 0x00000001) != 0)) {
534 nodes_ = java.util.Collections.unmodifiableList(nodes_);
535 bitField0_ = (bitField0_ & ~0x00000001);
536 }
537 result.nodes_ = nodes_;
538 } else {
539 result.nodes_ = nodesBuilder_.build();
540 }
541 if (arcsBuilder_ == null) {
542 if (((bitField0_ & 0x00000002) != 0)) {
543 arcs_ = java.util.Collections.unmodifiableList(arcs_);
544 bitField0_ = (bitField0_ & ~0x00000002);
545 }
546 result.arcs_ = arcs_;
547 } else {
548 result.arcs_ = arcsBuilder_.build();
549 }
550 }
551
552 private void buildPartial0(com.google.ortools.graph.FlowModelProto result) {
553 int from_bitField0_ = bitField0_;
554 int to_bitField0_ = 0;
555 if (((from_bitField0_ & 0x00000004) != 0)) {
556 result.problemType_ = problemType_;
557 to_bitField0_ |= 0x00000001;
558 }
559 result.bitField0_ |= to_bitField0_;
560 }
561
562 @java.lang.Override
563 public Builder clone() {
564 return super.clone();
565 }
566 @java.lang.Override
568 com.google.protobuf.Descriptors.FieldDescriptor field,
569 java.lang.Object value) {
570 return super.setField(field, value);
571 }
572 @java.lang.Override
574 com.google.protobuf.Descriptors.FieldDescriptor field) {
575 return super.clearField(field);
576 }
577 @java.lang.Override
579 com.google.protobuf.Descriptors.OneofDescriptor oneof) {
580 return super.clearOneof(oneof);
581 }
582 @java.lang.Override
584 com.google.protobuf.Descriptors.FieldDescriptor field,
585 int index, java.lang.Object value) {
586 return super.setRepeatedField(field, index, value);
587 }
588 @java.lang.Override
590 com.google.protobuf.Descriptors.FieldDescriptor field,
591 java.lang.Object value) {
592 return super.addRepeatedField(field, value);
593 }
594 @java.lang.Override
595 public Builder mergeFrom(com.google.protobuf.Message other) {
596 if (other instanceof com.google.ortools.graph.FlowModelProto) {
597 return mergeFrom((com.google.ortools.graph.FlowModelProto)other);
598 } else {
599 super.mergeFrom(other);
600 return this;
601 }
602 }
603
604 public Builder mergeFrom(com.google.ortools.graph.FlowModelProto other) {
605 if (other == com.google.ortools.graph.FlowModelProto.getDefaultInstance()) return this;
606 if (nodesBuilder_ == null) {
607 if (!other.nodes_.isEmpty()) {
608 if (nodes_.isEmpty()) {
609 nodes_ = other.nodes_;
610 bitField0_ = (bitField0_ & ~0x00000001);
611 } else {
612 ensureNodesIsMutable();
613 nodes_.addAll(other.nodes_);
614 }
615 onChanged();
616 }
617 } else {
618 if (!other.nodes_.isEmpty()) {
619 if (nodesBuilder_.isEmpty()) {
620 nodesBuilder_.dispose();
621 nodesBuilder_ = null;
622 nodes_ = other.nodes_;
623 bitField0_ = (bitField0_ & ~0x00000001);
624 nodesBuilder_ =
625 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
626 getNodesFieldBuilder() : null;
627 } else {
628 nodesBuilder_.addAllMessages(other.nodes_);
629 }
630 }
631 }
632 if (arcsBuilder_ == null) {
633 if (!other.arcs_.isEmpty()) {
634 if (arcs_.isEmpty()) {
635 arcs_ = other.arcs_;
636 bitField0_ = (bitField0_ & ~0x00000002);
637 } else {
638 ensureArcsIsMutable();
639 arcs_.addAll(other.arcs_);
640 }
641 onChanged();
642 }
643 } else {
644 if (!other.arcs_.isEmpty()) {
645 if (arcsBuilder_.isEmpty()) {
646 arcsBuilder_.dispose();
647 arcsBuilder_ = null;
648 arcs_ = other.arcs_;
649 bitField0_ = (bitField0_ & ~0x00000002);
650 arcsBuilder_ =
651 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
652 getArcsFieldBuilder() : null;
653 } else {
654 arcsBuilder_.addAllMessages(other.arcs_);
655 }
656 }
657 }
658 if (other.hasProblemType()) {
659 setProblemType(other.getProblemType());
660 }
661 this.mergeUnknownFields(other.getUnknownFields());
662 onChanged();
663 return this;
664 }
665
666 @java.lang.Override
667 public final boolean isInitialized() {
668 return true;
669 }
670
671 @java.lang.Override
673 com.google.protobuf.CodedInputStream input,
674 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
675 throws java.io.IOException {
676 if (extensionRegistry == null) {
677 throw new java.lang.NullPointerException();
678 }
679 try {
680 boolean done = false;
681 while (!done) {
682 int tag = input.readTag();
683 switch (tag) {
684 case 0:
685 done = true;
686 break;
687 case 10: {
689 input.readMessage(
690 com.google.ortools.graph.FlowNodeProto.PARSER,
691 extensionRegistry);
692 if (nodesBuilder_ == null) {
693 ensureNodesIsMutable();
694 nodes_.add(m);
695 } else {
696 nodesBuilder_.addMessage(m);
697 }
698 break;
699 } // case 10
700 case 18: {
702 input.readMessage(
703 com.google.ortools.graph.FlowArcProto.PARSER,
704 extensionRegistry);
705 if (arcsBuilder_ == null) {
706 ensureArcsIsMutable();
707 arcs_.add(m);
708 } else {
709 arcsBuilder_.addMessage(m);
710 }
711 break;
712 } // case 18
713 case 24: {
714 int tmpRaw = input.readEnum();
716 com.google.ortools.graph.FlowModelProto.ProblemType.forNumber(tmpRaw);
717 if (tmpValue == null) {
718 mergeUnknownVarintField(3, tmpRaw);
719 } else {
720 problemType_ = tmpRaw;
721 bitField0_ |= 0x00000004;
722 }
723 break;
724 } // case 24
725 default: {
726 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
727 done = true; // was an endgroup tag
728 }
729 break;
730 } // default:
731 } // switch (tag)
732 } // while (!done)
733 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
734 throw e.unwrapIOException();
735 } finally {
736 onChanged();
737 } // finally
738 return this;
739 }
740 private int bitField0_;
741
742 private java.util.List<com.google.ortools.graph.FlowNodeProto> nodes_ =
743 java.util.Collections.emptyList();
744 private void ensureNodesIsMutable() {
745 if (!((bitField0_ & 0x00000001) != 0)) {
746 nodes_ = new java.util.ArrayList<com.google.ortools.graph.FlowNodeProto>(nodes_);
747 bitField0_ |= 0x00000001;
748 }
749 }
750
751 private com.google.protobuf.RepeatedFieldBuilderV3<
752 com.google.ortools.graph.FlowNodeProto, com.google.ortools.graph.FlowNodeProto.Builder, com.google.ortools.graph.FlowNodeProtoOrBuilder> nodesBuilder_;
753
757 public java.util.List<com.google.ortools.graph.FlowNodeProto> getNodesList() {
758 if (nodesBuilder_ == null) {
759 return java.util.Collections.unmodifiableList(nodes_);
760 } else {
761 return nodesBuilder_.getMessageList();
762 }
763 }
767 public int getNodesCount() {
768 if (nodesBuilder_ == null) {
769 return nodes_.size();
770 } else {
771 return nodesBuilder_.getCount();
772 }
773 }
778 if (nodesBuilder_ == null) {
779 return nodes_.get(index);
780 } else {
781 return nodesBuilder_.getMessage(index);
782 }
783 }
788 int index, com.google.ortools.graph.FlowNodeProto value) {
789 if (nodesBuilder_ == null) {
790 if (value == null) {
791 throw new NullPointerException();
792 }
793 ensureNodesIsMutable();
794 nodes_.set(index, value);
795 onChanged();
796 } else {
797 nodesBuilder_.setMessage(index, value);
798 }
799 return this;
800 }
805 int index, com.google.ortools.graph.FlowNodeProto.Builder builderForValue) {
806 if (nodesBuilder_ == null) {
807 ensureNodesIsMutable();
808 nodes_.set(index, builderForValue.build());
809 onChanged();
810 } else {
811 nodesBuilder_.setMessage(index, builderForValue.build());
812 }
813 return this;
814 }
818 public Builder addNodes(com.google.ortools.graph.FlowNodeProto value) {
819 if (nodesBuilder_ == null) {
820 if (value == null) {
821 throw new NullPointerException();
822 }
823 ensureNodesIsMutable();
824 nodes_.add(value);
825 onChanged();
826 } else {
827 nodesBuilder_.addMessage(value);
828 }
829 return this;
830 }
835 int index, com.google.ortools.graph.FlowNodeProto value) {
836 if (nodesBuilder_ == null) {
837 if (value == null) {
838 throw new NullPointerException();
839 }
840 ensureNodesIsMutable();
841 nodes_.add(index, value);
842 onChanged();
843 } else {
844 nodesBuilder_.addMessage(index, value);
845 }
846 return this;
847 }
852 com.google.ortools.graph.FlowNodeProto.Builder builderForValue) {
853 if (nodesBuilder_ == null) {
854 ensureNodesIsMutable();
855 nodes_.add(builderForValue.build());
856 onChanged();
857 } else {
858 nodesBuilder_.addMessage(builderForValue.build());
859 }
860 return this;
861 }
866 int index, com.google.ortools.graph.FlowNodeProto.Builder builderForValue) {
867 if (nodesBuilder_ == null) {
868 ensureNodesIsMutable();
869 nodes_.add(index, builderForValue.build());
870 onChanged();
871 } else {
872 nodesBuilder_.addMessage(index, builderForValue.build());
873 }
874 return this;
875 }
880 java.lang.Iterable<? extends com.google.ortools.graph.FlowNodeProto> values) {
881 if (nodesBuilder_ == null) {
882 ensureNodesIsMutable();
883 com.google.protobuf.AbstractMessageLite.Builder.addAll(
884 values, nodes_);
885 onChanged();
886 } else {
887 nodesBuilder_.addAllMessages(values);
888 }
889 return this;
890 }
895 if (nodesBuilder_ == null) {
896 nodes_ = java.util.Collections.emptyList();
897 bitField0_ = (bitField0_ & ~0x00000001);
898 onChanged();
899 } else {
900 nodesBuilder_.clear();
901 }
902 return this;
903 }
907 public Builder removeNodes(int index) {
908 if (nodesBuilder_ == null) {
909 ensureNodesIsMutable();
910 nodes_.remove(index);
911 onChanged();
912 } else {
913 nodesBuilder_.remove(index);
914 }
915 return this;
916 }
921 int index) {
922 return getNodesFieldBuilder().getBuilder(index);
923 }
928 int index) {
929 if (nodesBuilder_ == null) {
930 return nodes_.get(index); } else {
931 return nodesBuilder_.getMessageOrBuilder(index);
932 }
933 }
937 public java.util.List<? extends com.google.ortools.graph.FlowNodeProtoOrBuilder>
939 if (nodesBuilder_ != null) {
940 return nodesBuilder_.getMessageOrBuilderList();
941 } else {
942 return java.util.Collections.unmodifiableList(nodes_);
943 }
944 }
949 return getNodesFieldBuilder().addBuilder(
950 com.google.ortools.graph.FlowNodeProto.getDefaultInstance());
951 }
956 int index) {
957 return getNodesFieldBuilder().addBuilder(
958 index, com.google.ortools.graph.FlowNodeProto.getDefaultInstance());
959 }
963 public java.util.List<com.google.ortools.graph.FlowNodeProto.Builder>
965 return getNodesFieldBuilder().getBuilderList();
966 }
967 private com.google.protobuf.RepeatedFieldBuilderV3<
968 com.google.ortools.graph.FlowNodeProto, com.google.ortools.graph.FlowNodeProto.Builder, com.google.ortools.graph.FlowNodeProtoOrBuilder>
969 getNodesFieldBuilder() {
970 if (nodesBuilder_ == null) {
971 nodesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
972 com.google.ortools.graph.FlowNodeProto, com.google.ortools.graph.FlowNodeProto.Builder, com.google.ortools.graph.FlowNodeProtoOrBuilder>(
973 nodes_,
974 ((bitField0_ & 0x00000001) != 0),
975 getParentForChildren(),
976 isClean());
977 nodes_ = null;
978 }
979 return nodesBuilder_;
980 }
981
982 private java.util.List<com.google.ortools.graph.FlowArcProto> arcs_ =
983 java.util.Collections.emptyList();
984 private void ensureArcsIsMutable() {
985 if (!((bitField0_ & 0x00000002) != 0)) {
986 arcs_ = new java.util.ArrayList<com.google.ortools.graph.FlowArcProto>(arcs_);
987 bitField0_ |= 0x00000002;
988 }
989 }
990
991 private com.google.protobuf.RepeatedFieldBuilderV3<
992 com.google.ortools.graph.FlowArcProto, com.google.ortools.graph.FlowArcProto.Builder, com.google.ortools.graph.FlowArcProtoOrBuilder> arcsBuilder_;
993
997 public java.util.List<com.google.ortools.graph.FlowArcProto> getArcsList() {
998 if (arcsBuilder_ == null) {
999 return java.util.Collections.unmodifiableList(arcs_);
1000 } else {
1001 return arcsBuilder_.getMessageList();
1002 }
1003 }
1007 public int getArcsCount() {
1008 if (arcsBuilder_ == null) {
1009 return arcs_.size();
1010 } else {
1011 return arcsBuilder_.getCount();
1012 }
1013 }
1018 if (arcsBuilder_ == null) {
1019 return arcs_.get(index);
1020 } else {
1021 return arcsBuilder_.getMessage(index);
1022 }
1023 }
1028 int index, com.google.ortools.graph.FlowArcProto value) {
1029 if (arcsBuilder_ == null) {
1030 if (value == null) {
1031 throw new NullPointerException();
1032 }
1033 ensureArcsIsMutable();
1034 arcs_.set(index, value);
1035 onChanged();
1036 } else {
1037 arcsBuilder_.setMessage(index, value);
1038 }
1039 return this;
1040 }
1045 int index, com.google.ortools.graph.FlowArcProto.Builder builderForValue) {
1046 if (arcsBuilder_ == null) {
1047 ensureArcsIsMutable();
1048 arcs_.set(index, builderForValue.build());
1049 onChanged();
1050 } else {
1051 arcsBuilder_.setMessage(index, builderForValue.build());
1052 }
1053 return this;
1054 }
1058 public Builder addArcs(com.google.ortools.graph.FlowArcProto value) {
1059 if (arcsBuilder_ == null) {
1060 if (value == null) {
1061 throw new NullPointerException();
1062 }
1063 ensureArcsIsMutable();
1064 arcs_.add(value);
1065 onChanged();
1066 } else {
1067 arcsBuilder_.addMessage(value);
1068 }
1069 return this;
1070 }
1075 int index, com.google.ortools.graph.FlowArcProto value) {
1076 if (arcsBuilder_ == null) {
1077 if (value == null) {
1078 throw new NullPointerException();
1079 }
1080 ensureArcsIsMutable();
1081 arcs_.add(index, value);
1082 onChanged();
1083 } else {
1084 arcsBuilder_.addMessage(index, value);
1085 }
1086 return this;
1087 }
1092 com.google.ortools.graph.FlowArcProto.Builder builderForValue) {
1093 if (arcsBuilder_ == null) {
1094 ensureArcsIsMutable();
1095 arcs_.add(builderForValue.build());
1096 onChanged();
1097 } else {
1098 arcsBuilder_.addMessage(builderForValue.build());
1099 }
1100 return this;
1101 }
1106 int index, com.google.ortools.graph.FlowArcProto.Builder builderForValue) {
1107 if (arcsBuilder_ == null) {
1108 ensureArcsIsMutable();
1109 arcs_.add(index, builderForValue.build());
1110 onChanged();
1111 } else {
1112 arcsBuilder_.addMessage(index, builderForValue.build());
1113 }
1114 return this;
1115 }
1120 java.lang.Iterable<? extends com.google.ortools.graph.FlowArcProto> values) {
1121 if (arcsBuilder_ == null) {
1122 ensureArcsIsMutable();
1123 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1124 values, arcs_);
1125 onChanged();
1126 } else {
1127 arcsBuilder_.addAllMessages(values);
1128 }
1129 return this;
1130 }
1135 if (arcsBuilder_ == null) {
1136 arcs_ = java.util.Collections.emptyList();
1137 bitField0_ = (bitField0_ & ~0x00000002);
1138 onChanged();
1139 } else {
1140 arcsBuilder_.clear();
1141 }
1142 return this;
1143 }
1147 public Builder removeArcs(int index) {
1148 if (arcsBuilder_ == null) {
1149 ensureArcsIsMutable();
1150 arcs_.remove(index);
1151 onChanged();
1152 } else {
1153 arcsBuilder_.remove(index);
1154 }
1155 return this;
1156 }
1161 int index) {
1162 return getArcsFieldBuilder().getBuilder(index);
1163 }
1168 int index) {
1169 if (arcsBuilder_ == null) {
1170 return arcs_.get(index); } else {
1171 return arcsBuilder_.getMessageOrBuilder(index);
1172 }
1173 }
1177 public java.util.List<? extends com.google.ortools.graph.FlowArcProtoOrBuilder>
1179 if (arcsBuilder_ != null) {
1180 return arcsBuilder_.getMessageOrBuilderList();
1181 } else {
1182 return java.util.Collections.unmodifiableList(arcs_);
1183 }
1184 }
1189 return getArcsFieldBuilder().addBuilder(
1190 com.google.ortools.graph.FlowArcProto.getDefaultInstance());
1191 }
1196 int index) {
1197 return getArcsFieldBuilder().addBuilder(
1198 index, com.google.ortools.graph.FlowArcProto.getDefaultInstance());
1199 }
1203 public java.util.List<com.google.ortools.graph.FlowArcProto.Builder>
1205 return getArcsFieldBuilder().getBuilderList();
1206 }
1207 private com.google.protobuf.RepeatedFieldBuilderV3<
1208 com.google.ortools.graph.FlowArcProto, com.google.ortools.graph.FlowArcProto.Builder, com.google.ortools.graph.FlowArcProtoOrBuilder>
1209 getArcsFieldBuilder() {
1210 if (arcsBuilder_ == null) {
1211 arcsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
1212 com.google.ortools.graph.FlowArcProto, com.google.ortools.graph.FlowArcProto.Builder, com.google.ortools.graph.FlowArcProtoOrBuilder>(
1213 arcs_,
1214 ((bitField0_ & 0x00000002) != 0),
1215 getParentForChildren(),
1216 isClean());
1217 arcs_ = null;
1218 }
1219 return arcsBuilder_;
1220 }
1221
1222 private int problemType_ = 0;
1227 @java.lang.Override public boolean hasProblemType() {
1228 return ((bitField0_ & 0x00000004) != 0);
1229 }
1234 @java.lang.Override
1236 com.google.ortools.graph.FlowModelProto.ProblemType result = com.google.ortools.graph.FlowModelProto.ProblemType.forNumber(problemType_);
1237 return result == null ? com.google.ortools.graph.FlowModelProto.ProblemType.LINEAR_SUM_ASSIGNMENT : result;
1238 }
1244 public Builder setProblemType(com.google.ortools.graph.FlowModelProto.ProblemType value) {
1245 if (value == null) {
1246 throw new NullPointerException();
1247 }
1248 bitField0_ |= 0x00000004;
1249 problemType_ = value.getNumber();
1250 onChanged();
1251 return this;
1252 }
1258 bitField0_ = (bitField0_ & ~0x00000004);
1259 problemType_ = 0;
1260 onChanged();
1261 return this;
1262 }
1263 @java.lang.Override
1265 final com.google.protobuf.UnknownFieldSet unknownFields) {
1266 return super.setUnknownFields(unknownFields);
1267 }
1268
1269 @java.lang.Override
1271 final com.google.protobuf.UnknownFieldSet unknownFields) {
1272 return super.mergeUnknownFields(unknownFields);
1273 }
1274
1275
1276 // @@protoc_insertion_point(builder_scope:operations_research.FlowModelProto)
1277 }
1278
1279 // @@protoc_insertion_point(class_scope:operations_research.FlowModelProto)
1280 private static final com.google.ortools.graph.FlowModelProto DEFAULT_INSTANCE;
1281 static {
1282 DEFAULT_INSTANCE = new com.google.ortools.graph.FlowModelProto();
1283 }
1284
1286 return DEFAULT_INSTANCE;
1287 }
1288
1289 @java.lang.Deprecated public static final com.google.protobuf.Parser<FlowModelProto>
1290 PARSER = new com.google.protobuf.AbstractParser<FlowModelProto>() {
1291 @java.lang.Override
1292 public FlowModelProto parsePartialFrom(
1293 com.google.protobuf.CodedInputStream input,
1294 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1295 throws com.google.protobuf.InvalidProtocolBufferException {
1296 Builder builder = newBuilder();
1297 try {
1298 builder.mergeFrom(input, extensionRegistry);
1299 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1300 throw e.setUnfinishedMessage(builder.buildPartial());
1301 } catch (com.google.protobuf.UninitializedMessageException e) {
1302 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1303 } catch (java.io.IOException e) {
1304 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1305 .setUnfinishedMessage(builder.buildPartial());
1306 }
1307 return builder.buildPartial();
1308 }
1309 };
1310
1311 public static com.google.protobuf.Parser<FlowModelProto> parser() {
1312 return PARSER;
1313 }
1314
1315 @java.lang.Override
1316 public com.google.protobuf.Parser<FlowModelProto> getParserForType() {
1317 return PARSER;
1318 }
1319
1320 @java.lang.Override
1322 return DEFAULT_INSTANCE;
1323 }
1324
1325}
1326
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()
Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
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()
Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
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)
final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
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)
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)
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
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)
Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
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 addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
Builder mergeFrom(com.google.ortools.graph.FlowModelProto other)
final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
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 final com.google.protobuf.Parser< FlowModelProto > PARSER
static com.google.ortools.graph.FlowModelProto parseFrom(java.io.InputStream input)
java.util.List< com.google.ortools.graph.FlowNodeProto > getNodesList()
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.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
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)
java.lang.Object newInstance(UnusedPrivateParameter unused)
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()
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()