5package com.google.ortools.sat;
18 com.google.protobuf.GeneratedMessage implements
21private static final long serialVersionUID = 0L;
23 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
24 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
36 literals_ = emptyIntList();
37 coefficients_ = emptyLongList();
41 public static final com.google.protobuf.Descriptors.Descriptor
43 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearBooleanConstraint_descriptor;
47 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
49 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearBooleanConstraint_fieldAccessorTable
50 .ensureFieldAccessorsInitialized(
51 com.google.ortools.sat.LinearBooleanConstraint.class, com.google.ortools.sat.LinearBooleanConstraint.Builder.class);
54 private int bitField0_;
56 @SuppressWarnings(
"serial")
57 private com.google.protobuf.Internal.IntList literals_ =
76 public java.util.List<java.lang.Integer>
97 return literals_.size();
117 return literals_.getInt(index);
121 @SuppressWarnings(
"serial")
122 private com.google.protobuf.Internal.LongList coefficients_ =
129 public java.util.List<java.lang.Long>
131 return coefficients_;
138 return coefficients_.size();
146 return coefficients_.getLong(index);
150 private long lowerBound_ = 0L;
163 return ((bitField0_ & 0x00000001) != 0);
181 private long upperBound_ = 0L;
188 return ((bitField0_ & 0x00000002) != 0);
200 @SuppressWarnings(
"serial")
201 private volatile java.lang.Object name_ = "";
212 return ((bitField0_ & 0x00000004) != 0);
224 java.lang.Object ref = name_;
225 if (ref instanceof java.lang.String) {
226 return (java.lang.String) ref;
228 com.google.protobuf.ByteString bs =
229 (com.google.protobuf.ByteString) ref;
230 java.lang.String s = bs.toStringUtf8();
231 if (bs.isValidUtf8()) {
246 public com.google.protobuf.ByteString
248 java.lang.Object ref = name_;
249 if (ref instanceof java.lang.String) {
250 com.google.protobuf.ByteString b =
251 com.google.protobuf.ByteString.copyFromUtf8(
252 (java.lang.String) ref);
256 return (com.google.protobuf.ByteString) ref;
260 private byte memoizedIsInitialized = -1;
267 memoizedIsInitialized = 1;
272 public void writeTo(com.google.protobuf.CodedOutputStream output)
273 throws java.io.IOException {
274 for (
int i = 0; i < literals_.size(); i++) {
275 output.writeInt32(1, literals_.getInt(i));
277 for (
int i = 0; i < coefficients_.size(); i++) {
278 output.writeInt64(2, coefficients_.getLong(i));
280 if (((bitField0_ & 0x00000001) != 0)) {
281 output.writeInt64(3, lowerBound_);
283 if (((bitField0_ & 0x00000002) != 0)) {
284 output.writeInt64(4, upperBound_);
286 if (((bitField0_ & 0x00000004) != 0)) {
287 com.google.protobuf.GeneratedMessage.writeString(output, 5, name_);
289 getUnknownFields().writeTo(output);
294 int size = memoizedSize;
295 if (size != -1)
return size;
300 for (
int i = 0; i < literals_.size(); i++) {
301 dataSize += com.google.protobuf.CodedOutputStream
302 .computeInt32SizeNoTag(literals_.getInt(i));
309 for (
int i = 0; i < coefficients_.size(); i++) {
310 dataSize += com.google.protobuf.CodedOutputStream
311 .computeInt64SizeNoTag(coefficients_.getLong(i));
316 if (((bitField0_ & 0x00000001) != 0)) {
317 size += com.google.protobuf.CodedOutputStream
318 .computeInt64Size(3, lowerBound_);
320 if (((bitField0_ & 0x00000002) != 0)) {
321 size += com.google.protobuf.CodedOutputStream
322 .computeInt64Size(4, upperBound_);
324 if (((bitField0_ & 0x00000004) != 0)) {
325 size += com.google.protobuf.GeneratedMessage.computeStringSize(5, name_);
327 size += getUnknownFields().getSerializedSize();
333 public boolean equals(
final java.lang.Object obj) {
337 if (!(obj instanceof com.google.ortools.sat.LinearBooleanConstraint)) {
338 return super.equals(obj);
361 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
367 if (memoizedHashCode != 0) {
368 return memoizedHashCode;
382 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
387 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
392 hash = (53 * hash) +
getName().hashCode();
394 hash = (29 * hash) + getUnknownFields().hashCode();
395 memoizedHashCode = hash;
400 java.nio.ByteBuffer data)
401 throws com.google.protobuf.InvalidProtocolBufferException {
402 return PARSER.parseFrom(data);
405 java.nio.ByteBuffer data,
406 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
407 throws com.google.protobuf.InvalidProtocolBufferException {
408 return PARSER.parseFrom(data, extensionRegistry);
411 com.google.protobuf.ByteString data)
412 throws com.google.protobuf.InvalidProtocolBufferException {
413 return PARSER.parseFrom(data);
416 com.google.protobuf.ByteString data,
417 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
418 throws com.google.protobuf.InvalidProtocolBufferException {
419 return PARSER.parseFrom(data, extensionRegistry);
422 throws com.google.protobuf.InvalidProtocolBufferException {
423 return PARSER.parseFrom(data);
427 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
428 throws com.google.protobuf.InvalidProtocolBufferException {
429 return PARSER.parseFrom(data, extensionRegistry);
432 throws java.io.IOException {
433 return com.google.protobuf.GeneratedMessage
434 .parseWithIOException(PARSER, input);
437 java.io.InputStream input,
438 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
439 throws java.io.IOException {
440 return com.google.protobuf.GeneratedMessage
441 .parseWithIOException(PARSER, input, extensionRegistry);
445 throws java.io.IOException {
446 return com.google.protobuf.GeneratedMessage
447 .parseDelimitedWithIOException(PARSER, input);
451 java.io.InputStream input,
452 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
453 throws java.io.IOException {
454 return com.google.protobuf.GeneratedMessage
455 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
458 com.google.protobuf.CodedInputStream input)
459 throws java.io.IOException {
460 return com.google.protobuf.GeneratedMessage
461 .parseWithIOException(PARSER, input);
464 com.google.protobuf.CodedInputStream input,
465 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
466 throws java.io.IOException {
467 return com.google.protobuf.GeneratedMessage
468 .parseWithIOException(PARSER, input, extensionRegistry);
481 return this == DEFAULT_INSTANCE
487 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
502 com.google.protobuf.GeneratedMessage.
Builder<Builder> implements
505 public static final com.google.protobuf.Descriptors.Descriptor
507 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearBooleanConstraint_descriptor;
511 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
513 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearBooleanConstraint_fieldAccessorTable
514 .ensureFieldAccessorsInitialized(
515 com.google.ortools.sat.LinearBooleanConstraint.class, com.google.ortools.sat.LinearBooleanConstraint.Builder.class);
524 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
532 literals_ = emptyIntList();
533 coefficients_ = emptyLongList();
541 public com.google.protobuf.Descriptors.Descriptor
543 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearBooleanConstraint_descriptor;
548 return com.google.ortools.sat.LinearBooleanConstraint.getDefaultInstance();
555 throw newUninitializedMessageException(result);
563 if (bitField0_ != 0) { buildPartial0(result); }
568 private void buildPartial0(com.google.ortools.sat.LinearBooleanConstraint result) {
569 int from_bitField0_ = bitField0_;
570 if (((from_bitField0_ & 0x00000001) != 0)) {
571 literals_.makeImmutable();
572 result.literals_ = literals_;
574 if (((from_bitField0_ & 0x00000002) != 0)) {
575 coefficients_.makeImmutable();
576 result.coefficients_ = coefficients_;
578 int to_bitField0_ = 0;
579 if (((from_bitField0_ & 0x00000004) != 0)) {
580 result.lowerBound_ = lowerBound_;
581 to_bitField0_ |= 0x00000001;
583 if (((from_bitField0_ & 0x00000008) != 0)) {
584 result.upperBound_ = upperBound_;
585 to_bitField0_ |= 0x00000002;
587 if (((from_bitField0_ & 0x00000010) != 0)) {
588 result.name_ = name_;
589 to_bitField0_ |= 0x00000004;
591 result.bitField0_ |= to_bitField0_;
596 if (other instanceof com.google.ortools.sat.LinearBooleanConstraint) {
597 return mergeFrom((com.google.ortools.sat.LinearBooleanConstraint)other);
599 super.mergeFrom(other);
605 if (other == com.google.ortools.sat.LinearBooleanConstraint.getDefaultInstance())
return this;
606 if (!other.literals_.isEmpty()) {
607 if (literals_.isEmpty()) {
608 literals_ = other.literals_;
609 literals_.makeImmutable();
610 bitField0_ |= 0x00000001;
612 ensureLiteralsIsMutable();
613 literals_.addAll(other.literals_);
617 if (!other.coefficients_.isEmpty()) {
618 if (coefficients_.isEmpty()) {
619 coefficients_ = other.coefficients_;
620 coefficients_.makeImmutable();
621 bitField0_ |= 0x00000002;
623 ensureCoefficientsIsMutable();
624 coefficients_.addAll(other.coefficients_);
628 if (other.hasLowerBound()) {
631 if (other.hasUpperBound()) {
634 if (other.hasName()) {
636 bitField0_ |= 0x00000010;
639 this.mergeUnknownFields(other.getUnknownFields());
651 com.google.protobuf.CodedInputStream input,
652 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
653 throws java.io.IOException {
654 if (extensionRegistry ==
null) {
655 throw new java.lang.NullPointerException();
658 boolean done =
false;
660 int tag = input.readTag();
666 int v = input.readInt32();
667 ensureLiteralsIsMutable();
672 int length = input.readRawVarint32();
673 int limit = input.pushLimit(length);
674 ensureLiteralsIsMutable();
675 while (input.getBytesUntilLimit() > 0) {
676 literals_.addInt(input.readInt32());
678 input.popLimit(limit);
682 long v = input.readInt64();
683 ensureCoefficientsIsMutable();
684 coefficients_.addLong(v);
688 int length = input.readRawVarint32();
689 int limit = input.pushLimit(length);
690 ensureCoefficientsIsMutable();
691 while (input.getBytesUntilLimit() > 0) {
692 coefficients_.addLong(input.readInt64());
694 input.popLimit(limit);
698 lowerBound_ = input.readInt64();
699 bitField0_ |= 0x00000004;
703 upperBound_ = input.readInt64();
704 bitField0_ |= 0x00000008;
708 name_ = input.readBytes();
709 bitField0_ |= 0x00000010;
713 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
720 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
721 throw e.unwrapIOException();
727 private int bitField0_;
729 private com.google.protobuf.Internal.IntList literals_ = emptyIntList();
730 private void ensureLiteralsIsMutable() {
731 if (!literals_.isModifiable()) {
732 literals_ = makeMutableCopy(literals_);
734 bitField0_ |= 0x00000001;
752 public java.util.List<java.lang.Integer>
754 literals_.makeImmutable();
774 return literals_.size();
794 return literals_.getInt(index);
815 int index,
int value) {
817 ensureLiteralsIsMutable();
818 literals_.setInt(index, value);
819 bitField0_ |= 0x00000001;
842 ensureLiteralsIsMutable();
843 literals_.addInt(value);
844 bitField0_ |= 0x00000001;
866 java.lang.Iterable<? extends java.lang.Integer> values) {
867 ensureLiteralsIsMutable();
868 com.google.protobuf.AbstractMessageLite.Builder.addAll(
870 bitField0_ |= 0x00000001;
891 literals_ = emptyIntList();
892 bitField0_ = (bitField0_ & ~0x00000001);
897 private com.google.protobuf.Internal.LongList coefficients_ = emptyLongList();
898 private void ensureCoefficientsIsMutable() {
899 if (!coefficients_.isModifiable()) {
900 coefficients_ = makeMutableCopy(coefficients_);
902 bitField0_ |= 0x00000002;
908 public java.util.List<java.lang.Long>
910 coefficients_.makeImmutable();
911 return coefficients_;
918 return coefficients_.size();
926 return coefficients_.getLong(index);
935 int index,
long value) {
937 ensureCoefficientsIsMutable();
938 coefficients_.setLong(index, value);
939 bitField0_ |= 0x00000002;
950 ensureCoefficientsIsMutable();
951 coefficients_.addLong(value);
952 bitField0_ |= 0x00000002;
962 java.lang.Iterable<? extends java.lang.Long> values) {
963 ensureCoefficientsIsMutable();
964 com.google.protobuf.AbstractMessageLite.Builder.addAll(
965 values, coefficients_);
966 bitField0_ |= 0x00000002;
975 coefficients_ = emptyLongList();
976 bitField0_ = (bitField0_ & ~0x00000002);
981 private long lowerBound_ ;
994 return ((bitField0_ & 0x00000004) != 0);
1023 lowerBound_ = value;
1024 bitField0_ |= 0x00000004;
1039 bitField0_ = (bitField0_ & ~0x00000004);
1045 private long upperBound_ ;
1052 return ((bitField0_ & 0x00000008) != 0);
1069 upperBound_ = value;
1070 bitField0_ |= 0x00000008;
1079 bitField0_ = (bitField0_ & ~0x00000008);
1085 private java.lang.Object name_ =
"";
1095 return ((bitField0_ & 0x00000010) != 0);
1106 java.lang.Object ref = name_;
1107 if (!(ref instanceof java.lang.String)) {
1108 com.google.protobuf.ByteString bs =
1109 (com.google.protobuf.ByteString) ref;
1110 java.lang.String s = bs.toStringUtf8();
1111 if (bs.isValidUtf8()) {
1116 return (java.lang.String) ref;
1127 public com.google.protobuf.ByteString
1129 java.lang.Object ref = name_;
1130 if (ref instanceof String) {
1131 com.google.protobuf.ByteString b =
1132 com.google.protobuf.ByteString.copyFromUtf8(
1133 (java.lang.String) ref);
1137 return (com.google.protobuf.ByteString) ref;
1150 java.lang.String value) {
1151 if (value ==
null) {
throw new NullPointerException(); }
1153 bitField0_ |= 0x00000010;
1167 bitField0_ = (bitField0_ & ~0x00000010);
1181 com.google.protobuf.ByteString value) {
1182 if (value ==
null) {
throw new NullPointerException(); }
1184 bitField0_ |= 0x00000010;
1195 DEFAULT_INSTANCE =
new com.google.ortools.sat.LinearBooleanConstraint();
1199 return DEFAULT_INSTANCE;
1206 com.google.protobuf.CodedInputStream input,
1207 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1208 throws com.google.protobuf.InvalidProtocolBufferException {
1211 builder.mergeFrom(input, extensionRegistry);
1212 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
1213 throw e.setUnfinishedMessage(builder.buildPartial());
1214 }
catch (com.google.protobuf.UninitializedMessageException e) {
1215 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1216 }
catch (java.io.IOException e) {
1217 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1218 .setUnfinishedMessage(builder.buildPartial());
1220 return builder.buildPartial();
1235 return DEFAULT_INSTANCE;