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