6package com.google.ortools.sat;
18@com.google.protobuf.Generated
19public final class LinearBooleanConstraint
extends
20 com.google.protobuf.GeneratedMessage implements
23private static final long serialVersionUID = 0L;
25 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
26 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
31 LinearBooleanConstraint.class.getName());
34 private LinearBooleanConstraint(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
37 private LinearBooleanConstraint() {
38 literals_ = emptyIntList();
39 coefficients_ = emptyLongList();
43 public static final com.google.protobuf.Descriptors.Descriptor
45 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearBooleanConstraint_descriptor;
49 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
51 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearBooleanConstraint_fieldAccessorTable
52 .ensureFieldAccessorsInitialized(
53 com.google.ortools.sat.LinearBooleanConstraint.class, com.google.ortools.sat.LinearBooleanConstraint.Builder.class);
56 private int bitField0_;
58 @SuppressWarnings(
"serial")
59 private com.google.protobuf.Internal.IntList literals_ =
78 public java.
util.List<java.lang.Integer>
99 return literals_.size();
119 return literals_.getInt(index);
123 @SuppressWarnings(
"serial")
124 private com.google.protobuf.Internal.LongList coefficients_ =
131 public java.
util.List<java.lang.Long>
133 return coefficients_;
140 return coefficients_.size();
148 return coefficients_.getLong(index);
152 private long lowerBound_ = 0L;
165 return ((bitField0_ & 0x00000001) != 0);
183 private long upperBound_ = 0L;
190 return ((bitField0_ & 0x00000002) != 0);
202 @SuppressWarnings(
"serial")
203 private volatile java.lang.Object name_ =
"";
214 return ((bitField0_ & 0x00000004) != 0);
226 java.lang.Object ref = name_;
227 if (ref instanceof java.lang.String) {
228 return (java.lang.String) ref;
230 com.google.protobuf.ByteString bs =
231 (com.google.protobuf.ByteString) ref;
232 java.lang.String s = bs.toStringUtf8();
233 if (bs.isValidUtf8()) {
248 public com.google.protobuf.ByteString
250 java.lang.Object ref = name_;
251 if (ref instanceof java.lang.String) {
252 com.google.protobuf.ByteString b =
253 com.google.protobuf.ByteString.copyFromUtf8(
254 (java.lang.String) ref);
258 return (com.google.protobuf.ByteString) ref;
262 private byte memoizedIsInitialized = -1;
269 memoizedIsInitialized = 1;
274 public void writeTo(com.google.protobuf.CodedOutputStream output)
275 throws java.io.IOException {
276 for (
int i = 0; i < literals_.size(); i++) {
277 output.writeInt32(1, literals_.getInt(i));
279 for (
int i = 0; i < coefficients_.size(); i++) {
280 output.writeInt64(2, coefficients_.getLong(i));
282 if (((bitField0_ & 0x00000001) != 0)) {
283 output.writeInt64(3, lowerBound_);
285 if (((bitField0_ & 0x00000002) != 0)) {
286 output.writeInt64(4, upperBound_);
288 if (((bitField0_ & 0x00000004) != 0)) {
289 com.google.protobuf.GeneratedMessage.writeString(output, 5, name_);
291 getUnknownFields().writeTo(output);
296 int size = memoizedSize;
297 if (size != -1)
return size;
302 for (
int i = 0; i < literals_.size(); i++) {
303 dataSize += com.google.protobuf.CodedOutputStream
304 .computeInt32SizeNoTag(literals_.getInt(i));
311 for (
int i = 0; i < coefficients_.size(); i++) {
312 dataSize += com.google.protobuf.CodedOutputStream
313 .computeInt64SizeNoTag(coefficients_.getLong(i));
318 if (((bitField0_ & 0x00000001) != 0)) {
319 size += com.google.protobuf.CodedOutputStream
320 .computeInt64Size(3, lowerBound_);
322 if (((bitField0_ & 0x00000002) != 0)) {
323 size += com.google.protobuf.CodedOutputStream
324 .computeInt64Size(4, upperBound_);
326 if (((bitField0_ & 0x00000004) != 0)) {
327 size += com.google.protobuf.GeneratedMessage.computeStringSize(5, name_);
329 size += getUnknownFields().getSerializedSize();
335 public boolean equals(
final java.lang.Object obj) {
339 if (!(obj instanceof com.google.ortools.sat.LinearBooleanConstraint)) {
340 return super.equals(obj);
363 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
369 if (memoizedHashCode != 0) {
370 return memoizedHashCode;
384 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
389 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
394 hash = (53 * hash) +
getName().hashCode();
396 hash = (29 * hash) + getUnknownFields().hashCode();
397 memoizedHashCode = hash;
402 java.nio.ByteBuffer data)
403 throws com.google.protobuf.InvalidProtocolBufferException {
404 return PARSER.parseFrom(data);
407 java.nio.ByteBuffer data,
408 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
409 throws com.google.protobuf.InvalidProtocolBufferException {
410 return PARSER.parseFrom(data, extensionRegistry);
413 com.google.protobuf.ByteString data)
414 throws com.google.protobuf.InvalidProtocolBufferException {
415 return PARSER.parseFrom(data);
418 com.google.protobuf.ByteString data,
419 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
420 throws com.google.protobuf.InvalidProtocolBufferException {
421 return PARSER.parseFrom(data, extensionRegistry);
424 throws com.google.protobuf.InvalidProtocolBufferException {
425 return PARSER.parseFrom(data);
429 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
430 throws com.google.protobuf.InvalidProtocolBufferException {
431 return PARSER.parseFrom(data, extensionRegistry);
434 throws java.io.IOException {
435 return com.google.protobuf.GeneratedMessage
436 .parseWithIOException(PARSER, input);
439 java.io.InputStream input,
440 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
441 throws java.io.IOException {
442 return com.google.protobuf.GeneratedMessage
443 .parseWithIOException(PARSER, input, extensionRegistry);
447 throws java.io.IOException {
448 return com.google.protobuf.GeneratedMessage
449 .parseDelimitedWithIOException(PARSER, input);
453 java.io.InputStream input,
454 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
455 throws java.io.IOException {
456 return com.google.protobuf.GeneratedMessage
457 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
460 com.google.protobuf.CodedInputStream input)
461 throws java.io.IOException {
462 return com.google.protobuf.GeneratedMessage
463 .parseWithIOException(PARSER, input);
466 com.google.protobuf.CodedInputStream input,
467 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
468 throws java.io.IOException {
469 return com.google.protobuf.GeneratedMessage
470 .parseWithIOException(PARSER, input, extensionRegistry);
476 return DEFAULT_INSTANCE.toBuilder();
479 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
483 return this == DEFAULT_INSTANCE
489 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
503 public static final class Builder
extends
504 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
507 public static final com.google.protobuf.Descriptors.Descriptor
509 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearBooleanConstraint_descriptor;
513 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
515 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearBooleanConstraint_fieldAccessorTable
516 .ensureFieldAccessorsInitialized(
517 com.google.ortools.sat.LinearBooleanConstraint.class, com.google.ortools.sat.LinearBooleanConstraint.Builder.class);
526 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
534 literals_ = emptyIntList();
535 coefficients_ = emptyLongList();
543 public com.google.protobuf.Descriptors.Descriptor
545 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_LinearBooleanConstraint_descriptor;
550 return com.google.ortools.sat.LinearBooleanConstraint.getDefaultInstance();
557 throw newUninitializedMessageException(result);
565 if (bitField0_ != 0) { buildPartial0(result); }
570 private void buildPartial0(com.google.ortools.sat.LinearBooleanConstraint result) {
571 int from_bitField0_ = bitField0_;
572 if (((from_bitField0_ & 0x00000001) != 0)) {
573 literals_.makeImmutable();
574 result.literals_ = literals_;
576 if (((from_bitField0_ & 0x00000002) != 0)) {
577 coefficients_.makeImmutable();
578 result.coefficients_ = coefficients_;
580 int to_bitField0_ = 0;
581 if (((from_bitField0_ & 0x00000004) != 0)) {
582 result.lowerBound_ = lowerBound_;
583 to_bitField0_ |= 0x00000001;
585 if (((from_bitField0_ & 0x00000008) != 0)) {
586 result.upperBound_ = upperBound_;
587 to_bitField0_ |= 0x00000002;
589 if (((from_bitField0_ & 0x00000010) != 0)) {
590 result.name_ = name_;
591 to_bitField0_ |= 0x00000004;
593 result.bitField0_ |= to_bitField0_;
597 public Builder
mergeFrom(com.google.protobuf.Message other) {
598 if (other instanceof com.google.ortools.sat.LinearBooleanConstraint) {
599 return mergeFrom((com.google.ortools.sat.LinearBooleanConstraint)other);
601 super.mergeFrom(other);
606 public Builder
mergeFrom(com.google.ortools.sat.LinearBooleanConstraint other) {
607 if (other == com.google.ortools.sat.LinearBooleanConstraint.getDefaultInstance())
return this;
608 if (!other.literals_.isEmpty()) {
609 if (literals_.isEmpty()) {
610 literals_ = other.literals_;
611 literals_.makeImmutable();
612 bitField0_ |= 0x00000001;
614 ensureLiteralsIsMutable();
615 literals_.addAll(other.literals_);
619 if (!other.coefficients_.isEmpty()) {
620 if (coefficients_.isEmpty()) {
621 coefficients_ = other.coefficients_;
622 coefficients_.makeImmutable();
623 bitField0_ |= 0x00000002;
625 ensureCoefficientsIsMutable();
626 coefficients_.addAll(other.coefficients_);
630 if (other.hasLowerBound()) {
633 if (other.hasUpperBound()) {
636 if (other.hasName()) {
638 bitField0_ |= 0x00000010;
641 this.mergeUnknownFields(other.getUnknownFields());
653 com.google.protobuf.CodedInputStream input,
654 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
655 throws java.io.IOException {
656 if (extensionRegistry ==
null) {
657 throw new java.lang.NullPointerException();
660 boolean done =
false;
662 int tag = input.readTag();
668 int v = input.readInt32();
669 ensureLiteralsIsMutable();
674 int length = input.readRawVarint32();
675 int limit = input.pushLimit(length);
676 ensureLiteralsIsMutable();
677 while (input.getBytesUntilLimit() > 0) {
678 literals_.addInt(input.readInt32());
680 input.popLimit(limit);
684 long v = input.readInt64();
685 ensureCoefficientsIsMutable();
686 coefficients_.addLong(v);
690 int length = input.readRawVarint32();
691 int limit = input.pushLimit(length);
692 ensureCoefficientsIsMutable();
693 while (input.getBytesUntilLimit() > 0) {
694 coefficients_.addLong(input.readInt64());
696 input.popLimit(limit);
700 lowerBound_ = input.readInt64();
701 bitField0_ |= 0x00000004;
705 upperBound_ = input.readInt64();
706 bitField0_ |= 0x00000008;
710 name_ = input.readBytes();
711 bitField0_ |= 0x00000010;
715 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
722 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
723 throw e.unwrapIOException();
729 private int bitField0_;
731 private com.google.protobuf.Internal.IntList literals_ = emptyIntList();
732 private void ensureLiteralsIsMutable() {
733 if (!literals_.isModifiable()) {
734 literals_ = makeMutableCopy(literals_);
736 bitField0_ |= 0x00000001;
754 public java.util.List<java.lang.Integer>
756 literals_.makeImmutable();
776 return literals_.size();
796 return literals_.getInt(index);
817 int index,
int value) {
819 ensureLiteralsIsMutable();
820 literals_.setInt(index, value);
821 bitField0_ |= 0x00000001;
844 ensureLiteralsIsMutable();
845 literals_.addInt(value);
846 bitField0_ |= 0x00000001;
868 java.lang.Iterable<? extends java.lang.Integer> values) {
869 ensureLiteralsIsMutable();
870 com.google.protobuf.AbstractMessageLite.Builder.addAll(
872 bitField0_ |= 0x00000001;
893 literals_ = emptyIntList();
894 bitField0_ = (bitField0_ & ~0x00000001);
899 private com.google.protobuf.Internal.LongList coefficients_ = emptyLongList();
900 private void ensureCoefficientsIsMutable() {
901 if (!coefficients_.isModifiable()) {
902 coefficients_ = makeMutableCopy(coefficients_);
904 bitField0_ |= 0x00000002;
910 public java.util.List<java.lang.Long>
912 coefficients_.makeImmutable();
913 return coefficients_;
920 return coefficients_.size();
928 return coefficients_.getLong(index);
937 int index,
long value) {
939 ensureCoefficientsIsMutable();
940 coefficients_.setLong(index, value);
941 bitField0_ |= 0x00000002;
952 ensureCoefficientsIsMutable();
953 coefficients_.addLong(value);
954 bitField0_ |= 0x00000002;
964 java.lang.Iterable<? extends java.lang.Long> values) {
965 ensureCoefficientsIsMutable();
966 com.google.protobuf.AbstractMessageLite.Builder.addAll(
967 values, coefficients_);
968 bitField0_ |= 0x00000002;
977 coefficients_ = emptyLongList();
978 bitField0_ = (bitField0_ & ~0x00000002);
983 private long lowerBound_ ;
996 return ((bitField0_ & 0x00000004) != 0);
1025 lowerBound_ = value;
1026 bitField0_ |= 0x00000004;
1041 bitField0_ = (bitField0_ & ~0x00000004);
1047 private long upperBound_ ;
1054 return ((bitField0_ & 0x00000008) != 0);
1071 upperBound_ = value;
1072 bitField0_ |= 0x00000008;
1081 bitField0_ = (bitField0_ & ~0x00000008);
1087 private java.lang.Object name_ =
"";
1097 return ((bitField0_ & 0x00000010) != 0);
1108 java.lang.Object ref = name_;
1109 if (!(ref instanceof java.lang.String)) {
1110 com.google.protobuf.ByteString bs =
1111 (com.google.protobuf.ByteString) ref;
1112 java.lang.String s = bs.toStringUtf8();
1113 if (bs.isValidUtf8()) {
1118 return (java.lang.String) ref;
1129 public com.google.protobuf.ByteString
1131 java.lang.Object ref = name_;
1132 if (ref instanceof String) {
1133 com.google.protobuf.ByteString b =
1134 com.google.protobuf.ByteString.copyFromUtf8(
1135 (java.lang.String) ref);
1139 return (com.google.protobuf.ByteString) ref;
1152 java.lang.String value) {
1153 if (value ==
null) {
throw new NullPointerException(); }
1155 bitField0_ |= 0x00000010;
1169 bitField0_ = (bitField0_ & ~0x00000010);
1183 com.google.protobuf.ByteString value) {
1184 if (value ==
null) {
throw new NullPointerException(); }
1186 bitField0_ |= 0x00000010;
1197 DEFAULT_INSTANCE =
new com.google.ortools.sat.LinearBooleanConstraint();
1201 return DEFAULT_INSTANCE;
1208 com.google.protobuf.CodedInputStream input,
1209 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1210 throws com.google.protobuf.InvalidProtocolBufferException {
1213 builder.mergeFrom(input, extensionRegistry);
1214 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
1215 throw e.setUnfinishedMessage(builder.buildPartial());
1216 }
catch (com.google.protobuf.UninitializedMessageException e) {
1217 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1218 }
catch (java.io.IOException e) {
1219 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1220 .setUnfinishedMessage(builder.buildPartial());
1222 return builder.buildPartial();
1226 public static com.google.protobuf.Parser<LinearBooleanConstraint>
parser() {
1237 return DEFAULT_INSTANCE;