6package com.google.ortools.sat;
17public final class LinearExpressionProto
extends
18 com.google.protobuf.GeneratedMessage implements
21private static final long serialVersionUID = 0L;
23 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
24 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
29 LinearExpressionProto.class.getName());
32 private LinearExpressionProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
35 private LinearExpressionProto() {
36 vars_ = emptyIntList();
37 coeffs_ = emptyLongList();
40 public static final com.google.protobuf.Descriptors.Descriptor
42 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_descriptor;
46 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
48 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_fieldAccessorTable
49 .ensureFieldAccessorsInitialized(
50 com.google.ortools.sat.LinearExpressionProto.class, com.google.ortools.sat.LinearExpressionProto.Builder.class);
54 @SuppressWarnings(
"serial")
55 private com.google.protobuf.Internal.IntList vars_ =
62 public java.
util.List<java.lang.Integer>
79 return vars_.getInt(index);
81 private int varsMemoizedSerializedSize = -1;
84 @SuppressWarnings(
"serial")
85 private com.google.protobuf.Internal.LongList coeffs_ =
92 public java.
util.List<java.lang.Long>
101 return coeffs_.size();
109 return coeffs_.getLong(index);
111 private int coeffsMemoizedSerializedSize = -1;
114 private long offset_ = 0L;
124 private byte memoizedIsInitialized = -1;
131 memoizedIsInitialized = 1;
136 public void writeTo(com.google.protobuf.CodedOutputStream output)
137 throws java.io.IOException {
140 output.writeUInt32NoTag(10);
141 output.writeUInt32NoTag(varsMemoizedSerializedSize);
143 for (
int i = 0; i < vars_.size(); i++) {
144 output.writeInt32NoTag(vars_.getInt(i));
147 output.writeUInt32NoTag(18);
148 output.writeUInt32NoTag(coeffsMemoizedSerializedSize);
150 for (
int i = 0; i < coeffs_.size(); i++) {
151 output.writeInt64NoTag(coeffs_.getLong(i));
154 output.writeInt64(3, offset_);
156 getUnknownFields().writeTo(output);
161 int size = memoizedSize;
162 if (size != -1)
return size;
167 for (
int i = 0; i < vars_.size(); i++) {
168 dataSize += com.google.protobuf.CodedOutputStream
169 .computeInt32SizeNoTag(vars_.getInt(i));
174 size += com.google.protobuf.CodedOutputStream
175 .computeInt32SizeNoTag(dataSize);
177 varsMemoizedSerializedSize = dataSize;
181 for (
int i = 0; i < coeffs_.size(); i++) {
182 dataSize += com.google.protobuf.CodedOutputStream
183 .computeInt64SizeNoTag(coeffs_.getLong(i));
188 size += com.google.protobuf.CodedOutputStream
189 .computeInt32SizeNoTag(dataSize);
191 coeffsMemoizedSerializedSize = dataSize;
194 size += com.google.protobuf.CodedOutputStream
195 .computeInt64Size(3, offset_);
197 size += getUnknownFields().getSerializedSize();
203 public boolean equals(
final java.lang.Object obj) {
207 if (!(obj instanceof com.google.ortools.sat.LinearExpressionProto)) {
208 return super.equals(obj);
218 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
224 if (memoizedHashCode != 0) {
225 return memoizedHashCode;
238 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
240 hash = (29 * hash) + getUnknownFields().hashCode();
241 memoizedHashCode = hash;
246 java.nio.ByteBuffer data)
247 throws com.google.protobuf.InvalidProtocolBufferException {
248 return PARSER.parseFrom(data);
251 java.nio.ByteBuffer data,
252 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
253 throws com.google.protobuf.InvalidProtocolBufferException {
254 return PARSER.parseFrom(data, extensionRegistry);
257 com.google.protobuf.ByteString data)
258 throws com.google.protobuf.InvalidProtocolBufferException {
259 return PARSER.parseFrom(data);
262 com.google.protobuf.ByteString data,
263 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
264 throws com.google.protobuf.InvalidProtocolBufferException {
265 return PARSER.parseFrom(data, extensionRegistry);
268 throws com.google.protobuf.InvalidProtocolBufferException {
269 return PARSER.parseFrom(data);
273 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
274 throws com.google.protobuf.InvalidProtocolBufferException {
275 return PARSER.parseFrom(data, extensionRegistry);
278 throws java.io.IOException {
279 return com.google.protobuf.GeneratedMessage
280 .parseWithIOException(PARSER, input);
283 java.io.InputStream input,
284 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
285 throws java.io.IOException {
286 return com.google.protobuf.GeneratedMessage
287 .parseWithIOException(PARSER, input, extensionRegistry);
291 throws java.io.IOException {
292 return com.google.protobuf.GeneratedMessage
293 .parseDelimitedWithIOException(PARSER, input);
297 java.io.InputStream input,
298 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
299 throws java.io.IOException {
300 return com.google.protobuf.GeneratedMessage
301 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
304 com.google.protobuf.CodedInputStream input)
305 throws java.io.IOException {
306 return com.google.protobuf.GeneratedMessage
307 .parseWithIOException(PARSER, input);
310 com.google.protobuf.CodedInputStream input,
311 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
312 throws java.io.IOException {
313 return com.google.protobuf.GeneratedMessage
314 .parseWithIOException(PARSER, input, extensionRegistry);
320 return DEFAULT_INSTANCE.toBuilder();
323 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
327 return this == DEFAULT_INSTANCE
333 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
346 public static final class Builder
extends
347 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
350 public static final com.google.protobuf.Descriptors.Descriptor
352 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_descriptor;
356 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
358 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_fieldAccessorTable
359 .ensureFieldAccessorsInitialized(
360 com.google.ortools.sat.LinearExpressionProto.class, com.google.ortools.sat.LinearExpressionProto.Builder.class);
369 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
377 vars_ = emptyIntList();
378 coeffs_ = emptyLongList();
384 public com.google.protobuf.Descriptors.Descriptor
386 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_descriptor;
391 return com.google.ortools.sat.LinearExpressionProto.getDefaultInstance();
398 throw newUninitializedMessageException(result);
406 if (bitField0_ != 0) { buildPartial0(result); }
411 private void buildPartial0(com.google.ortools.sat.LinearExpressionProto result) {
412 int from_bitField0_ = bitField0_;
413 if (((from_bitField0_ & 0x00000001) != 0)) {
414 vars_.makeImmutable();
415 result.vars_ = vars_;
417 if (((from_bitField0_ & 0x00000002) != 0)) {
418 coeffs_.makeImmutable();
419 result.coeffs_ = coeffs_;
421 if (((from_bitField0_ & 0x00000004) != 0)) {
422 result.offset_ = offset_;
427 public Builder
mergeFrom(com.google.protobuf.Message other) {
428 if (other instanceof com.google.ortools.sat.LinearExpressionProto) {
429 return mergeFrom((com.google.ortools.sat.LinearExpressionProto)other);
431 super.mergeFrom(other);
436 public Builder
mergeFrom(com.google.ortools.sat.LinearExpressionProto other) {
437 if (other == com.google.ortools.sat.LinearExpressionProto.getDefaultInstance())
return this;
438 if (!other.vars_.isEmpty()) {
439 if (vars_.isEmpty()) {
441 vars_.makeImmutable();
442 bitField0_ |= 0x00000001;
444 ensureVarsIsMutable();
445 vars_.addAll(other.vars_);
449 if (!other.coeffs_.isEmpty()) {
450 if (coeffs_.isEmpty()) {
451 coeffs_ = other.coeffs_;
452 coeffs_.makeImmutable();
453 bitField0_ |= 0x00000002;
455 ensureCoeffsIsMutable();
456 coeffs_.addAll(other.coeffs_);
460 if (other.getOffset() != 0L) {
463 this.mergeUnknownFields(other.getUnknownFields());
475 com.google.protobuf.CodedInputStream input,
476 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
477 throws java.io.IOException {
478 if (extensionRegistry ==
null) {
479 throw new java.lang.NullPointerException();
482 boolean done =
false;
484 int tag = input.readTag();
490 int v = input.readInt32();
491 ensureVarsIsMutable();
496 int length = input.readRawVarint32();
497 int limit = input.pushLimit(length);
498 ensureVarsIsMutable();
499 while (input.getBytesUntilLimit() > 0) {
500 vars_.addInt(input.readInt32());
502 input.popLimit(limit);
506 long v = input.readInt64();
507 ensureCoeffsIsMutable();
512 int length = input.readRawVarint32();
513 int limit = input.pushLimit(length);
514 ensureCoeffsIsMutable();
515 while (input.getBytesUntilLimit() > 0) {
516 coeffs_.addLong(input.readInt64());
518 input.popLimit(limit);
522 offset_ = input.readInt64();
523 bitField0_ |= 0x00000004;
527 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
534 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
535 throw e.unwrapIOException();
541 private int bitField0_;
543 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
544 private void ensureVarsIsMutable() {
545 if (!vars_.isModifiable()) {
546 vars_ = makeMutableCopy(vars_);
548 bitField0_ |= 0x00000001;
554 public java.util.List<java.lang.Integer>
556 vars_.makeImmutable();
572 return vars_.getInt(index);
581 int index,
int value) {
583 ensureVarsIsMutable();
584 vars_.setInt(index, value);
585 bitField0_ |= 0x00000001;
596 ensureVarsIsMutable();
598 bitField0_ |= 0x00000001;
608 java.lang.Iterable<? extends java.lang.Integer> values) {
609 ensureVarsIsMutable();
610 com.google.protobuf.AbstractMessageLite.Builder.addAll(
612 bitField0_ |= 0x00000001;
621 vars_ = emptyIntList();
622 bitField0_ = (bitField0_ & ~0x00000001);
627 private com.google.protobuf.Internal.LongList coeffs_ = emptyLongList();
628 private void ensureCoeffsIsMutable() {
629 if (!coeffs_.isModifiable()) {
630 coeffs_ = makeMutableCopy(coeffs_);
632 bitField0_ |= 0x00000002;
638 public java.util.List<java.lang.Long>
640 coeffs_.makeImmutable();
648 return coeffs_.size();
656 return coeffs_.getLong(index);
665 int index,
long value) {
667 ensureCoeffsIsMutable();
668 coeffs_.setLong(index, value);
669 bitField0_ |= 0x00000002;
680 ensureCoeffsIsMutable();
681 coeffs_.addLong(value);
682 bitField0_ |= 0x00000002;
692 java.lang.Iterable<? extends java.lang.Long> values) {
693 ensureCoeffsIsMutable();
694 com.google.protobuf.AbstractMessageLite.Builder.addAll(
696 bitField0_ |= 0x00000002;
705 coeffs_ = emptyLongList();
706 bitField0_ = (bitField0_ & ~0x00000002);
711 private long offset_ ;
728 bitField0_ |= 0x00000004;
737 bitField0_ = (bitField0_ & ~0x00000004);
749 DEFAULT_INSTANCE =
new com.google.ortools.sat.LinearExpressionProto();
753 return DEFAULT_INSTANCE;
760 com.google.protobuf.CodedInputStream input,
761 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
762 throws com.google.protobuf.InvalidProtocolBufferException {
765 builder.mergeFrom(input, extensionRegistry);
766 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
767 throw e.setUnfinishedMessage(builder.buildPartial());
768 }
catch (com.google.protobuf.UninitializedMessageException e) {
769 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
770 }
catch (java.io.IOException e) {
771 throw new com.google.protobuf.InvalidProtocolBufferException(e)
772 .setUnfinishedMessage(builder.buildPartial());
774 return builder.buildPartial();
778 public static com.google.protobuf.Parser<LinearExpressionProto>
parser() {
789 return DEFAULT_INSTANCE;