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