5package com.google.ortools.sat;
18 com.google.protobuf.GeneratedMessageV3 implements
21private static final long serialVersionUID = 0L;
27 literals_ = emptyIntList();
28 coefficients_ = emptyLongList();
33 @SuppressWarnings({
"unused"})
35 UnusedPrivateParameter unused) {
39 public static final com.google.protobuf.Descriptors.Descriptor
41 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearBooleanConstraint_descriptor;
45 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
47 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearBooleanConstraint_fieldAccessorTable
48 .ensureFieldAccessorsInitialized(
49 com.google.ortools.sat.LinearBooleanConstraint.class, com.google.ortools.sat.LinearBooleanConstraint.Builder.class);
52 private int bitField0_;
54 @SuppressWarnings(
"serial")
55 private com.google.protobuf.Internal.IntList literals_ =
74 public java.util.List<java.lang.Integer>
95 return literals_.size();
115 return literals_.getInt(index);
119 @SuppressWarnings(
"serial")
120 private com.google.protobuf.Internal.LongList coefficients_ =
127 public java.util.List<java.lang.Long>
129 return coefficients_;
136 return coefficients_.size();
144 return coefficients_.getLong(index);
148 private long lowerBound_ = 0L;
161 return ((bitField0_ & 0x00000001) != 0);
179 private long upperBound_ = 0L;
186 return ((bitField0_ & 0x00000002) != 0);
198 @SuppressWarnings(
"serial")
199 private volatile java.lang.Object name_ = "";
210 return ((bitField0_ & 0x00000004) != 0);
222 java.lang.Object ref = name_;
223 if (ref instanceof java.lang.String) {
224 return (java.lang.String) ref;
226 com.google.protobuf.ByteString bs =
227 (com.google.protobuf.ByteString) ref;
228 java.lang.String s = bs.toStringUtf8();
229 if (bs.isValidUtf8()) {
244 public com.google.protobuf.ByteString
246 java.lang.Object ref = name_;
247 if (ref instanceof java.lang.String) {
248 com.google.protobuf.ByteString b =
249 com.google.protobuf.ByteString.copyFromUtf8(
250 (java.lang.String) ref);
254 return (com.google.protobuf.ByteString) ref;
258 private byte memoizedIsInitialized = -1;
265 memoizedIsInitialized = 1;
270 public void writeTo(com.google.protobuf.CodedOutputStream output)
271 throws java.io.IOException {
272 for (
int i = 0; i < literals_.size(); i++) {
273 output.writeInt32(1, literals_.getInt(i));
275 for (
int i = 0; i < coefficients_.size(); i++) {
276 output.writeInt64(2, coefficients_.getLong(i));
278 if (((bitField0_ & 0x00000001) != 0)) {
279 output.writeInt64(3, lowerBound_);
281 if (((bitField0_ & 0x00000002) != 0)) {
282 output.writeInt64(4, upperBound_);
284 if (((bitField0_ & 0x00000004) != 0)) {
285 com.google.protobuf.GeneratedMessageV3.writeString(output, 5, name_);
287 getUnknownFields().writeTo(output);
292 int size = memoizedSize;
293 if (size != -1)
return size;
298 for (
int i = 0; i < literals_.size(); i++) {
299 dataSize += com.google.protobuf.CodedOutputStream
300 .computeInt32SizeNoTag(literals_.getInt(i));
307 for (
int i = 0; i < coefficients_.size(); i++) {
308 dataSize += com.google.protobuf.CodedOutputStream
309 .computeInt64SizeNoTag(coefficients_.getLong(i));
314 if (((bitField0_ & 0x00000001) != 0)) {
315 size += com.google.protobuf.CodedOutputStream
316 .computeInt64Size(3, lowerBound_);
318 if (((bitField0_ & 0x00000002) != 0)) {
319 size += com.google.protobuf.CodedOutputStream
320 .computeInt64Size(4, upperBound_);
322 if (((bitField0_ & 0x00000004) != 0)) {
323 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, name_);
325 size += getUnknownFields().getSerializedSize();
331 public boolean equals(
final java.lang.Object obj) {
335 if (!(obj instanceof com.google.ortools.sat.LinearBooleanConstraint)) {
336 return super.equals(obj);
357 .equals(other.
getName()))
return false;
359 if (!getUnknownFields().equals(other.getUnknownFields()))
return false;
365 if (memoizedHashCode != 0) {
366 return memoizedHashCode;
380 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
385 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
390 hash = (53 * hash) +
getName().hashCode();
392 hash = (29 * hash) + getUnknownFields().hashCode();
393 memoizedHashCode = hash;
398 java.nio.ByteBuffer data)
399 throws com.google.protobuf.InvalidProtocolBufferException {
403 java.nio.ByteBuffer data,
404 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
405 throws com.google.protobuf.InvalidProtocolBufferException {
409 com.google.protobuf.ByteString data)
410 throws com.google.protobuf.InvalidProtocolBufferException {
414 com.google.protobuf.ByteString data,
415 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
416 throws com.google.protobuf.InvalidProtocolBufferException {
420 throws com.google.protobuf.InvalidProtocolBufferException {
425 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
426 throws com.google.protobuf.InvalidProtocolBufferException {
430 throws java.io.IOException {
431 return com.google.protobuf.GeneratedMessageV3
432 .parseWithIOException(
PARSER, input);
435 java.io.InputStream input,
436 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
437 throws java.io.IOException {
438 return com.google.protobuf.GeneratedMessageV3
439 .parseWithIOException(
PARSER, input, extensionRegistry);
443 throws java.io.IOException {
444 return com.google.protobuf.GeneratedMessageV3
445 .parseDelimitedWithIOException(
PARSER, input);
449 java.io.InputStream input,
450 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
451 throws java.io.IOException {
452 return com.google.protobuf.GeneratedMessageV3
453 .parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
456 com.google.protobuf.CodedInputStream input)
457 throws java.io.IOException {
458 return com.google.protobuf.GeneratedMessageV3
459 .parseWithIOException(
PARSER, input);
462 com.google.protobuf.CodedInputStream input,
463 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
464 throws java.io.IOException {
465 return com.google.protobuf.GeneratedMessageV3
466 .parseWithIOException(
PARSER, input, extensionRegistry);
479 return this == DEFAULT_INSTANCE
485 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
500 com.google.protobuf.GeneratedMessageV3.
Builder<Builder> implements
503 public static final com.google.protobuf.Descriptors.Descriptor
505 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearBooleanConstraint_descriptor;
509 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
511 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearBooleanConstraint_fieldAccessorTable
512 .ensureFieldAccessorsInitialized(
513 com.google.ortools.sat.LinearBooleanConstraint.class, com.google.ortools.sat.LinearBooleanConstraint.Builder.class);
522 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
530 literals_ = emptyIntList();
531 coefficients_ = emptyLongList();
539 public com.google.protobuf.Descriptors.Descriptor
541 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearBooleanConstraint_descriptor;
546 return com.google.ortools.sat.LinearBooleanConstraint.getDefaultInstance();
553 throw newUninitializedMessageException(result);
561 if (bitField0_ != 0) { buildPartial0(result); }
566 private void buildPartial0(com.google.ortools.sat.LinearBooleanConstraint result) {
567 int from_bitField0_ = bitField0_;
568 if (((from_bitField0_ & 0x00000001) != 0)) {
569 literals_.makeImmutable();
570 result.literals_ = literals_;
572 if (((from_bitField0_ & 0x00000002) != 0)) {
573 coefficients_.makeImmutable();
574 result.coefficients_ = coefficients_;
576 int to_bitField0_ = 0;
577 if (((from_bitField0_ & 0x00000004) != 0)) {
578 result.lowerBound_ = lowerBound_;
579 to_bitField0_ |= 0x00000001;
581 if (((from_bitField0_ & 0x00000008) != 0)) {
582 result.upperBound_ = upperBound_;
583 to_bitField0_ |= 0x00000002;
585 if (((from_bitField0_ & 0x00000010) != 0)) {
586 result.name_ = name_;
587 to_bitField0_ |= 0x00000004;
589 result.bitField0_ |= to_bitField0_;
594 return super.
clone();
598 com.google.protobuf.Descriptors.FieldDescriptor field,
599 java.lang.Object value) {
600 return super.
setField(field, value);
604 com.google.protobuf.Descriptors.FieldDescriptor field) {
609 com.google.protobuf.Descriptors.OneofDescriptor oneof) {
614 com.google.protobuf.Descriptors.FieldDescriptor field,
615 int index, java.lang.Object value) {
620 com.google.protobuf.Descriptors.FieldDescriptor field,
621 java.lang.Object value) {
626 if (other instanceof com.google.ortools.sat.LinearBooleanConstraint) {
627 return mergeFrom((com.google.ortools.sat.LinearBooleanConstraint)other);
629 super.mergeFrom(other);
635 if (other == com.google.ortools.sat.LinearBooleanConstraint.getDefaultInstance())
return this;
636 if (!other.literals_.isEmpty()) {
637 if (literals_.isEmpty()) {
638 literals_ = other.literals_;
639 literals_.makeImmutable();
640 bitField0_ |= 0x00000001;
642 ensureLiteralsIsMutable();
643 literals_.addAll(other.literals_);
647 if (!other.coefficients_.isEmpty()) {
648 if (coefficients_.isEmpty()) {
649 coefficients_ = other.coefficients_;
650 coefficients_.makeImmutable();
651 bitField0_ |= 0x00000002;
653 ensureCoefficientsIsMutable();
654 coefficients_.addAll(other.coefficients_);
658 if (other.hasLowerBound()) {
661 if (other.hasUpperBound()) {
664 if (other.hasName()) {
666 bitField0_ |= 0x00000010;
681 com.google.protobuf.CodedInputStream input,
682 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
683 throws java.io.IOException {
684 if (extensionRegistry ==
null) {
685 throw new java.lang.NullPointerException();
688 boolean done =
false;
690 int tag = input.readTag();
696 int v = input.readInt32();
697 ensureLiteralsIsMutable();
702 int length = input.readRawVarint32();
703 int limit = input.pushLimit(length);
704 ensureLiteralsIsMutable();
705 while (input.getBytesUntilLimit() > 0) {
706 literals_.addInt(input.readInt32());
708 input.popLimit(limit);
712 long v = input.readInt64();
713 ensureCoefficientsIsMutable();
714 coefficients_.addLong(v);
718 int length = input.readRawVarint32();
719 int limit = input.pushLimit(length);
720 ensureCoefficientsIsMutable();
721 while (input.getBytesUntilLimit() > 0) {
722 coefficients_.addLong(input.readInt64());
724 input.popLimit(limit);
728 lowerBound_ = input.readInt64();
729 bitField0_ |= 0x00000004;
733 upperBound_ = input.readInt64();
734 bitField0_ |= 0x00000008;
738 name_ = input.readBytes();
739 bitField0_ |= 0x00000010;
743 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
750 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
751 throw e.unwrapIOException();
757 private int bitField0_;
759 private com.google.protobuf.Internal.IntList literals_ = emptyIntList();
760 private void ensureLiteralsIsMutable() {
761 if (!literals_.isModifiable()) {
762 literals_ = makeMutableCopy(literals_);
764 bitField0_ |= 0x00000001;
782 public java.util.List<java.lang.Integer>
784 literals_.makeImmutable();
804 return literals_.size();
824 return literals_.getInt(index);
845 int index,
int value) {
847 ensureLiteralsIsMutable();
848 literals_.setInt(index, value);
849 bitField0_ |= 0x00000001;
872 ensureLiteralsIsMutable();
873 literals_.addInt(value);
874 bitField0_ |= 0x00000001;
896 java.lang.Iterable<? extends java.lang.Integer> values) {
897 ensureLiteralsIsMutable();
898 com.google.protobuf.AbstractMessageLite.Builder.addAll(
900 bitField0_ |= 0x00000001;
921 literals_ = emptyIntList();
922 bitField0_ = (bitField0_ & ~0x00000001);
927 private com.google.protobuf.Internal.LongList coefficients_ = emptyLongList();
928 private void ensureCoefficientsIsMutable() {
929 if (!coefficients_.isModifiable()) {
930 coefficients_ = makeMutableCopy(coefficients_);
932 bitField0_ |= 0x00000002;
938 public java.util.List<java.lang.Long>
940 coefficients_.makeImmutable();
941 return coefficients_;
948 return coefficients_.size();
956 return coefficients_.getLong(index);
965 int index,
long value) {
967 ensureCoefficientsIsMutable();
968 coefficients_.setLong(index, value);
969 bitField0_ |= 0x00000002;
980 ensureCoefficientsIsMutable();
981 coefficients_.addLong(value);
982 bitField0_ |= 0x00000002;
992 java.lang.Iterable<? extends java.lang.Long> values) {
993 ensureCoefficientsIsMutable();
994 com.google.protobuf.AbstractMessageLite.Builder.addAll(
995 values, coefficients_);
996 bitField0_ |= 0x00000002;
1005 coefficients_ = emptyLongList();
1006 bitField0_ = (bitField0_ & ~0x00000002);
1011 private long lowerBound_ ;
1024 return ((bitField0_ & 0x00000004) != 0);
1053 lowerBound_ = value;
1054 bitField0_ |= 0x00000004;
1069 bitField0_ = (bitField0_ & ~0x00000004);
1075 private long upperBound_ ;
1082 return ((bitField0_ & 0x00000008) != 0);
1099 upperBound_ = value;
1100 bitField0_ |= 0x00000008;
1109 bitField0_ = (bitField0_ & ~0x00000008);
1115 private java.lang.Object name_ =
"";
1125 return ((bitField0_ & 0x00000010) != 0);
1136 java.lang.Object ref = name_;
1137 if (!(ref instanceof java.lang.String)) {
1138 com.google.protobuf.ByteString bs =
1139 (com.google.protobuf.ByteString) ref;
1140 java.lang.String s = bs.toStringUtf8();
1141 if (bs.isValidUtf8()) {
1146 return (java.lang.String) ref;
1157 public com.google.protobuf.ByteString
1159 java.lang.Object ref = name_;
1160 if (ref instanceof String) {
1161 com.google.protobuf.ByteString b =
1162 com.google.protobuf.ByteString.copyFromUtf8(
1163 (java.lang.String) ref);
1167 return (com.google.protobuf.ByteString) ref;
1180 java.lang.String value) {
1181 if (value ==
null) {
throw new NullPointerException(); }
1183 bitField0_ |= 0x00000010;
1197 bitField0_ = (bitField0_ & ~0x00000010);
1211 com.google.protobuf.ByteString value) {
1212 if (value ==
null) {
throw new NullPointerException(); }
1214 bitField0_ |= 0x00000010;
1220 final com.google.protobuf.UnknownFieldSet unknownFields) {
1226 final com.google.protobuf.UnknownFieldSet unknownFields) {
1237 DEFAULT_INSTANCE =
new com.google.ortools.sat.LinearBooleanConstraint();
1241 return DEFAULT_INSTANCE;
1248 com.google.protobuf.CodedInputStream input,
1249 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1250 throws com.google.protobuf.InvalidProtocolBufferException {
1253 builder.
mergeFrom(input, extensionRegistry);
1254 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
1256 }
catch (com.google.protobuf.UninitializedMessageException e) {
1257 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.
buildPartial());
1258 }
catch (java.io.IOException e) {
1259 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1277 return DEFAULT_INSTANCE;