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