5package com.google.ortools.linearsolver;
17 com.google.protobuf.GeneratedMessageV3 implements
20private static final long serialVersionUID = 0L;
22 private MPSosConstraint(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
27 varIndex_ = emptyIntList();
28 weight_ = emptyDoubleList();
32 @SuppressWarnings({
"unused"})
34 UnusedPrivateParameter unused) {
38 public static final com.google.protobuf.Descriptors.Descriptor
40 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_descriptor;
44 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
46 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_fieldAccessorTable
47 .ensureFieldAccessorsInitialized(
48 com.google.ortools.linearsolver.MPSosConstraint.class, com.google.ortools.linearsolver.MPSosConstraint.Builder.class);
55 implements com.google.protobuf.ProtocolMessageEnum {
83 public static final int SOS1_DEFAULT_VALUE = 0;
93 public static final int SOS2_VALUE = 1;
105 @java.lang.Deprecated
107 return forNumber(value);
116 case 0:
return SOS1_DEFAULT;
118 default:
return null;
122 public static com.google.protobuf.Internal.EnumLiteMap<
Type>
124 return internalValueMap;
126 private static final com.google.protobuf.Internal.EnumLiteMap<
127 Type> internalValueMap =
128 new com.google.protobuf.Internal.EnumLiteMap<
Type>() {
129 public Type findValueByNumber(
int number) {
134 public final com.google.protobuf.Descriptors.EnumValueDescriptor
138 public final com.google.protobuf.Descriptors.EnumDescriptor
142 public static final com.google.protobuf.Descriptors.EnumDescriptor
144 return com.google.ortools.linearsolver.MPSosConstraint.getDescriptor().getEnumTypes().get(0);
147 private static final Type[] VALUES = values();
150 com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
152 throw new java.lang.IllegalArgumentException(
153 "EnumValueDescriptor is not for this type.");
155 return VALUES[desc.getIndex()];
158 private final int value;
160 private Type(
int value) {
167 private int bitField0_;
169 private int type_ = 0;
174 @java.lang.Override
public boolean hasType() {
175 return ((bitField0_ & 0x00000001) != 0);
183 return result ==
null ? com.google.ortools.linearsolver.MPSosConstraint.Type.SOS1_DEFAULT : result;
187 @SuppressWarnings(
"serial")
188 private com.google.protobuf.Internal.IntList varIndex_ =
200 public java.util.List<java.lang.Integer>
214 return varIndex_.size();
227 return varIndex_.getInt(index);
231 @SuppressWarnings(
"serial")
232 private com.google.protobuf.Internal.DoubleList weight_ =
252 public java.util.List<java.lang.Double>
274 return weight_.size();
295 return weight_.getDouble(index);
298 private byte memoizedIsInitialized = -1;
305 memoizedIsInitialized = 1;
310 public void writeTo(com.google.protobuf.CodedOutputStream output)
311 throws java.io.IOException {
312 if (((bitField0_ & 0x00000001) != 0)) {
313 output.writeEnum(1, type_);
315 for (
int i = 0; i < varIndex_.size(); i++) {
316 output.writeInt32(2, varIndex_.getInt(i));
318 for (
int i = 0; i < weight_.size(); i++) {
319 output.writeDouble(3, weight_.getDouble(i));
321 getUnknownFields().writeTo(output);
326 int size = memoizedSize;
327 if (size != -1)
return size;
330 if (((bitField0_ & 0x00000001) != 0)) {
331 size += com.google.protobuf.CodedOutputStream
332 .computeEnumSize(1, type_);
336 for (
int i = 0; i < varIndex_.size(); i++) {
337 dataSize += com.google.protobuf.CodedOutputStream
338 .computeInt32SizeNoTag(varIndex_.getInt(i));
349 size += getUnknownFields().getSerializedSize();
355 public boolean equals(
final java.lang.Object obj) {
359 if (!(obj instanceof com.google.ortools.linearsolver.MPSosConstraint)) {
360 return super.equals(obj);
366 if (type_ != other.type_)
return false;
372 if (!getUnknownFields().equals(other.getUnknownFields()))
return false;
378 if (memoizedHashCode != 0) {
379 return memoizedHashCode;
385 hash = (53 * hash) + type_;
395 hash = (29 * hash) + getUnknownFields().hashCode();
396 memoizedHashCode = hash;
401 java.nio.ByteBuffer data)
402 throws com.google.protobuf.InvalidProtocolBufferException {
406 java.nio.ByteBuffer data,
407 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
408 throws com.google.protobuf.InvalidProtocolBufferException {
412 com.google.protobuf.ByteString data)
413 throws com.google.protobuf.InvalidProtocolBufferException {
417 com.google.protobuf.ByteString data,
418 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
419 throws com.google.protobuf.InvalidProtocolBufferException {
423 throws com.google.protobuf.InvalidProtocolBufferException {
428 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
429 throws com.google.protobuf.InvalidProtocolBufferException {
433 throws java.io.IOException {
434 return com.google.protobuf.GeneratedMessageV3
435 .parseWithIOException(
PARSER, input);
438 java.io.InputStream input,
439 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
440 throws java.io.IOException {
441 return com.google.protobuf.GeneratedMessageV3
442 .parseWithIOException(
PARSER, input, extensionRegistry);
446 throws java.io.IOException {
447 return com.google.protobuf.GeneratedMessageV3
448 .parseDelimitedWithIOException(
PARSER, input);
452 java.io.InputStream input,
453 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
454 throws java.io.IOException {
455 return com.google.protobuf.GeneratedMessageV3
456 .parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
459 com.google.protobuf.CodedInputStream input)
460 throws java.io.IOException {
461 return com.google.protobuf.GeneratedMessageV3
462 .parseWithIOException(
PARSER, input);
465 com.google.protobuf.CodedInputStream input,
466 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
467 throws java.io.IOException {
468 return com.google.protobuf.GeneratedMessageV3
469 .parseWithIOException(
PARSER, input, extensionRegistry);
482 return this == DEFAULT_INSTANCE
488 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
502 com.google.protobuf.GeneratedMessageV3.
Builder<Builder> implements
505 public static final com.google.protobuf.Descriptors.Descriptor
507 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_descriptor;
511 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
513 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_fieldAccessorTable
514 .ensureFieldAccessorsInitialized(
515 com.google.ortools.linearsolver.MPSosConstraint.class, com.google.ortools.linearsolver.MPSosConstraint.Builder.class);
524 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
533 varIndex_ = emptyIntList();
534 weight_ = emptyDoubleList();
539 public com.google.protobuf.Descriptors.Descriptor
541 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_descriptor;
546 return com.google.ortools.linearsolver.MPSosConstraint.getDefaultInstance();
553 throw newUninitializedMessageException(result);
561 if (bitField0_ != 0) { buildPartial0(result); }
566 private void buildPartial0(com.google.ortools.linearsolver.MPSosConstraint result) {
567 int from_bitField0_ = bitField0_;
568 int to_bitField0_ = 0;
569 if (((from_bitField0_ & 0x00000001) != 0)) {
570 result.type_ = type_;
571 to_bitField0_ |= 0x00000001;
573 if (((from_bitField0_ & 0x00000002) != 0)) {
574 varIndex_.makeImmutable();
575 result.varIndex_ = varIndex_;
577 if (((from_bitField0_ & 0x00000004) != 0)) {
578 weight_.makeImmutable();
579 result.weight_ = weight_;
581 result.bitField0_ |= to_bitField0_;
586 return super.
clone();
590 com.google.protobuf.Descriptors.FieldDescriptor field,
591 java.lang.Object value) {
592 return super.
setField(field, value);
596 com.google.protobuf.Descriptors.FieldDescriptor field) {
601 com.google.protobuf.Descriptors.OneofDescriptor oneof) {
606 com.google.protobuf.Descriptors.FieldDescriptor field,
607 int index, java.lang.Object value) {
612 com.google.protobuf.Descriptors.FieldDescriptor field,
613 java.lang.Object value) {
618 if (other instanceof com.google.ortools.linearsolver.MPSosConstraint) {
619 return mergeFrom((com.google.ortools.linearsolver.MPSosConstraint)other);
621 super.mergeFrom(other);
627 if (other == com.google.ortools.linearsolver.MPSosConstraint.getDefaultInstance())
return this;
628 if (other.hasType()) {
631 if (!other.varIndex_.isEmpty()) {
632 if (varIndex_.isEmpty()) {
633 varIndex_ = other.varIndex_;
634 varIndex_.makeImmutable();
635 bitField0_ |= 0x00000002;
637 ensureVarIndexIsMutable();
638 varIndex_.addAll(other.varIndex_);
642 if (!other.weight_.isEmpty()) {
643 if (weight_.isEmpty()) {
644 weight_ = other.weight_;
645 weight_.makeImmutable();
646 bitField0_ |= 0x00000004;
648 ensureWeightIsMutable();
649 weight_.addAll(other.weight_);
665 com.google.protobuf.CodedInputStream input,
666 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
667 throws java.io.IOException {
668 if (extensionRegistry ==
null) {
669 throw new java.lang.NullPointerException();
672 boolean done =
false;
674 int tag = input.readTag();
680 int tmpRaw = input.readEnum();
682 com.google.ortools.linearsolver.MPSosConstraint.Type.forNumber(tmpRaw);
683 if (tmpValue ==
null) {
684 mergeUnknownVarintField(1, tmpRaw);
687 bitField0_ |= 0x00000001;
692 int v = input.readInt32();
693 ensureVarIndexIsMutable();
698 int length = input.readRawVarint32();
699 int limit = input.pushLimit(length);
700 ensureVarIndexIsMutable();
701 while (input.getBytesUntilLimit() > 0) {
702 varIndex_.addInt(input.readInt32());
704 input.popLimit(limit);
708 double v = input.readDouble();
709 ensureWeightIsMutable();
710 weight_.addDouble(v);
714 int length = input.readRawVarint32();
715 int limit = input.pushLimit(length);
716 int alloc = length > 4096 ? 4096 : length;
717 ensureWeightIsMutable(alloc / 8);
718 while (input.getBytesUntilLimit() > 0) {
719 weight_.addDouble(input.readDouble());
721 input.popLimit(limit);
725 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
732 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
733 throw e.unwrapIOException();
739 private int bitField0_;
741 private int type_ = 0;
746 @java.lang.Override
public boolean hasType() {
747 return ((bitField0_ & 0x00000001) != 0);
756 return result ==
null ? com.google.ortools.linearsolver.MPSosConstraint.Type.SOS1_DEFAULT : result;
763 public Builder setType(com.google.ortools.linearsolver.MPSosConstraint.Type value) {
765 throw new NullPointerException();
767 bitField0_ |= 0x00000001;
768 type_ = value.getNumber();
777 bitField0_ = (bitField0_ & ~0x00000001);
783 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
784 private void ensureVarIndexIsMutable() {
785 if (!varIndex_.isModifiable()) {
786 varIndex_ = makeMutableCopy(varIndex_);
788 bitField0_ |= 0x00000002;
799 public java.util.List<java.lang.Integer>
801 varIndex_.makeImmutable();
814 return varIndex_.size();
827 return varIndex_.getInt(index);
841 int index,
int value) {
843 ensureVarIndexIsMutable();
844 varIndex_.setInt(index, value);
845 bitField0_ |= 0x00000002;
861 ensureVarIndexIsMutable();
862 varIndex_.addInt(value);
863 bitField0_ |= 0x00000002;
878 java.lang.Iterable<? extends java.lang.Integer> values) {
879 ensureVarIndexIsMutable();
880 com.google.protobuf.AbstractMessageLite.Builder.addAll(
882 bitField0_ |= 0x00000002;
896 varIndex_ = emptyIntList();
897 bitField0_ = (bitField0_ & ~0x00000002);
902 private com.google.protobuf.Internal.DoubleList weight_ = emptyDoubleList();
903 private void ensureWeightIsMutable() {
904 if (!weight_.isModifiable()) {
905 weight_ = makeMutableCopy(weight_);
907 bitField0_ |= 0x00000004;
909 private void ensureWeightIsMutable(
int capacity) {
910 if (!weight_.isModifiable()) {
911 weight_ = makeMutableCopy(weight_, capacity);
913 bitField0_ |= 0x00000004;
932 public java.util.List<java.lang.Double>
934 weight_.makeImmutable();
955 return weight_.size();
976 return weight_.getDouble(index);
998 int index,
double value) {
1000 ensureWeightIsMutable();
1001 weight_.setDouble(index, value);
1002 bitField0_ |= 0x00000004;
1026 ensureWeightIsMutable();
1027 weight_.addDouble(value);
1028 bitField0_ |= 0x00000004;
1051 java.lang.Iterable<? extends java.lang.Double> values) {
1052 ensureWeightIsMutable();
1053 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1055 bitField0_ |= 0x00000004;
1077 weight_ = emptyDoubleList();
1078 bitField0_ = (bitField0_ & ~0x00000004);
1084 final com.google.protobuf.UnknownFieldSet unknownFields) {
1090 final com.google.protobuf.UnknownFieldSet unknownFields) {
1101 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPSosConstraint();
1105 return DEFAULT_INSTANCE;
1108 @java.lang.Deprecated
public static final com.google.protobuf.Parser<
MPSosConstraint>
1112 com.google.protobuf.CodedInputStream input,
1113 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1114 throws com.google.protobuf.InvalidProtocolBufferException {
1117 builder.
mergeFrom(input, extensionRegistry);
1118 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
1120 }
catch (com.google.protobuf.UninitializedMessageException e) {
1121 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.
buildPartial());
1122 }
catch (java.io.IOException e) {
1123 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1141 return DEFAULT_INSTANCE;