Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
MPConstraintProto.java
Go to the documentation of this file.
1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// NO CHECKED-IN PROTOBUF GENCODE
3// source: ortools/linear_solver/linear_solver.proto
4// Protobuf Java Version: 4.29.3
5
6package com.google.ortools.linearsolver;
7
25public final class MPConstraintProto extends
26 com.google.protobuf.GeneratedMessage implements
27 // @@protoc_insertion_point(message_implements:operations_research.MPConstraintProto)
29private static final long serialVersionUID = 0L;
30 static {
31 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
32 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
33 /* major= */ 4,
34 /* minor= */ 29,
35 /* patch= */ 3,
36 /* suffix= */ "",
37 MPConstraintProto.class.getName());
38 }
39 // Use MPConstraintProto.newBuilder() to construct.
40 private MPConstraintProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
41 super(builder);
42 }
43 private MPConstraintProto() {
44 varIndex_ = emptyIntList();
45 coefficient_ = emptyDoubleList();
46 lowerBound_ = Double.NEGATIVE_INFINITY;
47 upperBound_ = Double.POSITIVE_INFINITY;
48 name_ = "";
49 }
50
51 public static final com.google.protobuf.Descriptors.Descriptor
53 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_descriptor;
54 }
55
56 @java.lang.Override
57 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
59 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_fieldAccessorTable
60 .ensureFieldAccessorsInitialized(
61 com.google.ortools.linearsolver.MPConstraintProto.class, com.google.ortools.linearsolver.MPConstraintProto.Builder.class);
62 }
63
64 private int bitField0_;
65 public static final int VAR_INDEX_FIELD_NUMBER = 6;
66 @SuppressWarnings("serial")
67 private com.google.protobuf.Internal.IntList varIndex_ =
68 emptyIntList();
80 @java.lang.Override
81 public java.util.List<java.lang.Integer>
83 return varIndex_;
84 }
85
96 public int getVarIndexCount() {
97 return varIndex_.size();
98 }
99
111 public int getVarIndex(int index) {
112 return varIndex_.getInt(index);
113 }
114 private int varIndexMemoizedSerializedSize = -1;
115
116 public static final int COEFFICIENT_FIELD_NUMBER = 7;
117 @SuppressWarnings("serial")
118 private com.google.protobuf.Internal.DoubleList coefficient_ =
119 emptyDoubleList();
128 @java.lang.Override
129 public java.util.List<java.lang.Double>
131 return coefficient_;
132 }
133
141 public int getCoefficientCount() {
142 return coefficient_.size();
143 }
144
153 public double getCoefficient(int index) {
154 return coefficient_.getDouble(index);
155 }
156 private int coefficientMemoizedSerializedSize = -1;
157
158 public static final int LOWER_BOUND_FIELD_NUMBER = 2;
159 private double lowerBound_ = Double.NEGATIVE_INFINITY;
168 @java.lang.Override
169 public boolean hasLowerBound() {
170 return ((bitField0_ & 0x00000001) != 0);
171 }
172
180 @java.lang.Override
181 public double getLowerBound() {
182 return lowerBound_;
183 }
184
185 public static final int UPPER_BOUND_FIELD_NUMBER = 3;
186 private double upperBound_ = Double.POSITIVE_INFINITY;
191 @java.lang.Override
192 public boolean hasUpperBound() {
193 return ((bitField0_ & 0x00000002) != 0);
194 }
195
199 @java.lang.Override
200 public double getUpperBound() {
201 return upperBound_;
202 }
203
204 public static final int NAME_FIELD_NUMBER = 4;
205 @SuppressWarnings("serial")
206 private volatile java.lang.Object name_ = "";
215 @java.lang.Override
216 public boolean hasName() {
217 return ((bitField0_ & 0x00000004) != 0);
218 }
219
227 @java.lang.Override
228 public java.lang.String getName() {
229 java.lang.Object ref = name_;
230 if (ref instanceof java.lang.String) {
231 return (java.lang.String) ref;
232 } else {
233 com.google.protobuf.ByteString bs =
234 (com.google.protobuf.ByteString) ref;
235 java.lang.String s = bs.toStringUtf8();
236 if (bs.isValidUtf8()) {
237 name_ = s;
238 }
239 return s;
240 }
241 }
242
250 @java.lang.Override
251 public com.google.protobuf.ByteString
253 java.lang.Object ref = name_;
254 if (ref instanceof java.lang.String) {
255 com.google.protobuf.ByteString b =
256 com.google.protobuf.ByteString.copyFromUtf8(
257 (java.lang.String) ref);
258 name_ = b;
259 return b;
260 } else {
261 return (com.google.protobuf.ByteString) ref;
262 }
263 }
264
265 public static final int IS_LAZY_FIELD_NUMBER = 5;
266 private boolean isLazy_ = false;
278 @java.lang.Override
279 public boolean hasIsLazy() {
280 return ((bitField0_ & 0x00000008) != 0);
281 }
282
293 @java.lang.Override
294 public boolean getIsLazy() {
295 return isLazy_;
296 }
297
298 private byte memoizedIsInitialized = -1;
299 @java.lang.Override
300 public final boolean isInitialized() {
301 byte isInitialized = memoizedIsInitialized;
302 if (isInitialized == 1) return true;
303 if (isInitialized == 0) return false;
304
305 memoizedIsInitialized = 1;
306 return true;
307 }
308
309 @java.lang.Override
310 public void writeTo(com.google.protobuf.CodedOutputStream output)
311 throws java.io.IOException {
313 if (((bitField0_ & 0x00000001) != 0)) {
314 output.writeDouble(2, lowerBound_);
315 }
316 if (((bitField0_ & 0x00000002) != 0)) {
317 output.writeDouble(3, upperBound_);
318 }
319 if (((bitField0_ & 0x00000004) != 0)) {
320 com.google.protobuf.GeneratedMessage.writeString(output, 4, name_);
321 }
322 if (((bitField0_ & 0x00000008) != 0)) {
323 output.writeBool(5, isLazy_);
324 }
325 if (getVarIndexList().size() > 0) {
326 output.writeUInt32NoTag(50);
327 output.writeUInt32NoTag(varIndexMemoizedSerializedSize);
328 }
329 for (int i = 0; i < varIndex_.size(); i++) {
330 output.writeInt32NoTag(varIndex_.getInt(i));
331 }
332 if (getCoefficientList().size() > 0) {
333 output.writeUInt32NoTag(58);
334 output.writeUInt32NoTag(coefficientMemoizedSerializedSize);
335 }
336 for (int i = 0; i < coefficient_.size(); i++) {
337 output.writeDoubleNoTag(coefficient_.getDouble(i));
338 }
339 getUnknownFields().writeTo(output);
340 }
341
342 @java.lang.Override
343 public int getSerializedSize() {
344 int size = memoizedSize;
345 if (size != -1) return size;
346
347 size = 0;
348 if (((bitField0_ & 0x00000001) != 0)) {
349 size += com.google.protobuf.CodedOutputStream
350 .computeDoubleSize(2, lowerBound_);
351 }
352 if (((bitField0_ & 0x00000002) != 0)) {
353 size += com.google.protobuf.CodedOutputStream
354 .computeDoubleSize(3, upperBound_);
355 }
356 if (((bitField0_ & 0x00000004) != 0)) {
357 size += com.google.protobuf.GeneratedMessage.computeStringSize(4, name_);
358 }
359 if (((bitField0_ & 0x00000008) != 0)) {
360 size += com.google.protobuf.CodedOutputStream
361 .computeBoolSize(5, isLazy_);
362 }
363 {
364 int dataSize = 0;
365 for (int i = 0; i < varIndex_.size(); i++) {
366 dataSize += com.google.protobuf.CodedOutputStream
367 .computeInt32SizeNoTag(varIndex_.getInt(i));
368 }
369 size += dataSize;
370 if (!getVarIndexList().isEmpty()) {
371 size += 1;
372 size += com.google.protobuf.CodedOutputStream
373 .computeInt32SizeNoTag(dataSize);
374 }
375 varIndexMemoizedSerializedSize = dataSize;
376 }
377 {
378 int dataSize = 0;
379 dataSize = 8 * getCoefficientList().size();
380 size += dataSize;
381 if (!getCoefficientList().isEmpty()) {
382 size += 1;
383 size += com.google.protobuf.CodedOutputStream
384 .computeInt32SizeNoTag(dataSize);
385 }
386 coefficientMemoizedSerializedSize = dataSize;
387 }
388 size += getUnknownFields().getSerializedSize();
389 memoizedSize = size;
390 return size;
391 }
392
393 @java.lang.Override
394 public boolean equals(final java.lang.Object obj) {
395 if (obj == this) {
396 return true;
397 }
398 if (!(obj instanceof com.google.ortools.linearsolver.MPConstraintProto)) {
399 return super.equals(obj);
400 }
401 com.google.ortools.linearsolver.MPConstraintProto other = (com.google.ortools.linearsolver.MPConstraintProto) obj;
402
403 if (!getVarIndexList()
404 .equals(other.getVarIndexList())) return false;
405 if (!getCoefficientList()
406 .equals(other.getCoefficientList())) return false;
407 if (hasLowerBound() != other.hasLowerBound()) return false;
408 if (hasLowerBound()) {
409 if (java.lang.Double.doubleToLongBits(getLowerBound())
410 != java.lang.Double.doubleToLongBits(
411 other.getLowerBound())) return false;
412 }
413 if (hasUpperBound() != other.hasUpperBound()) return false;
414 if (hasUpperBound()) {
415 if (java.lang.Double.doubleToLongBits(getUpperBound())
416 != java.lang.Double.doubleToLongBits(
417 other.getUpperBound())) return false;
418 }
419 if (hasName() != other.hasName()) return false;
420 if (hasName()) {
421 if (!getName()
422 .equals(other.getName())) return false;
423 }
424 if (hasIsLazy() != other.hasIsLazy()) return false;
425 if (hasIsLazy()) {
426 if (getIsLazy()
427 != other.getIsLazy()) return false;
428 }
429 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
430 return true;
431 }
432
433 @java.lang.Override
434 public int hashCode() {
435 if (memoizedHashCode != 0) {
436 return memoizedHashCode;
437 }
438 int hash = 41;
439 hash = (19 * hash) + getDescriptor().hashCode();
440 if (getVarIndexCount() > 0) {
441 hash = (37 * hash) + VAR_INDEX_FIELD_NUMBER;
442 hash = (53 * hash) + getVarIndexList().hashCode();
443 }
444 if (getCoefficientCount() > 0) {
445 hash = (37 * hash) + COEFFICIENT_FIELD_NUMBER;
446 hash = (53 * hash) + getCoefficientList().hashCode();
447 }
448 if (hasLowerBound()) {
449 hash = (37 * hash) + LOWER_BOUND_FIELD_NUMBER;
450 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
451 java.lang.Double.doubleToLongBits(getLowerBound()));
452 }
453 if (hasUpperBound()) {
454 hash = (37 * hash) + UPPER_BOUND_FIELD_NUMBER;
455 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
456 java.lang.Double.doubleToLongBits(getUpperBound()));
457 }
458 if (hasName()) {
459 hash = (37 * hash) + NAME_FIELD_NUMBER;
460 hash = (53 * hash) + getName().hashCode();
461 }
462 if (hasIsLazy()) {
463 hash = (37 * hash) + IS_LAZY_FIELD_NUMBER;
464 hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
465 getIsLazy());
466 }
467 hash = (29 * hash) + getUnknownFields().hashCode();
468 memoizedHashCode = hash;
469 return hash;
470 }
471
473 java.nio.ByteBuffer data)
474 throws com.google.protobuf.InvalidProtocolBufferException {
475 return PARSER.parseFrom(data);
476 }
478 java.nio.ByteBuffer data,
479 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
480 throws com.google.protobuf.InvalidProtocolBufferException {
481 return PARSER.parseFrom(data, extensionRegistry);
482 }
484 com.google.protobuf.ByteString data)
485 throws com.google.protobuf.InvalidProtocolBufferException {
486 return PARSER.parseFrom(data);
487 }
489 com.google.protobuf.ByteString data,
490 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
491 throws com.google.protobuf.InvalidProtocolBufferException {
492 return PARSER.parseFrom(data, extensionRegistry);
493 }
495 throws com.google.protobuf.InvalidProtocolBufferException {
496 return PARSER.parseFrom(data);
497 }
499 byte[] data,
500 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
501 throws com.google.protobuf.InvalidProtocolBufferException {
502 return PARSER.parseFrom(data, extensionRegistry);
503 }
504 public static com.google.ortools.linearsolver.MPConstraintProto parseFrom(java.io.InputStream input)
505 throws java.io.IOException {
506 return com.google.protobuf.GeneratedMessage
507 .parseWithIOException(PARSER, input);
508 }
510 java.io.InputStream input,
511 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
512 throws java.io.IOException {
513 return com.google.protobuf.GeneratedMessage
514 .parseWithIOException(PARSER, input, extensionRegistry);
515 }
516
518 throws java.io.IOException {
519 return com.google.protobuf.GeneratedMessage
520 .parseDelimitedWithIOException(PARSER, input);
521 }
522
524 java.io.InputStream input,
525 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
526 throws java.io.IOException {
527 return com.google.protobuf.GeneratedMessage
528 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
529 }
531 com.google.protobuf.CodedInputStream input)
532 throws java.io.IOException {
533 return com.google.protobuf.GeneratedMessage
534 .parseWithIOException(PARSER, input);
535 }
537 com.google.protobuf.CodedInputStream input,
538 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
539 throws java.io.IOException {
540 return com.google.protobuf.GeneratedMessage
541 .parseWithIOException(PARSER, input, extensionRegistry);
542 }
543
544 @java.lang.Override
545 public Builder newBuilderForType() { return newBuilder(); }
546 public static Builder newBuilder() {
547 return DEFAULT_INSTANCE.toBuilder();
548 }
549 public static Builder newBuilder(com.google.ortools.linearsolver.MPConstraintProto prototype) {
550 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
551 }
552 @java.lang.Override
554 return this == DEFAULT_INSTANCE
555 ? new Builder() : new Builder().mergeFrom(this);
556 }
557
558 @java.lang.Override
560 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
561 Builder builder = new Builder(parent);
562 return builder;
563 }
564
581 public static final class Builder extends
582 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
583 // @@protoc_insertion_point(builder_implements:operations_research.MPConstraintProto)
585 public static final com.google.protobuf.Descriptors.Descriptor
587 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_descriptor;
588 }
589
590 @java.lang.Override
591 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
593 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_fieldAccessorTable
594 .ensureFieldAccessorsInitialized(
595 com.google.ortools.linearsolver.MPConstraintProto.class, com.google.ortools.linearsolver.MPConstraintProto.Builder.class);
596 }
597
598 // Construct using com.google.ortools.linearsolver.MPConstraintProto.newBuilder()
599 private Builder() {
600
601 }
602
603 private Builder(
604 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
605 super(parent);
606
607 }
608 @java.lang.Override
609 public Builder clear() {
610 super.clear();
611 bitField0_ = 0;
612 varIndex_ = emptyIntList();
613 coefficient_ = emptyDoubleList();
614 lowerBound_ = Double.NEGATIVE_INFINITY;
615 upperBound_ = Double.POSITIVE_INFINITY;
616 name_ = "";
617 isLazy_ = false;
618 return this;
619 }
620
621 @java.lang.Override
622 public com.google.protobuf.Descriptors.Descriptor
624 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_MPConstraintProto_descriptor;
625 }
626
627 @java.lang.Override
629 return com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance();
630 }
631
632 @java.lang.Override
635 if (!result.isInitialized()) {
636 throw newUninitializedMessageException(result);
637 }
638 return result;
639 }
640
641 @java.lang.Override
643 com.google.ortools.linearsolver.MPConstraintProto result = new com.google.ortools.linearsolver.MPConstraintProto(this);
644 if (bitField0_ != 0) { buildPartial0(result); }
645 onBuilt();
646 return result;
647 }
648
649 private void buildPartial0(com.google.ortools.linearsolver.MPConstraintProto result) {
650 int from_bitField0_ = bitField0_;
651 if (((from_bitField0_ & 0x00000001) != 0)) {
652 varIndex_.makeImmutable();
653 result.varIndex_ = varIndex_;
654 }
655 if (((from_bitField0_ & 0x00000002) != 0)) {
656 coefficient_.makeImmutable();
657 result.coefficient_ = coefficient_;
658 }
659 int to_bitField0_ = 0;
660 if (((from_bitField0_ & 0x00000004) != 0)) {
661 result.lowerBound_ = lowerBound_;
662 to_bitField0_ |= 0x00000001;
663 }
664 if (((from_bitField0_ & 0x00000008) != 0)) {
665 result.upperBound_ = upperBound_;
666 to_bitField0_ |= 0x00000002;
667 }
668 if (((from_bitField0_ & 0x00000010) != 0)) {
669 result.name_ = name_;
670 to_bitField0_ |= 0x00000004;
671 }
672 if (((from_bitField0_ & 0x00000020) != 0)) {
673 result.isLazy_ = isLazy_;
674 to_bitField0_ |= 0x00000008;
675 }
676 result.bitField0_ |= to_bitField0_;
677 }
678
679 @java.lang.Override
680 public Builder mergeFrom(com.google.protobuf.Message other) {
681 if (other instanceof com.google.ortools.linearsolver.MPConstraintProto) {
682 return mergeFrom((com.google.ortools.linearsolver.MPConstraintProto)other);
683 } else {
684 super.mergeFrom(other);
685 return this;
686 }
687 }
688
689 public Builder mergeFrom(com.google.ortools.linearsolver.MPConstraintProto other) {
690 if (other == com.google.ortools.linearsolver.MPConstraintProto.getDefaultInstance()) return this;
691 if (!other.varIndex_.isEmpty()) {
692 if (varIndex_.isEmpty()) {
693 varIndex_ = other.varIndex_;
694 varIndex_.makeImmutable();
695 bitField0_ |= 0x00000001;
696 } else {
697 ensureVarIndexIsMutable();
698 varIndex_.addAll(other.varIndex_);
699 }
700 onChanged();
701 }
702 if (!other.coefficient_.isEmpty()) {
703 if (coefficient_.isEmpty()) {
704 coefficient_ = other.coefficient_;
705 coefficient_.makeImmutable();
706 bitField0_ |= 0x00000002;
707 } else {
708 ensureCoefficientIsMutable();
709 coefficient_.addAll(other.coefficient_);
710 }
711 onChanged();
712 }
713 if (other.hasLowerBound()) {
714 setLowerBound(other.getLowerBound());
715 }
716 if (other.hasUpperBound()) {
717 setUpperBound(other.getUpperBound());
718 }
719 if (other.hasName()) {
720 name_ = other.name_;
721 bitField0_ |= 0x00000010;
722 onChanged();
723 }
724 if (other.hasIsLazy()) {
725 setIsLazy(other.getIsLazy());
726 }
727 this.mergeUnknownFields(other.getUnknownFields());
728 onChanged();
729 return this;
730 }
731
732 @java.lang.Override
733 public final boolean isInitialized() {
734 return true;
735 }
736
737 @java.lang.Override
738 public Builder mergeFrom(
739 com.google.protobuf.CodedInputStream input,
740 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
741 throws java.io.IOException {
742 if (extensionRegistry == null) {
743 throw new java.lang.NullPointerException();
744 }
745 try {
746 boolean done = false;
747 while (!done) {
748 int tag = input.readTag();
749 switch (tag) {
750 case 0:
751 done = true;
752 break;
753 case 17: {
754 lowerBound_ = input.readDouble();
755 bitField0_ |= 0x00000004;
756 break;
757 } // case 17
758 case 25: {
759 upperBound_ = input.readDouble();
760 bitField0_ |= 0x00000008;
761 break;
762 } // case 25
763 case 34: {
764 name_ = input.readBytes();
765 bitField0_ |= 0x00000010;
766 break;
767 } // case 34
768 case 40: {
769 isLazy_ = input.readBool();
770 bitField0_ |= 0x00000020;
771 break;
772 } // case 40
773 case 48: {
774 int v = input.readInt32();
775 ensureVarIndexIsMutable();
776 varIndex_.addInt(v);
777 break;
778 } // case 48
779 case 50: {
780 int length = input.readRawVarint32();
781 int limit = input.pushLimit(length);
782 ensureVarIndexIsMutable();
783 while (input.getBytesUntilLimit() > 0) {
784 varIndex_.addInt(input.readInt32());
785 }
786 input.popLimit(limit);
787 break;
788 } // case 50
789 case 57: {
790 double v = input.readDouble();
791 ensureCoefficientIsMutable();
792 coefficient_.addDouble(v);
793 break;
794 } // case 57
795 case 58: {
796 int length = input.readRawVarint32();
797 int limit = input.pushLimit(length);
798 int alloc = length > 4096 ? 4096 : length;
799 ensureCoefficientIsMutable(alloc / 8);
800 while (input.getBytesUntilLimit() > 0) {
801 coefficient_.addDouble(input.readDouble());
802 }
803 input.popLimit(limit);
804 break;
805 } // case 58
806 default: {
807 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
808 done = true; // was an endgroup tag
809 }
810 break;
811 } // default:
812 } // switch (tag)
813 } // while (!done)
814 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
815 throw e.unwrapIOException();
816 } finally {
817 onChanged();
818 } // finally
819 return this;
820 }
821 private int bitField0_;
822
823 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
824 private void ensureVarIndexIsMutable() {
825 if (!varIndex_.isModifiable()) {
826 varIndex_ = makeMutableCopy(varIndex_);
827 }
828 bitField0_ |= 0x00000001;
829 }
841 public java.util.List<java.lang.Integer>
843 varIndex_.makeImmutable();
844 return varIndex_;
845 }
846
857 public int getVarIndexCount() {
858 return varIndex_.size();
859 }
860
872 public int getVarIndex(int index) {
873 return varIndex_.getInt(index);
874 }
875
888 public Builder setVarIndex(
889 int index, int value) {
890
891 ensureVarIndexIsMutable();
892 varIndex_.setInt(index, value);
893 bitField0_ |= 0x00000001;
894 onChanged();
895 return this;
896 }
897
909 public Builder addVarIndex(int value) {
910
911 ensureVarIndexIsMutable();
912 varIndex_.addInt(value);
913 bitField0_ |= 0x00000001;
914 onChanged();
915 return this;
916 }
917
929 public Builder addAllVarIndex(
930 java.lang.Iterable<? extends java.lang.Integer> values) {
931 ensureVarIndexIsMutable();
932 com.google.protobuf.AbstractMessageLite.Builder.addAll(
933 values, varIndex_);
934 bitField0_ |= 0x00000001;
935 onChanged();
936 return this;
937 }
938
949 public Builder clearVarIndex() {
950 varIndex_ = emptyIntList();
951 bitField0_ = (bitField0_ & ~0x00000001);
952 onChanged();
953 return this;
954 }
955
956 private com.google.protobuf.Internal.DoubleList coefficient_ = emptyDoubleList();
957 private void ensureCoefficientIsMutable() {
958 if (!coefficient_.isModifiable()) {
959 coefficient_ = makeMutableCopy(coefficient_);
960 }
961 bitField0_ |= 0x00000002;
962 }
963 private void ensureCoefficientIsMutable(int capacity) {
964 if (!coefficient_.isModifiable()) {
965 coefficient_ = makeMutableCopy(coefficient_, capacity);
966 }
967 bitField0_ |= 0x00000002;
968 }
977 public java.util.List<java.lang.Double>
979 coefficient_.makeImmutable();
980 return coefficient_;
981 }
982
990 public int getCoefficientCount() {
991 return coefficient_.size();
992 }
993
1002 public double getCoefficient(int index) {
1003 return coefficient_.getDouble(index);
1004 }
1005
1015 public Builder setCoefficient(
1016 int index, double value) {
1017
1018 ensureCoefficientIsMutable();
1019 coefficient_.setDouble(index, value);
1020 bitField0_ |= 0x00000002;
1021 onChanged();
1022 return this;
1023 }
1024
1033 public Builder addCoefficient(double value) {
1034
1035 ensureCoefficientIsMutable();
1036 coefficient_.addDouble(value);
1037 bitField0_ |= 0x00000002;
1038 onChanged();
1039 return this;
1040 }
1041
1050 public Builder addAllCoefficient(
1051 java.lang.Iterable<? extends java.lang.Double> values) {
1052 ensureCoefficientIsMutable();
1053 com.google.protobuf.AbstractMessageLite.Builder.addAll(
1054 values, coefficient_);
1055 bitField0_ |= 0x00000002;
1056 onChanged();
1057 return this;
1058 }
1059
1067 public Builder clearCoefficient() {
1068 coefficient_ = emptyDoubleList();
1069 bitField0_ = (bitField0_ & ~0x00000002);
1070 onChanged();
1071 return this;
1072 }
1073
1074 private double lowerBound_ = Double.NEGATIVE_INFINITY;
1083 @java.lang.Override
1084 public boolean hasLowerBound() {
1085 return ((bitField0_ & 0x00000004) != 0);
1086 }
1087
1095 @java.lang.Override
1096 public double getLowerBound() {
1097 return lowerBound_;
1098 }
1099
1108 public Builder setLowerBound(double value) {
1109
1110 lowerBound_ = value;
1111 bitField0_ |= 0x00000004;
1112 onChanged();
1113 return this;
1114 }
1115
1123 public Builder clearLowerBound() {
1124 bitField0_ = (bitField0_ & ~0x00000004);
1125 lowerBound_ = Double.NEGATIVE_INFINITY;
1126 onChanged();
1127 return this;
1128 }
1129
1130 private double upperBound_ = Double.POSITIVE_INFINITY;
1135 @java.lang.Override
1136 public boolean hasUpperBound() {
1137 return ((bitField0_ & 0x00000008) != 0);
1138 }
1139
1143 @java.lang.Override
1144 public double getUpperBound() {
1145 return upperBound_;
1146 }
1147
1152 public Builder setUpperBound(double value) {
1153
1154 upperBound_ = value;
1155 bitField0_ |= 0x00000008;
1156 onChanged();
1157 return this;
1158 }
1159
1163 public Builder clearUpperBound() {
1164 bitField0_ = (bitField0_ & ~0x00000008);
1165 upperBound_ = Double.POSITIVE_INFINITY;
1166 onChanged();
1167 return this;
1168 }
1169
1170 private java.lang.Object name_ = "";
1179 public boolean hasName() {
1180 return ((bitField0_ & 0x00000010) != 0);
1181 }
1182
1190 public java.lang.String getName() {
1191 java.lang.Object ref = name_;
1192 if (!(ref instanceof java.lang.String)) {
1193 com.google.protobuf.ByteString bs =
1194 (com.google.protobuf.ByteString) ref;
1195 java.lang.String s = bs.toStringUtf8();
1196 if (bs.isValidUtf8()) {
1197 name_ = s;
1198 }
1199 return s;
1200 } else {
1201 return (java.lang.String) ref;
1202 }
1203 }
1204
1212 public com.google.protobuf.ByteString
1214 java.lang.Object ref = name_;
1215 if (ref instanceof String) {
1216 com.google.protobuf.ByteString b =
1217 com.google.protobuf.ByteString.copyFromUtf8(
1218 (java.lang.String) ref);
1219 name_ = b;
1220 return b;
1221 } else {
1222 return (com.google.protobuf.ByteString) ref;
1223 }
1224 }
1225
1234 public Builder setName(
1235 java.lang.String value) {
1236 if (value == null) { throw new NullPointerException(); }
1237 name_ = value;
1238 bitField0_ |= 0x00000010;
1239 onChanged();
1240 return this;
1241 }
1242
1250 public Builder clearName() {
1251 name_ = getDefaultInstance().getName();
1252 bitField0_ = (bitField0_ & ~0x00000010);
1253 onChanged();
1254 return this;
1255 }
1256
1265 public Builder setNameBytes(
1266 com.google.protobuf.ByteString value) {
1267 if (value == null) { throw new NullPointerException(); }
1268 name_ = value;
1269 bitField0_ |= 0x00000010;
1270 onChanged();
1271 return this;
1272 }
1273
1274 private boolean isLazy_ ;
1286 @java.lang.Override
1287 public boolean hasIsLazy() {
1288 return ((bitField0_ & 0x00000020) != 0);
1289 }
1290
1301 @java.lang.Override
1302 public boolean getIsLazy() {
1303 return isLazy_;
1304 }
1305
1317 public Builder setIsLazy(boolean value) {
1318
1319 isLazy_ = value;
1320 bitField0_ |= 0x00000020;
1321 onChanged();
1322 return this;
1323 }
1324
1335 public Builder clearIsLazy() {
1336 bitField0_ = (bitField0_ & ~0x00000020);
1337 isLazy_ = false;
1338 onChanged();
1339 return this;
1340 }
1341
1342 // @@protoc_insertion_point(builder_scope:operations_research.MPConstraintProto)
1343 }
1344
1345 // @@protoc_insertion_point(class_scope:operations_research.MPConstraintProto)
1346 private static final com.google.ortools.linearsolver.MPConstraintProto DEFAULT_INSTANCE;
1347 static {
1348 DEFAULT_INSTANCE = new com.google.ortools.linearsolver.MPConstraintProto();
1349 }
1350
1352 return DEFAULT_INSTANCE;
1353 }
1354
1355 private static final com.google.protobuf.Parser<MPConstraintProto>
1356 PARSER = new com.google.protobuf.AbstractParser<MPConstraintProto>() {
1357 @java.lang.Override
1358 public MPConstraintProto parsePartialFrom(
1359 com.google.protobuf.CodedInputStream input,
1360 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1361 throws com.google.protobuf.InvalidProtocolBufferException {
1362 Builder builder = newBuilder();
1363 try {
1364 builder.mergeFrom(input, extensionRegistry);
1365 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1366 throw e.setUnfinishedMessage(builder.buildPartial());
1367 } catch (com.google.protobuf.UninitializedMessageException e) {
1368 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1369 } catch (java.io.IOException e) {
1370 throw new com.google.protobuf.InvalidProtocolBufferException(e)
1371 .setUnfinishedMessage(builder.buildPartial());
1372 }
1373 return builder.buildPartial();
1374 }
1375 };
1376
1377 public static com.google.protobuf.Parser<MPConstraintProto> parser() {
1378 return PARSER;
1379 }
1380
1381 @java.lang.Override
1382 public com.google.protobuf.Parser<MPConstraintProto> getParserForType() {
1383 return PARSER;
1384 }
1385
1386 @java.lang.Override
1390
1391}
1392
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
com.google.ortools.linearsolver.MPConstraintProto buildPartial()
Builder addAllCoefficient(java.lang.Iterable<? extends java.lang.Double > values)
com.google.ortools.linearsolver.MPConstraintProto build()
com.google.ortools.linearsolver.MPConstraintProto getDefaultInstanceForType()
Builder mergeFrom(com.google.protobuf.Message other)
Builder addAllVarIndex(java.lang.Iterable<? extends java.lang.Integer > values)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
Builder mergeFrom(com.google.ortools.linearsolver.MPConstraintProto other)
Builder setNameBytes(com.google.protobuf.ByteString value)
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
static Builder newBuilder(com.google.ortools.linearsolver.MPConstraintProto prototype)
static com.google.ortools.linearsolver.MPConstraintProto parseDelimitedFrom(java.io.InputStream input)
static com.google.ortools.linearsolver.MPConstraintProto parseFrom(com.google.protobuf.ByteString data)
java.util.List< java.lang.Integer > getVarIndexList()
static com.google.ortools.linearsolver.MPConstraintProto parseFrom(java.nio.ByteBuffer data)
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
static com.google.ortools.linearsolver.MPConstraintProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.Parser< MPConstraintProto > getParserForType()
static com.google.ortools.linearsolver.MPConstraintProto parseFrom(java.io.InputStream input)
static com.google.protobuf.Parser< MPConstraintProto > parser()
static com.google.ortools.linearsolver.MPConstraintProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
com.google.ortools.linearsolver.MPConstraintProto getDefaultInstanceForType()
java.util.List< java.lang.Double > getCoefficientList()
static com.google.ortools.linearsolver.MPConstraintProto parseFrom(com.google.protobuf.CodedInputStream input)
void writeTo(com.google.protobuf.CodedOutputStream output)
static com.google.ortools.linearsolver.MPConstraintProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.linearsolver.MPConstraintProto getDefaultInstance()
static com.google.ortools.linearsolver.MPConstraintProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.linearsolver.MPConstraintProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
static com.google.ortools.linearsolver.MPConstraintProto parseFrom(byte[] data)
static com.google.ortools.linearsolver.MPConstraintProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)