Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
IntegerVariableProto.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/sat/cp_model.proto
4// Protobuf Java Version: 4.29.3
5
6package com.google.ortools.sat;
7
33public final class IntegerVariableProto extends
34 com.google.protobuf.GeneratedMessage implements
35 // @@protoc_insertion_point(message_implements:operations_research.sat.IntegerVariableProto)
37private static final long serialVersionUID = 0L;
38 static {
39 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
40 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
41 /* major= */ 4,
42 /* minor= */ 29,
43 /* patch= */ 3,
44 /* suffix= */ "",
45 IntegerVariableProto.class.getName());
46 }
47 // Use IntegerVariableProto.newBuilder() to construct.
48 private IntegerVariableProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
49 super(builder);
50 }
51 private IntegerVariableProto() {
52 name_ = "";
53 domain_ = emptyLongList();
54 }
55
56 public static final com.google.protobuf.Descriptors.Descriptor
58 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_IntegerVariableProto_descriptor;
59 }
60
61 @java.lang.Override
62 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
64 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_IntegerVariableProto_fieldAccessorTable
65 .ensureFieldAccessorsInitialized(
66 com.google.ortools.sat.IntegerVariableProto.class, com.google.ortools.sat.IntegerVariableProto.Builder.class);
67 }
68
69 public static final int NAME_FIELD_NUMBER = 1;
70 @SuppressWarnings("serial")
71 private volatile java.lang.Object name_ = "";
80 @java.lang.Override
81 public java.lang.String getName() {
82 java.lang.Object ref = name_;
83 if (ref instanceof java.lang.String) {
84 return (java.lang.String) ref;
85 } else {
86 com.google.protobuf.ByteString bs =
87 (com.google.protobuf.ByteString) ref;
88 java.lang.String s = bs.toStringUtf8();
89 name_ = s;
90 return s;
91 }
92 }
93
101 @java.lang.Override
102 public com.google.protobuf.ByteString
104 java.lang.Object ref = name_;
105 if (ref instanceof java.lang.String) {
106 com.google.protobuf.ByteString b =
107 com.google.protobuf.ByteString.copyFromUtf8(
108 (java.lang.String) ref);
109 name_ = b;
110 return b;
111 } else {
112 return (com.google.protobuf.ByteString) ref;
113 }
114 }
115
116 public static final int DOMAIN_FIELD_NUMBER = 2;
117 @SuppressWarnings("serial")
118 private com.google.protobuf.Internal.LongList domain_ =
119 emptyLongList();
144 @java.lang.Override
145 public java.util.List<java.lang.Long>
147 return domain_;
148 }
149
173 public int getDomainCount() {
174 return domain_.size();
175 }
176
201 public long getDomain(int index) {
202 return domain_.getLong(index);
203 }
204 private int domainMemoizedSerializedSize = -1;
205
206 private byte memoizedIsInitialized = -1;
207 @java.lang.Override
208 public final boolean isInitialized() {
209 byte isInitialized = memoizedIsInitialized;
210 if (isInitialized == 1) return true;
211 if (isInitialized == 0) return false;
212
213 memoizedIsInitialized = 1;
214 return true;
215 }
216
217 @java.lang.Override
218 public void writeTo(com.google.protobuf.CodedOutputStream output)
219 throws java.io.IOException {
221 if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
222 com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
223 }
224 if (getDomainList().size() > 0) {
225 output.writeUInt32NoTag(18);
226 output.writeUInt32NoTag(domainMemoizedSerializedSize);
227 }
228 for (int i = 0; i < domain_.size(); i++) {
229 output.writeInt64NoTag(domain_.getLong(i));
230 }
231 getUnknownFields().writeTo(output);
232 }
233
234 @java.lang.Override
235 public int getSerializedSize() {
236 int size = memoizedSize;
237 if (size != -1) return size;
238
239 size = 0;
240 if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) {
241 size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_);
242 }
243 {
244 int dataSize = 0;
245 for (int i = 0; i < domain_.size(); i++) {
246 dataSize += com.google.protobuf.CodedOutputStream
247 .computeInt64SizeNoTag(domain_.getLong(i));
248 }
249 size += dataSize;
250 if (!getDomainList().isEmpty()) {
251 size += 1;
252 size += com.google.protobuf.CodedOutputStream
253 .computeInt32SizeNoTag(dataSize);
254 }
255 domainMemoizedSerializedSize = dataSize;
256 }
257 size += getUnknownFields().getSerializedSize();
258 memoizedSize = size;
259 return size;
260 }
261
262 @java.lang.Override
263 public boolean equals(final java.lang.Object obj) {
264 if (obj == this) {
265 return true;
266 }
267 if (!(obj instanceof com.google.ortools.sat.IntegerVariableProto)) {
268 return super.equals(obj);
269 }
270 com.google.ortools.sat.IntegerVariableProto other = (com.google.ortools.sat.IntegerVariableProto) obj;
271
272 if (!getName()
273 .equals(other.getName())) return false;
274 if (!getDomainList()
275 .equals(other.getDomainList())) return false;
276 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
277 return true;
278 }
279
280 @java.lang.Override
281 public int hashCode() {
282 if (memoizedHashCode != 0) {
283 return memoizedHashCode;
284 }
285 int hash = 41;
286 hash = (19 * hash) + getDescriptor().hashCode();
287 hash = (37 * hash) + NAME_FIELD_NUMBER;
288 hash = (53 * hash) + getName().hashCode();
289 if (getDomainCount() > 0) {
290 hash = (37 * hash) + DOMAIN_FIELD_NUMBER;
291 hash = (53 * hash) + getDomainList().hashCode();
292 }
293 hash = (29 * hash) + getUnknownFields().hashCode();
294 memoizedHashCode = hash;
295 return hash;
296 }
297
299 java.nio.ByteBuffer data)
300 throws com.google.protobuf.InvalidProtocolBufferException {
301 return PARSER.parseFrom(data);
302 }
304 java.nio.ByteBuffer data,
305 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
306 throws com.google.protobuf.InvalidProtocolBufferException {
307 return PARSER.parseFrom(data, extensionRegistry);
308 }
310 com.google.protobuf.ByteString data)
311 throws com.google.protobuf.InvalidProtocolBufferException {
312 return PARSER.parseFrom(data);
313 }
315 com.google.protobuf.ByteString data,
316 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
317 throws com.google.protobuf.InvalidProtocolBufferException {
318 return PARSER.parseFrom(data, extensionRegistry);
319 }
321 throws com.google.protobuf.InvalidProtocolBufferException {
322 return PARSER.parseFrom(data);
323 }
325 byte[] data,
326 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
327 throws com.google.protobuf.InvalidProtocolBufferException {
328 return PARSER.parseFrom(data, extensionRegistry);
329 }
330 public static com.google.ortools.sat.IntegerVariableProto parseFrom(java.io.InputStream input)
331 throws java.io.IOException {
332 return com.google.protobuf.GeneratedMessage
333 .parseWithIOException(PARSER, input);
334 }
336 java.io.InputStream input,
337 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
338 throws java.io.IOException {
339 return com.google.protobuf.GeneratedMessage
340 .parseWithIOException(PARSER, input, extensionRegistry);
341 }
342
344 throws java.io.IOException {
345 return com.google.protobuf.GeneratedMessage
346 .parseDelimitedWithIOException(PARSER, input);
347 }
348
350 java.io.InputStream input,
351 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
352 throws java.io.IOException {
353 return com.google.protobuf.GeneratedMessage
354 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
355 }
357 com.google.protobuf.CodedInputStream input)
358 throws java.io.IOException {
359 return com.google.protobuf.GeneratedMessage
360 .parseWithIOException(PARSER, input);
361 }
363 com.google.protobuf.CodedInputStream input,
364 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
365 throws java.io.IOException {
366 return com.google.protobuf.GeneratedMessage
367 .parseWithIOException(PARSER, input, extensionRegistry);
368 }
369
370 @java.lang.Override
371 public Builder newBuilderForType() { return newBuilder(); }
372 public static Builder newBuilder() {
373 return DEFAULT_INSTANCE.toBuilder();
374 }
375 public static Builder newBuilder(com.google.ortools.sat.IntegerVariableProto prototype) {
376 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
377 }
378 @java.lang.Override
380 return this == DEFAULT_INSTANCE
381 ? new Builder() : new Builder().mergeFrom(this);
382 }
383
384 @java.lang.Override
386 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
387 Builder builder = new Builder(parent);
388 return builder;
389 }
390
415 public static final class Builder extends
416 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
417 // @@protoc_insertion_point(builder_implements:operations_research.sat.IntegerVariableProto)
419 public static final com.google.protobuf.Descriptors.Descriptor
421 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_IntegerVariableProto_descriptor;
422 }
423
424 @java.lang.Override
425 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
427 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_IntegerVariableProto_fieldAccessorTable
428 .ensureFieldAccessorsInitialized(
429 com.google.ortools.sat.IntegerVariableProto.class, com.google.ortools.sat.IntegerVariableProto.Builder.class);
430 }
431
432 // Construct using com.google.ortools.sat.IntegerVariableProto.newBuilder()
433 private Builder() {
434
435 }
436
437 private Builder(
438 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
439 super(parent);
440
441 }
442 @java.lang.Override
443 public Builder clear() {
444 super.clear();
445 bitField0_ = 0;
446 name_ = "";
447 domain_ = emptyLongList();
448 return this;
449 }
450
451 @java.lang.Override
452 public com.google.protobuf.Descriptors.Descriptor
454 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_IntegerVariableProto_descriptor;
455 }
456
457 @java.lang.Override
459 return com.google.ortools.sat.IntegerVariableProto.getDefaultInstance();
460 }
461
462 @java.lang.Override
465 if (!result.isInitialized()) {
466 throw newUninitializedMessageException(result);
467 }
468 return result;
469 }
470
471 @java.lang.Override
473 com.google.ortools.sat.IntegerVariableProto result = new com.google.ortools.sat.IntegerVariableProto(this);
474 if (bitField0_ != 0) { buildPartial0(result); }
475 onBuilt();
476 return result;
477 }
478
479 private void buildPartial0(com.google.ortools.sat.IntegerVariableProto result) {
480 int from_bitField0_ = bitField0_;
481 if (((from_bitField0_ & 0x00000001) != 0)) {
482 result.name_ = name_;
483 }
484 if (((from_bitField0_ & 0x00000002) != 0)) {
485 domain_.makeImmutable();
486 result.domain_ = domain_;
487 }
488 }
489
490 @java.lang.Override
491 public Builder mergeFrom(com.google.protobuf.Message other) {
492 if (other instanceof com.google.ortools.sat.IntegerVariableProto) {
493 return mergeFrom((com.google.ortools.sat.IntegerVariableProto)other);
494 } else {
495 super.mergeFrom(other);
496 return this;
497 }
498 }
499
500 public Builder mergeFrom(com.google.ortools.sat.IntegerVariableProto other) {
501 if (other == com.google.ortools.sat.IntegerVariableProto.getDefaultInstance()) return this;
502 if (!other.getName().isEmpty()) {
503 name_ = other.name_;
504 bitField0_ |= 0x00000001;
505 onChanged();
506 }
507 if (!other.domain_.isEmpty()) {
508 if (domain_.isEmpty()) {
509 domain_ = other.domain_;
510 domain_.makeImmutable();
511 bitField0_ |= 0x00000002;
512 } else {
513 ensureDomainIsMutable();
514 domain_.addAll(other.domain_);
515 }
516 onChanged();
517 }
518 this.mergeUnknownFields(other.getUnknownFields());
519 onChanged();
520 return this;
521 }
522
523 @java.lang.Override
524 public final boolean isInitialized() {
525 return true;
526 }
527
528 @java.lang.Override
529 public Builder mergeFrom(
530 com.google.protobuf.CodedInputStream input,
531 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
532 throws java.io.IOException {
533 if (extensionRegistry == null) {
534 throw new java.lang.NullPointerException();
535 }
536 try {
537 boolean done = false;
538 while (!done) {
539 int tag = input.readTag();
540 switch (tag) {
541 case 0:
542 done = true;
543 break;
544 case 10: {
545 name_ = input.readStringRequireUtf8();
546 bitField0_ |= 0x00000001;
547 break;
548 } // case 10
549 case 16: {
550 long v = input.readInt64();
551 ensureDomainIsMutable();
552 domain_.addLong(v);
553 break;
554 } // case 16
555 case 18: {
556 int length = input.readRawVarint32();
557 int limit = input.pushLimit(length);
558 ensureDomainIsMutable();
559 while (input.getBytesUntilLimit() > 0) {
560 domain_.addLong(input.readInt64());
561 }
562 input.popLimit(limit);
563 break;
564 } // case 18
565 default: {
566 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
567 done = true; // was an endgroup tag
568 }
569 break;
570 } // default:
571 } // switch (tag)
572 } // while (!done)
573 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
574 throw e.unwrapIOException();
575 } finally {
576 onChanged();
577 } // finally
578 return this;
579 }
580 private int bitField0_;
581
582 private java.lang.Object name_ = "";
591 public java.lang.String getName() {
592 java.lang.Object ref = name_;
593 if (!(ref instanceof java.lang.String)) {
594 com.google.protobuf.ByteString bs =
595 (com.google.protobuf.ByteString) ref;
596 java.lang.String s = bs.toStringUtf8();
597 name_ = s;
598 return s;
599 } else {
600 return (java.lang.String) ref;
601 }
602 }
603
611 public com.google.protobuf.ByteString
613 java.lang.Object ref = name_;
614 if (ref instanceof String) {
615 com.google.protobuf.ByteString b =
616 com.google.protobuf.ByteString.copyFromUtf8(
617 (java.lang.String) ref);
618 name_ = b;
619 return b;
620 } else {
621 return (com.google.protobuf.ByteString) ref;
622 }
623 }
624
633 public Builder setName(
634 java.lang.String value) {
635 if (value == null) { throw new NullPointerException(); }
636 name_ = value;
637 bitField0_ |= 0x00000001;
638 onChanged();
639 return this;
640 }
641
649 public Builder clearName() {
650 name_ = getDefaultInstance().getName();
651 bitField0_ = (bitField0_ & ~0x00000001);
652 onChanged();
653 return this;
654 }
655
664 public Builder setNameBytes(
665 com.google.protobuf.ByteString value) {
666 if (value == null) { throw new NullPointerException(); }
667 checkByteStringIsUtf8(value);
668 name_ = value;
669 bitField0_ |= 0x00000001;
670 onChanged();
671 return this;
672 }
673
674 private com.google.protobuf.Internal.LongList domain_ = emptyLongList();
675 private void ensureDomainIsMutable() {
676 if (!domain_.isModifiable()) {
677 domain_ = makeMutableCopy(domain_);
678 }
679 bitField0_ |= 0x00000002;
680 }
705 public java.util.List<java.lang.Long>
707 domain_.makeImmutable();
708 return domain_;
709 }
710
734 public int getDomainCount() {
735 return domain_.size();
736 }
737
762 public long getDomain(int index) {
763 return domain_.getLong(index);
764 }
765
791 public Builder setDomain(
792 int index, long value) {
793
794 ensureDomainIsMutable();
795 domain_.setLong(index, value);
796 bitField0_ |= 0x00000002;
797 onChanged();
798 return this;
799 }
800
825 public Builder addDomain(long value) {
826
827 ensureDomainIsMutable();
828 domain_.addLong(value);
829 bitField0_ |= 0x00000002;
830 onChanged();
831 return this;
832 }
833
858 public Builder addAllDomain(
859 java.lang.Iterable<? extends java.lang.Long> values) {
860 ensureDomainIsMutable();
861 com.google.protobuf.AbstractMessageLite.Builder.addAll(
862 values, domain_);
863 bitField0_ |= 0x00000002;
864 onChanged();
865 return this;
866 }
867
891 public Builder clearDomain() {
892 domain_ = emptyLongList();
893 bitField0_ = (bitField0_ & ~0x00000002);
894 onChanged();
895 return this;
896 }
897
898 // @@protoc_insertion_point(builder_scope:operations_research.sat.IntegerVariableProto)
899 }
900
901 // @@protoc_insertion_point(class_scope:operations_research.sat.IntegerVariableProto)
902 private static final com.google.ortools.sat.IntegerVariableProto DEFAULT_INSTANCE;
903 static {
904 DEFAULT_INSTANCE = new com.google.ortools.sat.IntegerVariableProto();
905 }
906
908 return DEFAULT_INSTANCE;
909 }
910
911 private static final com.google.protobuf.Parser<IntegerVariableProto>
912 PARSER = new com.google.protobuf.AbstractParser<IntegerVariableProto>() {
913 @java.lang.Override
914 public IntegerVariableProto parsePartialFrom(
915 com.google.protobuf.CodedInputStream input,
916 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
917 throws com.google.protobuf.InvalidProtocolBufferException {
918 Builder builder = newBuilder();
919 try {
920 builder.mergeFrom(input, extensionRegistry);
921 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
922 throw e.setUnfinishedMessage(builder.buildPartial());
923 } catch (com.google.protobuf.UninitializedMessageException e) {
924 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
925 } catch (java.io.IOException e) {
926 throw new com.google.protobuf.InvalidProtocolBufferException(e)
927 .setUnfinishedMessage(builder.buildPartial());
928 }
929 return builder.buildPartial();
930 }
931 };
932
933 public static com.google.protobuf.Parser<IntegerVariableProto> parser() {
934 return PARSER;
935 }
936
937 @java.lang.Override
938 public com.google.protobuf.Parser<IntegerVariableProto> getParserForType() {
939 return PARSER;
940 }
941
942 @java.lang.Override
944 return DEFAULT_INSTANCE;
945 }
946
947}
948
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
Builder mergeFrom(com.google.protobuf.Message other)
Builder mergeFrom(com.google.ortools.sat.IntegerVariableProto other)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
com.google.ortools.sat.IntegerVariableProto buildPartial()
com.google.ortools.sat.IntegerVariableProto build()
Builder addAllDomain(java.lang.Iterable<? extends java.lang.Long > values)
com.google.ortools.sat.IntegerVariableProto getDefaultInstanceForType()
Builder setNameBytes(com.google.protobuf.ByteString value)
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.IntegerVariableProto getDefaultInstance()
static com.google.ortools.sat.IntegerVariableProto parseDelimitedFrom(java.io.InputStream input)
static com.google.ortools.sat.IntegerVariableProto parseFrom(com.google.protobuf.CodedInputStream input)
static Builder newBuilder(com.google.ortools.sat.IntegerVariableProto prototype)
static com.google.ortools.sat.IntegerVariableProto parseFrom(java.io.InputStream input)
static com.google.ortools.sat.IntegerVariableProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.sat.IntegerVariableProto getDefaultInstanceForType()
static com.google.ortools.sat.IntegerVariableProto parseFrom(byte[] data)
java.util.List< java.lang.Long > getDomainList()
boolean equals(final java.lang.Object obj)
static com.google.ortools.sat.IntegerVariableProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.IntegerVariableProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.Parser< IntegerVariableProto > getParserForType()
static com.google.protobuf.Parser< IntegerVariableProto > parser()
static com.google.ortools.sat.IntegerVariableProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
static com.google.ortools.sat.IntegerVariableProto parseFrom(java.nio.ByteBuffer data)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
static com.google.ortools.sat.IntegerVariableProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
void writeTo(com.google.protobuf.CodedOutputStream output)
static com.google.ortools.sat.IntegerVariableProto parseFrom(com.google.protobuf.ByteString data)
static com.google.ortools.sat.IntegerVariableProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)