6package com.google.ortools.sat;
17@com.google.protobuf.Generated
18public final class LinearExpressionProto
extends
19 com.google.protobuf.GeneratedMessage implements
22private static final long serialVersionUID = 0L;
24 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
25 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
30 LinearExpressionProto.class.getName());
33 private LinearExpressionProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
36 private LinearExpressionProto() {
37 vars_ = emptyIntList();
38 coeffs_ = emptyLongList();
41 public static final com.google.protobuf.Descriptors.Descriptor
43 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_descriptor;
47 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
49 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_fieldAccessorTable
50 .ensureFieldAccessorsInitialized(
51 com.google.ortools.sat.LinearExpressionProto.class, com.google.ortools.sat.LinearExpressionProto.Builder.class);
55 @SuppressWarnings(
"serial")
56 private com.google.protobuf.Internal.IntList vars_ =
63 public java.
util.List<java.lang.Integer>
80 return vars_.getInt(index);
82 private int varsMemoizedSerializedSize = -1;
85 @SuppressWarnings(
"serial")
86 private com.google.protobuf.Internal.LongList coeffs_ =
93 public java.
util.List<java.lang.Long>
102 return coeffs_.size();
110 return coeffs_.getLong(index);
112 private int coeffsMemoizedSerializedSize = -1;
115 private long offset_ = 0L;
125 private byte memoizedIsInitialized = -1;
132 memoizedIsInitialized = 1;
137 public void writeTo(com.google.protobuf.CodedOutputStream output)
138 throws java.io.IOException {
141 output.writeUInt32NoTag(10);
142 output.writeUInt32NoTag(varsMemoizedSerializedSize);
144 for (
int i = 0; i < vars_.size(); i++) {
145 output.writeInt32NoTag(vars_.getInt(i));
148 output.writeUInt32NoTag(18);
149 output.writeUInt32NoTag(coeffsMemoizedSerializedSize);
151 for (
int i = 0; i < coeffs_.size(); i++) {
152 output.writeInt64NoTag(coeffs_.getLong(i));
155 output.writeInt64(3, offset_);
157 getUnknownFields().writeTo(output);
162 int size = memoizedSize;
163 if (size != -1)
return size;
168 for (
int i = 0; i < vars_.size(); i++) {
169 dataSize += com.google.protobuf.CodedOutputStream
170 .computeInt32SizeNoTag(vars_.getInt(i));
175 size += com.google.protobuf.CodedOutputStream
176 .computeInt32SizeNoTag(dataSize);
178 varsMemoizedSerializedSize = dataSize;
182 for (
int i = 0; i < coeffs_.size(); i++) {
183 dataSize += com.google.protobuf.CodedOutputStream
184 .computeInt64SizeNoTag(coeffs_.getLong(i));
189 size += com.google.protobuf.CodedOutputStream
190 .computeInt32SizeNoTag(dataSize);
192 coeffsMemoizedSerializedSize = dataSize;
195 size += com.google.protobuf.CodedOutputStream
196 .computeInt64Size(3, offset_);
198 size += getUnknownFields().getSerializedSize();
204 public boolean equals(
final java.lang.Object obj) {
208 if (!(obj instanceof com.google.ortools.sat.LinearExpressionProto)) {
209 return super.equals(obj);
219 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
225 if (memoizedHashCode != 0) {
226 return memoizedHashCode;
239 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
241 hash = (29 * hash) + getUnknownFields().hashCode();
242 memoizedHashCode = hash;
247 java.nio.ByteBuffer data)
248 throws com.google.protobuf.InvalidProtocolBufferException {
249 return PARSER.parseFrom(data);
252 java.nio.ByteBuffer data,
253 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
254 throws com.google.protobuf.InvalidProtocolBufferException {
255 return PARSER.parseFrom(data, extensionRegistry);
258 com.google.protobuf.ByteString data)
259 throws com.google.protobuf.InvalidProtocolBufferException {
260 return PARSER.parseFrom(data);
263 com.google.protobuf.ByteString data,
264 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
265 throws com.google.protobuf.InvalidProtocolBufferException {
266 return PARSER.parseFrom(data, extensionRegistry);
269 throws com.google.protobuf.InvalidProtocolBufferException {
270 return PARSER.parseFrom(data);
274 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
275 throws com.google.protobuf.InvalidProtocolBufferException {
276 return PARSER.parseFrom(data, extensionRegistry);
279 throws java.io.IOException {
280 return com.google.protobuf.GeneratedMessage
281 .parseWithIOException(PARSER, input);
284 java.io.InputStream input,
285 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
286 throws java.io.IOException {
287 return com.google.protobuf.GeneratedMessage
288 .parseWithIOException(PARSER, input, extensionRegistry);
292 throws java.io.IOException {
293 return com.google.protobuf.GeneratedMessage
294 .parseDelimitedWithIOException(PARSER, input);
298 java.io.InputStream input,
299 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
300 throws java.io.IOException {
301 return com.google.protobuf.GeneratedMessage
302 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
305 com.google.protobuf.CodedInputStream input)
306 throws java.io.IOException {
307 return com.google.protobuf.GeneratedMessage
308 .parseWithIOException(PARSER, input);
311 com.google.protobuf.CodedInputStream input,
312 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
313 throws java.io.IOException {
314 return com.google.protobuf.GeneratedMessage
315 .parseWithIOException(PARSER, input, extensionRegistry);
321 return DEFAULT_INSTANCE.toBuilder();
324 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
328 return this == DEFAULT_INSTANCE
334 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
347 public static final class Builder
extends
348 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
351 public static final com.google.protobuf.Descriptors.Descriptor
353 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_descriptor;
357 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
359 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_fieldAccessorTable
360 .ensureFieldAccessorsInitialized(
361 com.google.ortools.sat.LinearExpressionProto.class, com.google.ortools.sat.LinearExpressionProto.Builder.class);
370 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
378 vars_ = emptyIntList();
379 coeffs_ = emptyLongList();
385 public com.google.protobuf.Descriptors.Descriptor
387 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_descriptor;
392 return com.google.ortools.sat.LinearExpressionProto.getDefaultInstance();
399 throw newUninitializedMessageException(result);
407 if (bitField0_ != 0) { buildPartial0(result); }
412 private void buildPartial0(com.google.ortools.sat.LinearExpressionProto result) {
413 int from_bitField0_ = bitField0_;
414 if (((from_bitField0_ & 0x00000001) != 0)) {
415 vars_.makeImmutable();
416 result.vars_ = vars_;
418 if (((from_bitField0_ & 0x00000002) != 0)) {
419 coeffs_.makeImmutable();
420 result.coeffs_ = coeffs_;
422 if (((from_bitField0_ & 0x00000004) != 0)) {
423 result.offset_ = offset_;
428 public Builder
mergeFrom(com.google.protobuf.Message other) {
429 if (other instanceof com.google.ortools.sat.LinearExpressionProto) {
430 return mergeFrom((com.google.ortools.sat.LinearExpressionProto)other);
432 super.mergeFrom(other);
437 public Builder
mergeFrom(com.google.ortools.sat.LinearExpressionProto other) {
438 if (other == com.google.ortools.sat.LinearExpressionProto.getDefaultInstance())
return this;
439 if (!other.vars_.isEmpty()) {
440 if (vars_.isEmpty()) {
442 vars_.makeImmutable();
443 bitField0_ |= 0x00000001;
445 ensureVarsIsMutable();
446 vars_.addAll(other.vars_);
450 if (!other.coeffs_.isEmpty()) {
451 if (coeffs_.isEmpty()) {
452 coeffs_ = other.coeffs_;
453 coeffs_.makeImmutable();
454 bitField0_ |= 0x00000002;
456 ensureCoeffsIsMutable();
457 coeffs_.addAll(other.coeffs_);
461 if (other.getOffset() != 0L) {
464 this.mergeUnknownFields(other.getUnknownFields());
476 com.google.protobuf.CodedInputStream input,
477 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
478 throws java.io.IOException {
479 if (extensionRegistry ==
null) {
480 throw new java.lang.NullPointerException();
483 boolean done =
false;
485 int tag = input.readTag();
491 int v = input.readInt32();
492 ensureVarsIsMutable();
497 int length = input.readRawVarint32();
498 int limit = input.pushLimit(length);
499 ensureVarsIsMutable();
500 while (input.getBytesUntilLimit() > 0) {
501 vars_.addInt(input.readInt32());
503 input.popLimit(limit);
507 long v = input.readInt64();
508 ensureCoeffsIsMutable();
513 int length = input.readRawVarint32();
514 int limit = input.pushLimit(length);
515 ensureCoeffsIsMutable();
516 while (input.getBytesUntilLimit() > 0) {
517 coeffs_.addLong(input.readInt64());
519 input.popLimit(limit);
523 offset_ = input.readInt64();
524 bitField0_ |= 0x00000004;
528 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
535 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
536 throw e.unwrapIOException();
542 private int bitField0_;
544 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
545 private void ensureVarsIsMutable() {
546 if (!vars_.isModifiable()) {
547 vars_ = makeMutableCopy(vars_);
549 bitField0_ |= 0x00000001;
555 public java.util.List<java.lang.Integer>
557 vars_.makeImmutable();
573 return vars_.getInt(index);
582 int index,
int value) {
584 ensureVarsIsMutable();
585 vars_.setInt(index, value);
586 bitField0_ |= 0x00000001;
597 ensureVarsIsMutable();
599 bitField0_ |= 0x00000001;
609 java.lang.Iterable<? extends java.lang.Integer> values) {
610 ensureVarsIsMutable();
611 com.google.protobuf.AbstractMessageLite.Builder.addAll(
613 bitField0_ |= 0x00000001;
622 vars_ = emptyIntList();
623 bitField0_ = (bitField0_ & ~0x00000001);
628 private com.google.protobuf.Internal.LongList coeffs_ = emptyLongList();
629 private void ensureCoeffsIsMutable() {
630 if (!coeffs_.isModifiable()) {
631 coeffs_ = makeMutableCopy(coeffs_);
633 bitField0_ |= 0x00000002;
639 public java.util.List<java.lang.Long>
641 coeffs_.makeImmutable();
649 return coeffs_.size();
657 return coeffs_.getLong(index);
666 int index,
long value) {
668 ensureCoeffsIsMutable();
669 coeffs_.setLong(index, value);
670 bitField0_ |= 0x00000002;
681 ensureCoeffsIsMutable();
682 coeffs_.addLong(value);
683 bitField0_ |= 0x00000002;
693 java.lang.Iterable<? extends java.lang.Long> values) {
694 ensureCoeffsIsMutable();
695 com.google.protobuf.AbstractMessageLite.Builder.addAll(
697 bitField0_ |= 0x00000002;
706 coeffs_ = emptyLongList();
707 bitField0_ = (bitField0_ & ~0x00000002);
712 private long offset_ ;
729 bitField0_ |= 0x00000004;
738 bitField0_ = (bitField0_ & ~0x00000004);
750 DEFAULT_INSTANCE =
new com.google.ortools.sat.LinearExpressionProto();
754 return DEFAULT_INSTANCE;
761 com.google.protobuf.CodedInputStream input,
762 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
763 throws com.google.protobuf.InvalidProtocolBufferException {
766 builder.mergeFrom(input, extensionRegistry);
767 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
768 throw e.setUnfinishedMessage(builder.buildPartial());
769 }
catch (com.google.protobuf.UninitializedMessageException e) {
770 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
771 }
catch (java.io.IOException e) {
772 throw new com.google.protobuf.InvalidProtocolBufferException(e)
773 .setUnfinishedMessage(builder.buildPartial());
775 return builder.buildPartial();
779 public static com.google.protobuf.Parser<LinearExpressionProto>
parser() {
790 return DEFAULT_INSTANCE;