6package com.google.ortools.linearsolver;
17@com.google.protobuf.Generated
18public final class MPSosConstraint
extends
19 com.google.protobuf.GeneratedMessage implements
22private static final long serialVersionUID = 0L;
24 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
25 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
30 MPSosConstraint.class.getName());
33 private MPSosConstraint(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
36 private MPSosConstraint() {
38 varIndex_ = emptyIntList();
39 weight_ = emptyDoubleList();
42 public static final com.google.protobuf.Descriptors.Descriptor
44 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_descriptor;
48 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
50 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_fieldAccessorTable
51 .ensureFieldAccessorsInitialized(
52 com.google.ortools.linearsolver.MPSosConstraint.class, com.google.ortools.linearsolver.MPSosConstraint.Builder.class);
59 implements com.google.protobuf.ProtocolMessageEnum {
81 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
82 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
87 Type.class.getName());
118 @java.lang.Deprecated
131 default:
return null;
135 public static com.google.protobuf.Internal.EnumLiteMap<
Type>
137 return internalValueMap;
139 private static final com.google.protobuf.Internal.EnumLiteMap<
140 Type> internalValueMap =
141 new com.google.protobuf.Internal.EnumLiteMap<
Type>() {
142 public Type findValueByNumber(
int number) {
147 public final com.google.protobuf.Descriptors.EnumValueDescriptor
151 public final com.google.protobuf.Descriptors.EnumDescriptor
155 public static com.google.protobuf.Descriptors.EnumDescriptor
157 return com.google.ortools.linearsolver.MPSosConstraint.getDescriptor().getEnumTypes().get(0);
160 private static final Type[] VALUES = values();
163 com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
165 throw new java.lang.IllegalArgumentException(
166 "EnumValueDescriptor is not for this type.");
168 return VALUES[desc.getIndex()];
171 private final int value;
173 private Type(
int value) {
180 private int bitField0_;
182 private int type_ = 0;
187 @java.lang.Override
public boolean hasType() {
188 return ((bitField0_ & 0x00000001) != 0);
200 @SuppressWarnings(
"serial")
201 private com.google.protobuf.Internal.IntList varIndex_ =
213 public java.
util.List<java.lang.Integer>
227 return varIndex_.size();
240 return varIndex_.getInt(index);
244 @SuppressWarnings(
"serial")
245 private com.google.protobuf.Internal.DoubleList weight_ =
265 public java.
util.List<java.lang.Double>
287 return weight_.size();
308 return weight_.getDouble(index);
311 private byte memoizedIsInitialized = -1;
318 memoizedIsInitialized = 1;
323 public void writeTo(com.google.protobuf.CodedOutputStream output)
324 throws java.io.IOException {
325 if (((bitField0_ & 0x00000001) != 0)) {
326 output.writeEnum(1, type_);
328 for (
int i = 0; i < varIndex_.size(); i++) {
329 output.writeInt32(2, varIndex_.getInt(i));
331 for (
int i = 0; i < weight_.size(); i++) {
332 output.writeDouble(3, weight_.getDouble(i));
334 getUnknownFields().writeTo(output);
339 int size = memoizedSize;
340 if (size != -1)
return size;
343 if (((bitField0_ & 0x00000001) != 0)) {
344 size += com.google.protobuf.CodedOutputStream
345 .computeEnumSize(1, type_);
349 for (
int i = 0; i < varIndex_.size(); i++) {
350 dataSize += com.google.protobuf.CodedOutputStream
351 .computeInt32SizeNoTag(varIndex_.getInt(i));
362 size += getUnknownFields().getSerializedSize();
368 public boolean equals(
final java.lang.Object obj) {
372 if (!(obj instanceof com.google.ortools.linearsolver.MPSosConstraint)) {
373 return super.equals(obj);
379 if (type_ != other.type_)
return false;
385 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
391 if (memoizedHashCode != 0) {
392 return memoizedHashCode;
398 hash = (53 * hash) + type_;
408 hash = (29 * hash) + getUnknownFields().hashCode();
409 memoizedHashCode = hash;
414 java.nio.ByteBuffer data)
415 throws com.google.protobuf.InvalidProtocolBufferException {
416 return PARSER.parseFrom(data);
419 java.nio.ByteBuffer data,
420 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
421 throws com.google.protobuf.InvalidProtocolBufferException {
422 return PARSER.parseFrom(data, extensionRegistry);
425 com.google.protobuf.ByteString data)
426 throws com.google.protobuf.InvalidProtocolBufferException {
427 return PARSER.parseFrom(data);
430 com.google.protobuf.ByteString data,
431 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
432 throws com.google.protobuf.InvalidProtocolBufferException {
433 return PARSER.parseFrom(data, extensionRegistry);
436 throws com.google.protobuf.InvalidProtocolBufferException {
437 return PARSER.parseFrom(data);
441 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
442 throws com.google.protobuf.InvalidProtocolBufferException {
443 return PARSER.parseFrom(data, extensionRegistry);
446 throws java.io.IOException {
447 return com.google.protobuf.GeneratedMessage
448 .parseWithIOException(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 .parseWithIOException(PARSER, input, extensionRegistry);
459 throws java.io.IOException {
460 return com.google.protobuf.GeneratedMessage
461 .parseDelimitedWithIOException(PARSER, input);
465 java.io.InputStream input,
466 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
467 throws java.io.IOException {
468 return com.google.protobuf.GeneratedMessage
469 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
472 com.google.protobuf.CodedInputStream input)
473 throws java.io.IOException {
474 return com.google.protobuf.GeneratedMessage
475 .parseWithIOException(PARSER, input);
478 com.google.protobuf.CodedInputStream input,
479 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
480 throws java.io.IOException {
481 return com.google.protobuf.GeneratedMessage
482 .parseWithIOException(PARSER, input, extensionRegistry);
488 return DEFAULT_INSTANCE.toBuilder();
491 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
495 return this == DEFAULT_INSTANCE
501 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
514 public static final class Builder
extends
515 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
518 public static final com.google.protobuf.Descriptors.Descriptor
520 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_descriptor;
524 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
526 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_fieldAccessorTable
527 .ensureFieldAccessorsInitialized(
528 com.google.ortools.linearsolver.MPSosConstraint.class, com.google.ortools.linearsolver.MPSosConstraint.Builder.class);
537 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
546 varIndex_ = emptyIntList();
547 weight_ = emptyDoubleList();
552 public com.google.protobuf.Descriptors.Descriptor
554 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_descriptor;
559 return com.google.ortools.linearsolver.MPSosConstraint.getDefaultInstance();
566 throw newUninitializedMessageException(result);
574 if (bitField0_ != 0) { buildPartial0(result); }
579 private void buildPartial0(com.google.ortools.linearsolver.MPSosConstraint result) {
580 int from_bitField0_ = bitField0_;
581 int to_bitField0_ = 0;
582 if (((from_bitField0_ & 0x00000001) != 0)) {
583 result.type_ = type_;
584 to_bitField0_ |= 0x00000001;
586 if (((from_bitField0_ & 0x00000002) != 0)) {
587 varIndex_.makeImmutable();
588 result.varIndex_ = varIndex_;
590 if (((from_bitField0_ & 0x00000004) != 0)) {
591 weight_.makeImmutable();
592 result.weight_ = weight_;
594 result.bitField0_ |= to_bitField0_;
598 public Builder
mergeFrom(com.google.protobuf.Message other) {
599 if (other instanceof com.google.ortools.linearsolver.MPSosConstraint) {
600 return mergeFrom((com.google.ortools.linearsolver.MPSosConstraint)other);
602 super.mergeFrom(other);
607 public Builder
mergeFrom(com.google.ortools.linearsolver.MPSosConstraint other) {
608 if (other == com.google.ortools.linearsolver.MPSosConstraint.getDefaultInstance())
return this;
609 if (other.hasType()) {
612 if (!other.varIndex_.isEmpty()) {
613 if (varIndex_.isEmpty()) {
614 varIndex_ = other.varIndex_;
615 varIndex_.makeImmutable();
616 bitField0_ |= 0x00000002;
618 ensureVarIndexIsMutable();
619 varIndex_.addAll(other.varIndex_);
623 if (!other.weight_.isEmpty()) {
624 if (weight_.isEmpty()) {
625 weight_ = other.weight_;
626 weight_.makeImmutable();
627 bitField0_ |= 0x00000004;
629 ensureWeightIsMutable();
630 weight_.addAll(other.weight_);
634 this.mergeUnknownFields(other.getUnknownFields());
646 com.google.protobuf.CodedInputStream input,
647 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
648 throws java.io.IOException {
649 if (extensionRegistry ==
null) {
650 throw new java.lang.NullPointerException();
653 boolean done =
false;
655 int tag = input.readTag();
661 int tmpRaw = input.readEnum();
663 com.google.ortools.linearsolver.MPSosConstraint.Type.forNumber(tmpRaw);
664 if (tmpValue ==
null) {
665 mergeUnknownVarintField(1, tmpRaw);
668 bitField0_ |= 0x00000001;
673 int v = input.readInt32();
674 ensureVarIndexIsMutable();
679 int length = input.readRawVarint32();
680 int limit = input.pushLimit(length);
681 ensureVarIndexIsMutable();
682 while (input.getBytesUntilLimit() > 0) {
683 varIndex_.addInt(input.readInt32());
685 input.popLimit(limit);
689 double v = input.readDouble();
690 ensureWeightIsMutable();
691 weight_.addDouble(v);
695 int length = input.readRawVarint32();
696 int limit = input.pushLimit(length);
697 int alloc = length > 4096 ? 4096 : length;
698 ensureWeightIsMutable(alloc / 8);
699 while (input.getBytesUntilLimit() > 0) {
700 weight_.addDouble(input.readDouble());
702 input.popLimit(limit);
706 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
713 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
714 throw e.unwrapIOException();
720 private int bitField0_;
722 private int type_ = 0;
727 @java.lang.Override
public boolean hasType() {
728 return ((bitField0_ & 0x00000001) != 0);
744 public Builder
setType(com.google.ortools.linearsolver.MPSosConstraint.Type value) {
745 if (value ==
null) {
throw new NullPointerException(); }
746 bitField0_ |= 0x00000001;
747 type_ = value.getNumber();
756 bitField0_ = (bitField0_ & ~0x00000001);
762 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
763 private void ensureVarIndexIsMutable() {
764 if (!varIndex_.isModifiable()) {
765 varIndex_ = makeMutableCopy(varIndex_);
767 bitField0_ |= 0x00000002;
778 public java.util.List<java.lang.Integer>
780 varIndex_.makeImmutable();
793 return varIndex_.size();
806 return varIndex_.getInt(index);
820 int index,
int value) {
822 ensureVarIndexIsMutable();
823 varIndex_.setInt(index, value);
824 bitField0_ |= 0x00000002;
840 ensureVarIndexIsMutable();
841 varIndex_.addInt(value);
842 bitField0_ |= 0x00000002;
857 java.lang.Iterable<? extends java.lang.Integer> values) {
858 ensureVarIndexIsMutable();
859 com.google.protobuf.AbstractMessageLite.Builder.addAll(
861 bitField0_ |= 0x00000002;
875 varIndex_ = emptyIntList();
876 bitField0_ = (bitField0_ & ~0x00000002);
881 private com.google.protobuf.Internal.DoubleList weight_ = emptyDoubleList();
882 private void ensureWeightIsMutable() {
883 if (!weight_.isModifiable()) {
884 weight_ = makeMutableCopy(weight_);
886 bitField0_ |= 0x00000004;
888 private void ensureWeightIsMutable(
int capacity) {
889 if (!weight_.isModifiable()) {
890 weight_ = makeMutableCopy(weight_, capacity);
892 bitField0_ |= 0x00000004;
911 public java.util.List<java.lang.Double>
913 weight_.makeImmutable();
934 return weight_.size();
955 return weight_.getDouble(index);
977 int index,
double value) {
979 ensureWeightIsMutable();
980 weight_.setDouble(index, value);
981 bitField0_ |= 0x00000004;
1005 ensureWeightIsMutable();
1006 weight_.addDouble(value);
1007 bitField0_ |= 0x00000004;
1030 java.lang.Iterable<? extends java.lang.Double> values) {
1031 ensureWeightIsMutable();
1032 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1034 bitField0_ |= 0x00000004;
1056 weight_ = emptyDoubleList();
1057 bitField0_ = (bitField0_ & ~0x00000004);
1068 DEFAULT_INSTANCE =
new com.google.ortools.linearsolver.MPSosConstraint();
1072 return DEFAULT_INSTANCE;
1079 com.google.protobuf.CodedInputStream input,
1080 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1081 throws com.google.protobuf.InvalidProtocolBufferException {
1084 builder.mergeFrom(input, extensionRegistry);
1085 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
1086 throw e.setUnfinishedMessage(builder.buildPartial());
1087 }
catch (com.google.protobuf.UninitializedMessageException e) {
1088 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1089 }
catch (java.io.IOException e) {
1090 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1091 .setUnfinishedMessage(builder.buildPartial());
1093 return builder.buildPartial();
1097 public static com.google.protobuf.Parser<MPSosConstraint>
parser() {
1108 return DEFAULT_INSTANCE;