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