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