Java Reference

Java Reference

MPSosConstraint.java
Go to the documentation of this file.
1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: ortools/linear_solver/linear_solver.proto
3
4package com.google.ortools.linearsolver;
5
15public final class MPSosConstraint extends
16 com.google.protobuf.GeneratedMessageV3 implements
17 // @@protoc_insertion_point(message_implements:operations_research.MPSosConstraint)
19private static final long serialVersionUID = 0L;
20 // Use MPSosConstraint.newBuilder() to construct.
21 private MPSosConstraint(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
22 super(builder);
23 }
24 private MPSosConstraint() {
25 type_ = 0;
26 varIndex_ = emptyIntList();
27 weight_ = emptyDoubleList();
28 }
29
30 @java.lang.Override
31 @SuppressWarnings({"unused"})
32 protected java.lang.Object newInstance(
33 UnusedPrivateParameter unused) {
34 return new MPSosConstraint();
35 }
36
37 @java.lang.Override
38 public final com.google.protobuf.UnknownFieldSet
40 return this.unknownFields;
41 }
42 private MPSosConstraint(
43 com.google.protobuf.CodedInputStream input,
44 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
45 throws com.google.protobuf.InvalidProtocolBufferException {
46 this();
47 if (extensionRegistry == null) {
48 throw new java.lang.NullPointerException();
49 }
50 int mutable_bitField0_ = 0;
51 com.google.protobuf.UnknownFieldSet.Builder unknownFields =
52 com.google.protobuf.UnknownFieldSet.newBuilder();
53 try {
54 boolean done = false;
55 while (!done) {
56 int tag = input.readTag();
57 switch (tag) {
58 case 0:
59 done = true;
60 break;
61 case 8: {
62 int rawValue = input.readEnum();
63 @SuppressWarnings("deprecation")
64 com.google.ortools.linearsolver.MPSosConstraint.Type value = com.google.ortools.linearsolver.MPSosConstraint.Type.valueOf(rawValue);
65 if (value == null) {
66 unknownFields.mergeVarintField(1, rawValue);
67 } else {
68 bitField0_ |= 0x00000001;
69 type_ = rawValue;
70 }
71 break;
72 }
73 case 16: {
74 if (!((mutable_bitField0_ & 0x00000002) != 0)) {
75 varIndex_ = newIntList();
76 mutable_bitField0_ |= 0x00000002;
77 }
78 varIndex_.addInt(input.readInt32());
79 break;
80 }
81 case 18: {
82 int length = input.readRawVarint32();
83 int limit = input.pushLimit(length);
84 if (!((mutable_bitField0_ & 0x00000002) != 0) && input.getBytesUntilLimit() > 0) {
85 varIndex_ = newIntList();
86 mutable_bitField0_ |= 0x00000002;
87 }
88 while (input.getBytesUntilLimit() > 0) {
89 varIndex_.addInt(input.readInt32());
90 }
91 input.popLimit(limit);
92 break;
93 }
94 case 25: {
95 if (!((mutable_bitField0_ & 0x00000004) != 0)) {
96 weight_ = newDoubleList();
97 mutable_bitField0_ |= 0x00000004;
98 }
99 weight_.addDouble(input.readDouble());
100 break;
101 }
102 case 26: {
103 int length = input.readRawVarint32();
104 int limit = input.pushLimit(length);
105 if (!((mutable_bitField0_ & 0x00000004) != 0) && input.getBytesUntilLimit() > 0) {
106 weight_ = newDoubleList();
107 mutable_bitField0_ |= 0x00000004;
108 }
109 while (input.getBytesUntilLimit() > 0) {
110 weight_.addDouble(input.readDouble());
111 }
112 input.popLimit(limit);
113 break;
114 }
115 default: {
116 if (!parseUnknownField(
117 input, unknownFields, extensionRegistry, tag)) {
118 done = true;
119 }
120 break;
121 }
122 }
123 }
124 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
125 throw e.setUnfinishedMessage(this);
126 } catch (java.io.IOException e) {
127 throw new com.google.protobuf.InvalidProtocolBufferException(
128 e).setUnfinishedMessage(this);
129 } finally {
130 if (((mutable_bitField0_ & 0x00000002) != 0)) {
131 varIndex_.makeImmutable(); // C
132 }
133 if (((mutable_bitField0_ & 0x00000004) != 0)) {
134 weight_.makeImmutable(); // C
135 }
136 this.unknownFields = unknownFields.build();
137 makeExtensionsImmutable();
138 }
139 }
140 public static final com.google.protobuf.Descriptors.Descriptor
142 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_descriptor;
143 }
144
145 @java.lang.Override
146 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
148 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_fieldAccessorTable
149 .ensureFieldAccessorsInitialized(
150 com.google.ortools.linearsolver.MPSosConstraint.class, com.google.ortools.linearsolver.MPSosConstraint.Builder.class);
151 }
152
156 public enum Type
157 implements com.google.protobuf.ProtocolMessageEnum {
176 ;
177
185 public static final int SOS1_DEFAULT_VALUE = 0;
195 public static final int SOS2_VALUE = 1;
196
197
198 public final int getNumber() {
199 return value;
200 }
201
207 @java.lang.Deprecated
208 public static Type valueOf(int value) {
209 return forNumber(value);
210 }
211
216 public static Type forNumber(int value) {
217 switch (value) {
218 case 0: return SOS1_DEFAULT;
219 case 1: return SOS2;
220 default: return null;
221 }
222 }
223
224 public static com.google.protobuf.Internal.EnumLiteMap<Type>
226 return internalValueMap;
227 }
228 private static final com.google.protobuf.Internal.EnumLiteMap<
229 Type> internalValueMap =
230 new com.google.protobuf.Internal.EnumLiteMap<Type>() {
231 public Type findValueByNumber(int number) {
232 return Type.forNumber(number);
233 }
234 };
235
236 public final com.google.protobuf.Descriptors.EnumValueDescriptor
238 return getDescriptor().getValues().get(ordinal());
239 }
240 public final com.google.protobuf.Descriptors.EnumDescriptor
242 return getDescriptor();
243 }
244 public static final com.google.protobuf.Descriptors.EnumDescriptor
246 return com.google.ortools.linearsolver.MPSosConstraint.getDescriptor().getEnumTypes().get(0);
247 }
248
249 private static final Type[] VALUES = values();
250
251 public static Type valueOf(
252 com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
253 if (desc.getType() != getDescriptor()) {
254 throw new java.lang.IllegalArgumentException(
255 "EnumValueDescriptor is not for this type.");
256 }
257 return VALUES[desc.getIndex()];
258 }
259
260 private final int value;
261
262 private Type(int value) {
263 this.value = value;
264 }
265
266 // @@protoc_insertion_point(enum_scope:operations_research.MPSosConstraint.Type)
267 }
268
269 private int bitField0_;
270 public static final int TYPE_FIELD_NUMBER = 1;
271 private int type_;
276 @java.lang.Override public boolean hasType() {
277 return ((bitField0_ & 0x00000001) != 0);
278 }
283 @java.lang.Override public com.google.ortools.linearsolver.MPSosConstraint.Type getType() {
284 @SuppressWarnings("deprecation")
285 com.google.ortools.linearsolver.MPSosConstraint.Type result = com.google.ortools.linearsolver.MPSosConstraint.Type.valueOf(type_);
286 return result == null ? com.google.ortools.linearsolver.MPSosConstraint.Type.SOS1_DEFAULT : result;
287 }
288
289 public static final int VAR_INDEX_FIELD_NUMBER = 2;
290 private com.google.protobuf.Internal.IntList varIndex_;
300 @java.lang.Override
301 public java.util.List<java.lang.Integer>
303 return varIndex_;
304 }
314 public int getVarIndexCount() {
315 return varIndex_.size();
316 }
327 public int getVarIndex(int index) {
328 return varIndex_.getInt(index);
329 }
330
331 public static final int WEIGHT_FIELD_NUMBER = 3;
332 private com.google.protobuf.Internal.DoubleList weight_;
350 @java.lang.Override
351 public java.util.List<java.lang.Double>
353 return weight_;
354 }
372 public int getWeightCount() {
373 return weight_.size();
374 }
393 public double getWeight(int index) {
394 return weight_.getDouble(index);
395 }
396
397 private byte memoizedIsInitialized = -1;
398 @java.lang.Override
399 public final boolean isInitialized() {
400 byte isInitialized = memoizedIsInitialized;
401 if (isInitialized == 1) return true;
402 if (isInitialized == 0) return false;
403
404 memoizedIsInitialized = 1;
405 return true;
406 }
407
408 @java.lang.Override
409 public void writeTo(com.google.protobuf.CodedOutputStream output)
410 throws java.io.IOException {
411 if (((bitField0_ & 0x00000001) != 0)) {
412 output.writeEnum(1, type_);
413 }
414 for (int i = 0; i < varIndex_.size(); i++) {
415 output.writeInt32(2, varIndex_.getInt(i));
416 }
417 for (int i = 0; i < weight_.size(); i++) {
418 output.writeDouble(3, weight_.getDouble(i));
419 }
420 unknownFields.writeTo(output);
421 }
422
423 @java.lang.Override
424 public int getSerializedSize() {
425 int size = memoizedSize;
426 if (size != -1) return size;
427
428 size = 0;
429 if (((bitField0_ & 0x00000001) != 0)) {
430 size += com.google.protobuf.CodedOutputStream
431 .computeEnumSize(1, type_);
432 }
433 {
434 int dataSize = 0;
435 for (int i = 0; i < varIndex_.size(); i++) {
436 dataSize += com.google.protobuf.CodedOutputStream
437 .computeInt32SizeNoTag(varIndex_.getInt(i));
438 }
439 size += dataSize;
440 size += 1 * getVarIndexList().size();
441 }
442 {
443 int dataSize = 0;
444 dataSize = 8 * getWeightList().size();
445 size += dataSize;
446 size += 1 * getWeightList().size();
447 }
448 size += unknownFields.getSerializedSize();
449 memoizedSize = size;
450 return size;
451 }
452
453 @java.lang.Override
454 public boolean equals(final java.lang.Object obj) {
455 if (obj == this) {
456 return true;
457 }
458 if (!(obj instanceof com.google.ortools.linearsolver.MPSosConstraint)) {
459 return super.equals(obj);
460 }
461 com.google.ortools.linearsolver.MPSosConstraint other = (com.google.ortools.linearsolver.MPSosConstraint) obj;
462
463 if (hasType() != other.hasType()) return false;
464 if (hasType()) {
465 if (type_ != other.type_) return false;
466 }
467 if (!getVarIndexList()
468 .equals(other.getVarIndexList())) return false;
469 if (!getWeightList()
470 .equals(other.getWeightList())) return false;
471 if (!unknownFields.equals(other.unknownFields)) return false;
472 return true;
473 }
474
475 @java.lang.Override
476 public int hashCode() {
477 if (memoizedHashCode != 0) {
478 return memoizedHashCode;
479 }
480 int hash = 41;
481 hash = (19 * hash) + getDescriptor().hashCode();
482 if (hasType()) {
483 hash = (37 * hash) + TYPE_FIELD_NUMBER;
484 hash = (53 * hash) + type_;
485 }
486 if (getVarIndexCount() > 0) {
487 hash = (37 * hash) + VAR_INDEX_FIELD_NUMBER;
488 hash = (53 * hash) + getVarIndexList().hashCode();
489 }
490 if (getWeightCount() > 0) {
491 hash = (37 * hash) + WEIGHT_FIELD_NUMBER;
492 hash = (53 * hash) + getWeightList().hashCode();
493 }
494 hash = (29 * hash) + unknownFields.hashCode();
495 memoizedHashCode = hash;
496 return hash;
497 }
498
499 public static com.google.ortools.linearsolver.MPSosConstraint parseFrom(
500 java.nio.ByteBuffer data)
501 throws com.google.protobuf.InvalidProtocolBufferException {
502 return PARSER.parseFrom(data);
503 }
504 public static com.google.ortools.linearsolver.MPSosConstraint parseFrom(
505 java.nio.ByteBuffer data,
506 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
507 throws com.google.protobuf.InvalidProtocolBufferException {
508 return PARSER.parseFrom(data, extensionRegistry);
509 }
510 public static com.google.ortools.linearsolver.MPSosConstraint parseFrom(
511 com.google.protobuf.ByteString data)
512 throws com.google.protobuf.InvalidProtocolBufferException {
513 return PARSER.parseFrom(data);
514 }
515 public static com.google.ortools.linearsolver.MPSosConstraint parseFrom(
516 com.google.protobuf.ByteString data,
517 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
518 throws com.google.protobuf.InvalidProtocolBufferException {
519 return PARSER.parseFrom(data, extensionRegistry);
520 }
521 public static com.google.ortools.linearsolver.MPSosConstraint parseFrom(byte[] data)
522 throws com.google.protobuf.InvalidProtocolBufferException {
523 return PARSER.parseFrom(data);
524 }
525 public static com.google.ortools.linearsolver.MPSosConstraint parseFrom(
526 byte[] data,
527 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
528 throws com.google.protobuf.InvalidProtocolBufferException {
529 return PARSER.parseFrom(data, extensionRegistry);
530 }
531 public static com.google.ortools.linearsolver.MPSosConstraint parseFrom(java.io.InputStream input)
532 throws java.io.IOException {
533 return com.google.protobuf.GeneratedMessageV3
534 .parseWithIOException(PARSER, input);
535 }
536 public static com.google.ortools.linearsolver.MPSosConstraint parseFrom(
537 java.io.InputStream input,
538 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
539 throws java.io.IOException {
540 return com.google.protobuf.GeneratedMessageV3
541 .parseWithIOException(PARSER, input, extensionRegistry);
542 }
543 public static com.google.ortools.linearsolver.MPSosConstraint parseDelimitedFrom(java.io.InputStream input)
544 throws java.io.IOException {
545 return com.google.protobuf.GeneratedMessageV3
546 .parseDelimitedWithIOException(PARSER, input);
547 }
548 public static com.google.ortools.linearsolver.MPSosConstraint parseDelimitedFrom(
549 java.io.InputStream input,
550 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
551 throws java.io.IOException {
552 return com.google.protobuf.GeneratedMessageV3
553 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
554 }
555 public static com.google.ortools.linearsolver.MPSosConstraint parseFrom(
556 com.google.protobuf.CodedInputStream input)
557 throws java.io.IOException {
558 return com.google.protobuf.GeneratedMessageV3
559 .parseWithIOException(PARSER, input);
560 }
561 public static com.google.ortools.linearsolver.MPSosConstraint parseFrom(
562 com.google.protobuf.CodedInputStream input,
563 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
564 throws java.io.IOException {
565 return com.google.protobuf.GeneratedMessageV3
566 .parseWithIOException(PARSER, input, extensionRegistry);
567 }
568
569 @java.lang.Override
570 public Builder newBuilderForType() { return newBuilder(); }
571 public static Builder newBuilder() {
572 return DEFAULT_INSTANCE.toBuilder();
573 }
574 public static Builder newBuilder(com.google.ortools.linearsolver.MPSosConstraint prototype) {
575 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
576 }
577 @java.lang.Override
579 return this == DEFAULT_INSTANCE
580 ? new Builder() : new Builder().mergeFrom(this);
581 }
582
583 @java.lang.Override
585 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
586 Builder builder = new Builder(parent);
587 return builder;
588 }
598 public static final class Builder extends
599 com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
600 // @@protoc_insertion_point(builder_implements:operations_research.MPSosConstraint)
601 com.google.ortools.linearsolver.MPSosConstraintOrBuilder {
602 public static final com.google.protobuf.Descriptors.Descriptor
604 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_descriptor;
605 }
606
607 @java.lang.Override
608 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
610 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_fieldAccessorTable
611 .ensureFieldAccessorsInitialized(
612 com.google.ortools.linearsolver.MPSosConstraint.class, com.google.ortools.linearsolver.MPSosConstraint.Builder.class);
613 }
614
615 // Construct using com.google.ortools.linearsolver.MPSosConstraint.newBuilder()
616 private Builder() {
617 maybeForceBuilderInitialization();
618 }
619
620 private Builder(
621 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
622 super(parent);
623 maybeForceBuilderInitialization();
624 }
625 private void maybeForceBuilderInitialization() {
626 if (com.google.protobuf.GeneratedMessageV3
627 .alwaysUseFieldBuilders) {
628 }
629 }
630 @java.lang.Override
631 public Builder clear() {
632 super.clear();
633 type_ = 0;
634 bitField0_ = (bitField0_ & ~0x00000001);
635 varIndex_ = emptyIntList();
636 bitField0_ = (bitField0_ & ~0x00000002);
637 weight_ = emptyDoubleList();
638 bitField0_ = (bitField0_ & ~0x00000004);
639 return this;
640 }
641
642 @java.lang.Override
643 public com.google.protobuf.Descriptors.Descriptor
645 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPSosConstraint_descriptor;
646 }
647
648 @java.lang.Override
649 public com.google.ortools.linearsolver.MPSosConstraint getDefaultInstanceForType() {
650 return com.google.ortools.linearsolver.MPSosConstraint.getDefaultInstance();
651 }
652
653 @java.lang.Override
654 public com.google.ortools.linearsolver.MPSosConstraint build() {
655 com.google.ortools.linearsolver.MPSosConstraint result = buildPartial();
656 if (!result.isInitialized()) {
657 throw newUninitializedMessageException(result);
658 }
659 return result;
660 }
661
662 @java.lang.Override
663 public com.google.ortools.linearsolver.MPSosConstraint buildPartial() {
664 com.google.ortools.linearsolver.MPSosConstraint result = new com.google.ortools.linearsolver.MPSosConstraint(this);
665 int from_bitField0_ = bitField0_;
666 int to_bitField0_ = 0;
667 if (((from_bitField0_ & 0x00000001) != 0)) {
668 to_bitField0_ |= 0x00000001;
669 }
670 result.type_ = type_;
671 if (((bitField0_ & 0x00000002) != 0)) {
672 varIndex_.makeImmutable();
673 bitField0_ = (bitField0_ & ~0x00000002);
674 }
675 result.varIndex_ = varIndex_;
676 if (((bitField0_ & 0x00000004) != 0)) {
677 weight_.makeImmutable();
678 bitField0_ = (bitField0_ & ~0x00000004);
679 }
680 result.weight_ = weight_;
681 result.bitField0_ = to_bitField0_;
682 onBuilt();
683 return result;
684 }
685
686 @java.lang.Override
687 public Builder clone() {
688 return super.clone();
689 }
690 @java.lang.Override
692 com.google.protobuf.Descriptors.FieldDescriptor field,
693 java.lang.Object value) {
694 return super.setField(field, value);
695 }
696 @java.lang.Override
698 com.google.protobuf.Descriptors.FieldDescriptor field) {
699 return super.clearField(field);
700 }
701 @java.lang.Override
703 com.google.protobuf.Descriptors.OneofDescriptor oneof) {
704 return super.clearOneof(oneof);
705 }
706 @java.lang.Override
708 com.google.protobuf.Descriptors.FieldDescriptor field,
709 int index, java.lang.Object value) {
710 return super.setRepeatedField(field, index, value);
711 }
712 @java.lang.Override
714 com.google.protobuf.Descriptors.FieldDescriptor field,
715 java.lang.Object value) {
716 return super.addRepeatedField(field, value);
717 }
718 @java.lang.Override
719 public Builder mergeFrom(com.google.protobuf.Message other) {
720 if (other instanceof com.google.ortools.linearsolver.MPSosConstraint) {
721 return mergeFrom((com.google.ortools.linearsolver.MPSosConstraint)other);
722 } else {
723 super.mergeFrom(other);
724 return this;
725 }
726 }
727
728 public Builder mergeFrom(com.google.ortools.linearsolver.MPSosConstraint other) {
729 if (other == com.google.ortools.linearsolver.MPSosConstraint.getDefaultInstance()) return this;
730 if (other.hasType()) {
731 setType(other.getType());
732 }
733 if (!other.varIndex_.isEmpty()) {
734 if (varIndex_.isEmpty()) {
735 varIndex_ = other.varIndex_;
736 bitField0_ = (bitField0_ & ~0x00000002);
737 } else {
738 ensureVarIndexIsMutable();
739 varIndex_.addAll(other.varIndex_);
740 }
741 onChanged();
742 }
743 if (!other.weight_.isEmpty()) {
744 if (weight_.isEmpty()) {
745 weight_ = other.weight_;
746 bitField0_ = (bitField0_ & ~0x00000004);
747 } else {
748 ensureWeightIsMutable();
749 weight_.addAll(other.weight_);
750 }
751 onChanged();
752 }
753 this.mergeUnknownFields(other.unknownFields);
754 onChanged();
755 return this;
756 }
757
758 @java.lang.Override
759 public final boolean isInitialized() {
760 return true;
761 }
762
763 @java.lang.Override
765 com.google.protobuf.CodedInputStream input,
766 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
767 throws java.io.IOException {
768 com.google.ortools.linearsolver.MPSosConstraint parsedMessage = null;
769 try {
770 parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
771 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
772 parsedMessage = (com.google.ortools.linearsolver.MPSosConstraint) e.getUnfinishedMessage();
773 throw e.unwrapIOException();
774 } finally {
775 if (parsedMessage != null) {
776 mergeFrom(parsedMessage);
777 }
778 }
779 return this;
780 }
781 private int bitField0_;
782
783 private int type_ = 0;
788 @java.lang.Override public boolean hasType() {
789 return ((bitField0_ & 0x00000001) != 0);
790 }
795 @java.lang.Override
796 public com.google.ortools.linearsolver.MPSosConstraint.Type getType() {
797 @SuppressWarnings("deprecation")
798 com.google.ortools.linearsolver.MPSosConstraint.Type result = com.google.ortools.linearsolver.MPSosConstraint.Type.valueOf(type_);
799 return result == null ? com.google.ortools.linearsolver.MPSosConstraint.Type.SOS1_DEFAULT : result;
800 }
806 public Builder setType(com.google.ortools.linearsolver.MPSosConstraint.Type value) {
807 if (value == null) {
808 throw new NullPointerException();
809 }
810 bitField0_ |= 0x00000001;
811 type_ = value.getNumber();
812 onChanged();
813 return this;
814 }
820 bitField0_ = (bitField0_ & ~0x00000001);
821 type_ = 0;
822 onChanged();
823 return this;
824 }
825
826 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
827 private void ensureVarIndexIsMutable() {
828 if (!((bitField0_ & 0x00000002) != 0)) {
829 varIndex_ = mutableCopy(varIndex_);
830 bitField0_ |= 0x00000002;
831 }
832 }
842 public java.util.List<java.lang.Integer>
844 return ((bitField0_ & 0x00000002) != 0) ?
845 java.util.Collections.unmodifiableList(varIndex_) : varIndex_;
846 }
856 public int getVarIndexCount() {
857 return varIndex_.size();
858 }
869 public int getVarIndex(int index) {
870 return varIndex_.getInt(index);
871 }
884 int index, int value) {
885 ensureVarIndexIsMutable();
886 varIndex_.setInt(index, value);
887 onChanged();
888 return this;
889 }
900 public Builder addVarIndex(int value) {
901 ensureVarIndexIsMutable();
902 varIndex_.addInt(value);
903 onChanged();
904 return this;
905 }
917 java.lang.Iterable<? extends java.lang.Integer> values) {
918 ensureVarIndexIsMutable();
919 com.google.protobuf.AbstractMessageLite.Builder.addAll(
920 values, varIndex_);
921 onChanged();
922 return this;
923 }
934 varIndex_ = emptyIntList();
935 bitField0_ = (bitField0_ & ~0x00000002);
936 onChanged();
937 return this;
938 }
939
940 private com.google.protobuf.Internal.DoubleList weight_ = emptyDoubleList();
941 private void ensureWeightIsMutable() {
942 if (!((bitField0_ & 0x00000004) != 0)) {
943 weight_ = mutableCopy(weight_);
944 bitField0_ |= 0x00000004;
945 }
946 }
964 public java.util.List<java.lang.Double>
966 return ((bitField0_ & 0x00000004) != 0) ?
967 java.util.Collections.unmodifiableList(weight_) : weight_;
968 }
986 public int getWeightCount() {
987 return weight_.size();
988 }
1007 public double getWeight(int index) {
1008 return weight_.getDouble(index);
1009 }
1030 int index, double value) {
1031 ensureWeightIsMutable();
1032 weight_.setDouble(index, value);
1033 onChanged();
1034 return this;
1035 }
1054 public Builder addWeight(double value) {
1055 ensureWeightIsMutable();
1056 weight_.addDouble(value);
1057 onChanged();
1058 return this;
1059 }
1079 java.lang.Iterable<? extends java.lang.Double> values) {
1080 ensureWeightIsMutable();
1081 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1082 values, weight_);
1083 onChanged();
1084 return this;
1085 }
1104 weight_ = emptyDoubleList();
1105 bitField0_ = (bitField0_ & ~0x00000004);
1106 onChanged();
1107 return this;
1108 }
1109 @java.lang.Override
1111 final com.google.protobuf.UnknownFieldSet unknownFields) {
1112 return super.setUnknownFields(unknownFields);
1113 }
1114
1115 @java.lang.Override
1117 final com.google.protobuf.UnknownFieldSet unknownFields) {
1118 return super.mergeUnknownFields(unknownFields);
1119 }
1120
1121
1122 // @@protoc_insertion_point(builder_scope:operations_research.MPSosConstraint)
1123 }
1124
1125 // @@protoc_insertion_point(class_scope:operations_research.MPSosConstraint)
1126 private static final com.google.ortools.linearsolver.MPSosConstraint DEFAULT_INSTANCE;
1127 static {
1128 DEFAULT_INSTANCE = new com.google.ortools.linearsolver.MPSosConstraint();
1129 }
1130
1131 public static com.google.ortools.linearsolver.MPSosConstraint getDefaultInstance() {
1132 return DEFAULT_INSTANCE;
1133 }
1134
1135 @java.lang.Deprecated public static final com.google.protobuf.Parser<MPSosConstraint>
1136 PARSER = new com.google.protobuf.AbstractParser<MPSosConstraint>() {
1137 @java.lang.Override
1138 public MPSosConstraint parsePartialFrom(
1139 com.google.protobuf.CodedInputStream input,
1140 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1141 throws com.google.protobuf.InvalidProtocolBufferException {
1142 return new MPSosConstraint(input, extensionRegistry);
1143 }
1144 };
1145
1146 public static com.google.protobuf.Parser<MPSosConstraint> parser() {
1147 return PARSER;
1148 }
1149
1150 @java.lang.Override
1151 public com.google.protobuf.Parser<MPSosConstraint> getParserForType() {
1152 return PARSER;
1153 }
1154
1155 @java.lang.Override
1156 public com.google.ortools.linearsolver.MPSosConstraint getDefaultInstanceForType() {
1157 return DEFAULT_INSTANCE;
1158 }
1159
1160}
1161
java.util.List< java.lang.Double > getWeightList()
final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
com.google.ortools.linearsolver.MPSosConstraint buildPartial()
Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
com.google.ortools.linearsolver.MPSosConstraint.Type getType()
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];
final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
Builder setType(com.google.ortools.linearsolver.MPSosConstraint.Type value)
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];
com.google.ortools.linearsolver.MPSosConstraint getDefaultInstanceForType()
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Builder addAllWeight(java.lang.Iterable<? extends java.lang.Double > values)
Builder mergeFrom(com.google.protobuf.Message other)
Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
Builder mergeFrom(com.google.ortools.linearsolver.MPSosConstraint other)
Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
Builder clearType()
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];
com.google.ortools.linearsolver.MPSosConstraint build()
Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
java.util.List< java.lang.Integer > getVarIndexList()
Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
Builder addAllVarIndex(java.lang.Iterable<? extends java.lang.Integer > values)
boolean hasType()
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
java.util.List< java.lang.Double > getWeightList()
com.google.ortools.linearsolver.MPSosConstraint.Type getType()
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];
static com.google.ortools.linearsolver.MPSosConstraint parseDelimitedFrom(java.io.InputStream input)
void writeTo(com.google.protobuf.CodedOutputStream output)
static com.google.ortools.linearsolver.MPSosConstraint parseFrom(com.google.protobuf.ByteString data)
static com.google.ortools.linearsolver.MPSosConstraint parseFrom(java.nio.ByteBuffer data)
static com.google.ortools.linearsolver.MPSosConstraint parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.linearsolver.MPSosConstraint getDefaultInstanceForType()
static com.google.ortools.linearsolver.MPSosConstraint parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
static com.google.ortools.linearsolver.MPSosConstraint parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
boolean equals(final java.lang.Object obj)
static com.google.ortools.linearsolver.MPSosConstraint parseFrom(com.google.protobuf.CodedInputStream input)
static com.google.ortools.linearsolver.MPSosConstraint parseFrom(byte[] data)
com.google.protobuf.Parser< MPSosConstraint > getParserForType()
final com.google.protobuf.UnknownFieldSet getUnknownFields()
static final com.google.protobuf.Parser< MPSosConstraint > PARSER
static com.google.ortools.linearsolver.MPSosConstraint parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.protobuf.Parser< MPSosConstraint > parser()
static com.google.ortools.linearsolver.MPSosConstraint parseFrom(java.io.InputStream input)
static com.google.ortools.linearsolver.MPSosConstraint parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
java.util.List< java.lang.Integer > getVarIndexList()
static Builder newBuilder(com.google.ortools.linearsolver.MPSosConstraint prototype)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
java.lang.Object newInstance(UnusedPrivateParameter unused)
boolean hasType()
optional .operations_research.MPSosConstraint.Type type = 1 [default = SOS1_DEFAULT];
static com.google.ortools.linearsolver.MPSosConstraint getDefaultInstance()
Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
static com.google.ortools.linearsolver.MPSosConstraint parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Protobuf enum operations_research.MPSosConstraint.Type @endiliteral.
static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor()
static com.google.protobuf.Internal.EnumLiteMap< Type > internalGetValueMap()
final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor()
static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)
final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType()