Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
FlowArcProto.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
11public final class FlowArcProto extends
12 com.google.protobuf.GeneratedMessage implements
13 // @@protoc_insertion_point(message_implements:operations_research.FlowArcProto)
15private static final long serialVersionUID = 0L;
16 static {
17 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
18 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
19 /* major= */ 4,
20 /* minor= */ 29,
21 /* patch= */ 3,
22 /* suffix= */ "",
23 FlowArcProto.class.getName());
24 }
25 // Use FlowArcProto.newBuilder() to construct.
26 private FlowArcProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
27 super(builder);
28 }
29 private FlowArcProto() {
30 capacity_ = 1L;
31 }
32
33 public static final com.google.protobuf.Descriptors.Descriptor
35 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowArcProto_descriptor;
36 }
37
38 @java.lang.Override
39 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
41 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowArcProto_fieldAccessorTable
42 .ensureFieldAccessorsInitialized(
43 com.google.ortools.graph.FlowArcProto.class, com.google.ortools.graph.FlowArcProto.Builder.class);
44 }
45
46 private int bitField0_;
47 public static final int TAIL_FIELD_NUMBER = 1;
48 private long tail_ = 0L;
58 @java.lang.Override
59 public boolean hasTail() {
60 return ((bitField0_ & 0x00000001) != 0);
61 }
62
71 @java.lang.Override
72 public long getTail() {
73 return tail_;
74 }
75
76 public static final int HEAD_FIELD_NUMBER = 2;
77 private long head_ = 0L;
82 @java.lang.Override
83 public boolean hasHead() {
84 return ((bitField0_ & 0x00000002) != 0);
85 }
86
90 @java.lang.Override
91 public long getHead() {
92 return head_;
93 }
94
95 public static final int CAPACITY_FIELD_NUMBER = 3;
96 private long capacity_ = 1L;
106 @java.lang.Override
107 public boolean hasCapacity() {
108 return ((bitField0_ & 0x00000004) != 0);
109 }
110
119 @java.lang.Override
120 public long getCapacity() {
121 return capacity_;
122 }
123
124 public static final int UNIT_COST_FIELD_NUMBER = 4;
125 private long unitCost_ = 0L;
135 @java.lang.Override
136 public boolean hasUnitCost() {
137 return ((bitField0_ & 0x00000008) != 0);
138 }
139
148 @java.lang.Override
149 public long getUnitCost() {
150 return unitCost_;
151 }
152
153 private byte memoizedIsInitialized = -1;
154 @java.lang.Override
155 public final boolean isInitialized() {
156 byte isInitialized = memoizedIsInitialized;
157 if (isInitialized == 1) return true;
158 if (isInitialized == 0) return false;
159
160 memoizedIsInitialized = 1;
161 return true;
162 }
163
164 @java.lang.Override
165 public void writeTo(com.google.protobuf.CodedOutputStream output)
166 throws java.io.IOException {
167 if (((bitField0_ & 0x00000001) != 0)) {
168 output.writeInt64(1, tail_);
169 }
170 if (((bitField0_ & 0x00000002) != 0)) {
171 output.writeInt64(2, head_);
172 }
173 if (((bitField0_ & 0x00000004) != 0)) {
174 output.writeInt64(3, capacity_);
175 }
176 if (((bitField0_ & 0x00000008) != 0)) {
177 output.writeInt64(4, unitCost_);
178 }
179 getUnknownFields().writeTo(output);
180 }
181
182 @java.lang.Override
183 public int getSerializedSize() {
184 int size = memoizedSize;
185 if (size != -1) return size;
186
187 size = 0;
188 if (((bitField0_ & 0x00000001) != 0)) {
189 size += com.google.protobuf.CodedOutputStream
190 .computeInt64Size(1, tail_);
191 }
192 if (((bitField0_ & 0x00000002) != 0)) {
193 size += com.google.protobuf.CodedOutputStream
194 .computeInt64Size(2, head_);
195 }
196 if (((bitField0_ & 0x00000004) != 0)) {
197 size += com.google.protobuf.CodedOutputStream
198 .computeInt64Size(3, capacity_);
199 }
200 if (((bitField0_ & 0x00000008) != 0)) {
201 size += com.google.protobuf.CodedOutputStream
202 .computeInt64Size(4, unitCost_);
203 }
204 size += getUnknownFields().getSerializedSize();
205 memoizedSize = size;
206 return size;
207 }
208
209 @java.lang.Override
210 public boolean equals(final java.lang.Object obj) {
211 if (obj == this) {
212 return true;
213 }
214 if (!(obj instanceof com.google.ortools.graph.FlowArcProto)) {
215 return super.equals(obj);
216 }
217 com.google.ortools.graph.FlowArcProto other = (com.google.ortools.graph.FlowArcProto) obj;
218
219 if (hasTail() != other.hasTail()) return false;
220 if (hasTail()) {
221 if (getTail()
222 != other.getTail()) return false;
223 }
224 if (hasHead() != other.hasHead()) return false;
225 if (hasHead()) {
226 if (getHead()
227 != other.getHead()) return false;
228 }
229 if (hasCapacity() != other.hasCapacity()) return false;
230 if (hasCapacity()) {
231 if (getCapacity()
232 != other.getCapacity()) return false;
233 }
234 if (hasUnitCost() != other.hasUnitCost()) return false;
235 if (hasUnitCost()) {
236 if (getUnitCost()
237 != other.getUnitCost()) return false;
238 }
239 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
240 return true;
241 }
242
243 @java.lang.Override
244 public int hashCode() {
245 if (memoizedHashCode != 0) {
246 return memoizedHashCode;
247 }
248 int hash = 41;
249 hash = (19 * hash) + getDescriptor().hashCode();
250 if (hasTail()) {
251 hash = (37 * hash) + TAIL_FIELD_NUMBER;
252 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
253 getTail());
254 }
255 if (hasHead()) {
256 hash = (37 * hash) + HEAD_FIELD_NUMBER;
257 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
258 getHead());
259 }
260 if (hasCapacity()) {
261 hash = (37 * hash) + CAPACITY_FIELD_NUMBER;
262 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
263 getCapacity());
264 }
265 if (hasUnitCost()) {
266 hash = (37 * hash) + UNIT_COST_FIELD_NUMBER;
267 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
268 getUnitCost());
269 }
270 hash = (29 * hash) + getUnknownFields().hashCode();
271 memoizedHashCode = hash;
272 return hash;
273 }
274
276 java.nio.ByteBuffer data)
277 throws com.google.protobuf.InvalidProtocolBufferException {
278 return PARSER.parseFrom(data);
279 }
281 java.nio.ByteBuffer data,
282 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
283 throws com.google.protobuf.InvalidProtocolBufferException {
284 return PARSER.parseFrom(data, extensionRegistry);
285 }
287 com.google.protobuf.ByteString data)
288 throws com.google.protobuf.InvalidProtocolBufferException {
289 return PARSER.parseFrom(data);
290 }
292 com.google.protobuf.ByteString data,
293 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
294 throws com.google.protobuf.InvalidProtocolBufferException {
295 return PARSER.parseFrom(data, extensionRegistry);
296 }
298 throws com.google.protobuf.InvalidProtocolBufferException {
299 return PARSER.parseFrom(data);
300 }
302 byte[] data,
303 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
304 throws com.google.protobuf.InvalidProtocolBufferException {
305 return PARSER.parseFrom(data, extensionRegistry);
306 }
307 public static com.google.ortools.graph.FlowArcProto parseFrom(java.io.InputStream input)
308 throws java.io.IOException {
309 return com.google.protobuf.GeneratedMessage
310 .parseWithIOException(PARSER, input);
311 }
313 java.io.InputStream input,
314 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
315 throws java.io.IOException {
316 return com.google.protobuf.GeneratedMessage
317 .parseWithIOException(PARSER, input, extensionRegistry);
318 }
319
320 public static com.google.ortools.graph.FlowArcProto parseDelimitedFrom(java.io.InputStream input)
321 throws java.io.IOException {
322 return com.google.protobuf.GeneratedMessage
323 .parseDelimitedWithIOException(PARSER, input);
324 }
325
327 java.io.InputStream input,
328 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
329 throws java.io.IOException {
330 return com.google.protobuf.GeneratedMessage
331 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
332 }
334 com.google.protobuf.CodedInputStream input)
335 throws java.io.IOException {
336 return com.google.protobuf.GeneratedMessage
337 .parseWithIOException(PARSER, input);
338 }
340 com.google.protobuf.CodedInputStream input,
341 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
342 throws java.io.IOException {
343 return com.google.protobuf.GeneratedMessage
344 .parseWithIOException(PARSER, input, extensionRegistry);
345 }
346
347 @java.lang.Override
348 public Builder newBuilderForType() { return newBuilder(); }
349 public static Builder newBuilder() {
350 return DEFAULT_INSTANCE.toBuilder();
351 }
352 public static Builder newBuilder(com.google.ortools.graph.FlowArcProto prototype) {
353 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
354 }
355 @java.lang.Override
357 return this == DEFAULT_INSTANCE
358 ? new Builder() : new Builder().mergeFrom(this);
359 }
360
361 @java.lang.Override
363 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
364 Builder builder = new Builder(parent);
365 return builder;
366 }
367
370 public static final class Builder extends
371 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
372 // @@protoc_insertion_point(builder_implements:operations_research.FlowArcProto)
374 public static final com.google.protobuf.Descriptors.Descriptor
376 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowArcProto_descriptor;
377 }
378
379 @java.lang.Override
380 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
382 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowArcProto_fieldAccessorTable
383 .ensureFieldAccessorsInitialized(
384 com.google.ortools.graph.FlowArcProto.class, com.google.ortools.graph.FlowArcProto.Builder.class);
385 }
386
387 // Construct using com.google.ortools.graph.FlowArcProto.newBuilder()
388 private Builder() {
389
390 }
391
392 private Builder(
393 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
394 super(parent);
395
396 }
397 @java.lang.Override
398 public Builder clear() {
399 super.clear();
400 bitField0_ = 0;
401 tail_ = 0L;
402 head_ = 0L;
403 capacity_ = 1L;
404 unitCost_ = 0L;
405 return this;
406 }
407
408 @java.lang.Override
409 public com.google.protobuf.Descriptors.Descriptor
411 return com.google.ortools.graph.FlowProblem.internal_static_operations_research_FlowArcProto_descriptor;
412 }
413
414 @java.lang.Override
416 return com.google.ortools.graph.FlowArcProto.getDefaultInstance();
417 }
418
419 @java.lang.Override
422 if (!result.isInitialized()) {
423 throw newUninitializedMessageException(result);
424 }
425 return result;
426 }
427
428 @java.lang.Override
430 com.google.ortools.graph.FlowArcProto result = new com.google.ortools.graph.FlowArcProto(this);
431 if (bitField0_ != 0) { buildPartial0(result); }
432 onBuilt();
433 return result;
434 }
435
436 private void buildPartial0(com.google.ortools.graph.FlowArcProto result) {
437 int from_bitField0_ = bitField0_;
438 int to_bitField0_ = 0;
439 if (((from_bitField0_ & 0x00000001) != 0)) {
440 result.tail_ = tail_;
441 to_bitField0_ |= 0x00000001;
442 }
443 if (((from_bitField0_ & 0x00000002) != 0)) {
444 result.head_ = head_;
445 to_bitField0_ |= 0x00000002;
446 }
447 if (((from_bitField0_ & 0x00000004) != 0)) {
448 result.capacity_ = capacity_;
449 to_bitField0_ |= 0x00000004;
450 }
451 if (((from_bitField0_ & 0x00000008) != 0)) {
452 result.unitCost_ = unitCost_;
453 to_bitField0_ |= 0x00000008;
454 }
455 result.bitField0_ |= to_bitField0_;
456 }
457
458 @java.lang.Override
459 public Builder mergeFrom(com.google.protobuf.Message other) {
460 if (other instanceof com.google.ortools.graph.FlowArcProto) {
461 return mergeFrom((com.google.ortools.graph.FlowArcProto)other);
462 } else {
463 super.mergeFrom(other);
464 return this;
465 }
466 }
467
468 public Builder mergeFrom(com.google.ortools.graph.FlowArcProto other) {
469 if (other == com.google.ortools.graph.FlowArcProto.getDefaultInstance()) return this;
470 if (other.hasTail()) {
471 setTail(other.getTail());
472 }
473 if (other.hasHead()) {
474 setHead(other.getHead());
475 }
476 if (other.hasCapacity()) {
477 setCapacity(other.getCapacity());
478 }
479 if (other.hasUnitCost()) {
480 setUnitCost(other.getUnitCost());
481 }
482 this.mergeUnknownFields(other.getUnknownFields());
483 onChanged();
484 return this;
485 }
486
487 @java.lang.Override
488 public final boolean isInitialized() {
489 return true;
490 }
491
492 @java.lang.Override
493 public Builder mergeFrom(
494 com.google.protobuf.CodedInputStream input,
495 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
496 throws java.io.IOException {
497 if (extensionRegistry == null) {
498 throw new java.lang.NullPointerException();
499 }
500 try {
501 boolean done = false;
502 while (!done) {
503 int tag = input.readTag();
504 switch (tag) {
505 case 0:
506 done = true;
507 break;
508 case 8: {
509 tail_ = input.readInt64();
510 bitField0_ |= 0x00000001;
511 break;
512 } // case 8
513 case 16: {
514 head_ = input.readInt64();
515 bitField0_ |= 0x00000002;
516 break;
517 } // case 16
518 case 24: {
519 capacity_ = input.readInt64();
520 bitField0_ |= 0x00000004;
521 break;
522 } // case 24
523 case 32: {
524 unitCost_ = input.readInt64();
525 bitField0_ |= 0x00000008;
526 break;
527 } // case 32
528 default: {
529 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
530 done = true; // was an endgroup tag
531 }
532 break;
533 } // default:
534 } // switch (tag)
535 } // while (!done)
536 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
537 throw e.unwrapIOException();
538 } finally {
539 onChanged();
540 } // finally
541 return this;
542 }
543 private int bitField0_;
544
545 private long tail_ ;
555 @java.lang.Override
556 public boolean hasTail() {
557 return ((bitField0_ & 0x00000001) != 0);
558 }
559
568 @java.lang.Override
569 public long getTail() {
570 return tail_;
571 }
572
582 public Builder setTail(long value) {
583
584 tail_ = value;
585 bitField0_ |= 0x00000001;
586 onChanged();
587 return this;
588 }
589
598 public Builder clearTail() {
599 bitField0_ = (bitField0_ & ~0x00000001);
600 tail_ = 0L;
601 onChanged();
602 return this;
603 }
604
605 private long head_ ;
610 @java.lang.Override
611 public boolean hasHead() {
612 return ((bitField0_ & 0x00000002) != 0);
613 }
614
618 @java.lang.Override
619 public long getHead() {
620 return head_;
621 }
622
627 public Builder setHead(long value) {
628
629 head_ = value;
630 bitField0_ |= 0x00000002;
631 onChanged();
632 return this;
633 }
634
638 public Builder clearHead() {
639 bitField0_ = (bitField0_ & ~0x00000002);
640 head_ = 0L;
641 onChanged();
642 return this;
643 }
644
645 private long capacity_ = 1L;
655 @java.lang.Override
656 public boolean hasCapacity() {
657 return ((bitField0_ & 0x00000004) != 0);
658 }
659
668 @java.lang.Override
669 public long getCapacity() {
670 return capacity_;
671 }
672
682 public Builder setCapacity(long value) {
683
684 capacity_ = value;
685 bitField0_ |= 0x00000004;
686 onChanged();
687 return this;
688 }
689
698 public Builder clearCapacity() {
699 bitField0_ = (bitField0_ & ~0x00000004);
700 capacity_ = 1L;
701 onChanged();
702 return this;
703 }
704
705 private long unitCost_ ;
715 @java.lang.Override
716 public boolean hasUnitCost() {
717 return ((bitField0_ & 0x00000008) != 0);
718 }
719
728 @java.lang.Override
729 public long getUnitCost() {
730 return unitCost_;
731 }
732
742 public Builder setUnitCost(long value) {
743
744 unitCost_ = value;
745 bitField0_ |= 0x00000008;
746 onChanged();
747 return this;
748 }
749
758 public Builder clearUnitCost() {
759 bitField0_ = (bitField0_ & ~0x00000008);
760 unitCost_ = 0L;
761 onChanged();
762 return this;
763 }
764
765 // @@protoc_insertion_point(builder_scope:operations_research.FlowArcProto)
766 }
767
768 // @@protoc_insertion_point(class_scope:operations_research.FlowArcProto)
769 private static final com.google.ortools.graph.FlowArcProto DEFAULT_INSTANCE;
770 static {
771 DEFAULT_INSTANCE = new com.google.ortools.graph.FlowArcProto();
772 }
773
775 return DEFAULT_INSTANCE;
776 }
777
778 private static final com.google.protobuf.Parser<FlowArcProto>
779 PARSER = new com.google.protobuf.AbstractParser<FlowArcProto>() {
780 @java.lang.Override
781 public FlowArcProto parsePartialFrom(
782 com.google.protobuf.CodedInputStream input,
783 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
784 throws com.google.protobuf.InvalidProtocolBufferException {
785 Builder builder = newBuilder();
786 try {
787 builder.mergeFrom(input, extensionRegistry);
788 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
789 throw e.setUnfinishedMessage(builder.buildPartial());
790 } catch (com.google.protobuf.UninitializedMessageException e) {
791 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
792 } catch (java.io.IOException e) {
793 throw new com.google.protobuf.InvalidProtocolBufferException(e)
794 .setUnfinishedMessage(builder.buildPartial());
795 }
796 return builder.buildPartial();
797 }
798 };
799
800 public static com.google.protobuf.Parser<FlowArcProto> parser() {
801 return PARSER;
802 }
803
804 @java.lang.Override
805 public com.google.protobuf.Parser<FlowArcProto> getParserForType() {
806 return PARSER;
807 }
808
809 @java.lang.Override
811 return DEFAULT_INSTANCE;
812 }
813
814}
815
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.graph.FlowArcProto buildPartial()
Builder mergeFrom(com.google.protobuf.Message other)
com.google.ortools.graph.FlowArcProto getDefaultInstanceForType()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
Builder mergeFrom(com.google.ortools.graph.FlowArcProto other)
com.google.ortools.graph.FlowArcProto build()
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
com.google.protobuf.Parser< FlowArcProto > getParserForType()
static com.google.ortools.graph.FlowArcProto parseFrom(com.google.protobuf.CodedInputStream input)
static com.google.ortools.graph.FlowArcProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static Builder newBuilder(com.google.ortools.graph.FlowArcProto prototype)
static com.google.ortools.graph.FlowArcProto parseFrom(java.io.InputStream input)
static com.google.ortools.graph.FlowArcProto parseFrom(byte[] data)
static com.google.ortools.graph.FlowArcProto parseFrom(java.nio.ByteBuffer data)
static com.google.ortools.graph.FlowArcProto parseFrom(com.google.protobuf.ByteString data)
static com.google.ortools.graph.FlowArcProto parseDelimitedFrom(java.io.InputStream input)
static com.google.ortools.graph.FlowArcProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.graph.FlowArcProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.graph.FlowArcProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.graph.FlowArcProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.graph.FlowArcProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
boolean equals(final java.lang.Object obj)
void writeTo(com.google.protobuf.CodedOutputStream output)
static com.google.protobuf.Parser< FlowArcProto > parser()
com.google.ortools.graph.FlowArcProto getDefaultInstanceForType()
static com.google.ortools.graph.FlowArcProto getDefaultInstance()
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()