5package com.google.ortools.sat;
17 com.google.protobuf.GeneratedMessage implements
20private static final long serialVersionUID = 0L;
22 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
23 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
35 vars_ = emptyIntList();
36 coeffs_ = emptyLongList();
39 public static final com.google.protobuf.Descriptors.Descriptor
41 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_descriptor;
45 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
47 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_fieldAccessorTable
48 .ensureFieldAccessorsInitialized(
49 com.google.ortools.sat.LinearExpressionProto.class, com.google.ortools.sat.LinearExpressionProto.Builder.class);
53 @SuppressWarnings(
"serial")
54 private com.google.protobuf.Internal.IntList vars_ =
61 public java.util.List<java.lang.Integer>
78 return vars_.getInt(index);
80 private int varsMemoizedSerializedSize = -1;
83 @SuppressWarnings(
"serial")
84 private com.google.protobuf.Internal.LongList coeffs_ =
91 public java.util.List<java.lang.Long>
100 return coeffs_.size();
108 return coeffs_.getLong(index);
110 private int coeffsMemoizedSerializedSize = -1;
113 private long offset_ = 0L;
123 private byte memoizedIsInitialized = -1;
130 memoizedIsInitialized = 1;
135 public void writeTo(com.google.protobuf.CodedOutputStream output)
136 throws java.io.IOException {
139 output.writeUInt32NoTag(10);
140 output.writeUInt32NoTag(varsMemoizedSerializedSize);
142 for (
int i = 0; i < vars_.size(); i++) {
143 output.writeInt32NoTag(vars_.getInt(i));
146 output.writeUInt32NoTag(18);
147 output.writeUInt32NoTag(coeffsMemoizedSerializedSize);
149 for (
int i = 0; i < coeffs_.size(); i++) {
150 output.writeInt64NoTag(coeffs_.getLong(i));
153 output.writeInt64(3, offset_);
155 getUnknownFields().writeTo(output);
160 int size = memoizedSize;
161 if (size != -1)
return size;
166 for (
int i = 0; i < vars_.size(); i++) {
167 dataSize += com.google.protobuf.CodedOutputStream
168 .computeInt32SizeNoTag(vars_.getInt(i));
173 size += com.google.protobuf.CodedOutputStream
174 .computeInt32SizeNoTag(dataSize);
176 varsMemoizedSerializedSize = dataSize;
180 for (
int i = 0; i < coeffs_.size(); i++) {
181 dataSize += com.google.protobuf.CodedOutputStream
182 .computeInt64SizeNoTag(coeffs_.getLong(i));
187 size += com.google.protobuf.CodedOutputStream
188 .computeInt32SizeNoTag(dataSize);
190 coeffsMemoizedSerializedSize = dataSize;
193 size += com.google.protobuf.CodedOutputStream
194 .computeInt64Size(3, offset_);
196 size += getUnknownFields().getSerializedSize();
202 public boolean equals(
final java.lang.Object obj) {
206 if (!(obj instanceof com.google.ortools.sat.LinearExpressionProto)) {
207 return super.equals(obj);
217 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
223 if (memoizedHashCode != 0) {
224 return memoizedHashCode;
237 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
239 hash = (29 * hash) + getUnknownFields().hashCode();
240 memoizedHashCode = hash;
245 java.nio.ByteBuffer data)
246 throws com.google.protobuf.InvalidProtocolBufferException {
247 return PARSER.parseFrom(data);
250 java.nio.ByteBuffer data,
251 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
252 throws com.google.protobuf.InvalidProtocolBufferException {
253 return PARSER.parseFrom(data, extensionRegistry);
256 com.google.protobuf.ByteString data)
257 throws com.google.protobuf.InvalidProtocolBufferException {
258 return PARSER.parseFrom(data);
261 com.google.protobuf.ByteString data,
262 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
263 throws com.google.protobuf.InvalidProtocolBufferException {
264 return PARSER.parseFrom(data, extensionRegistry);
267 throws com.google.protobuf.InvalidProtocolBufferException {
268 return PARSER.parseFrom(data);
272 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
273 throws com.google.protobuf.InvalidProtocolBufferException {
274 return PARSER.parseFrom(data, extensionRegistry);
277 throws java.io.IOException {
278 return com.google.protobuf.GeneratedMessage
279 .parseWithIOException(PARSER, input);
282 java.io.InputStream input,
283 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
284 throws java.io.IOException {
285 return com.google.protobuf.GeneratedMessage
286 .parseWithIOException(PARSER, input, extensionRegistry);
290 throws java.io.IOException {
291 return com.google.protobuf.GeneratedMessage
292 .parseDelimitedWithIOException(PARSER, input);
296 java.io.InputStream input,
297 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
298 throws java.io.IOException {
299 return com.google.protobuf.GeneratedMessage
300 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
303 com.google.protobuf.CodedInputStream input)
304 throws java.io.IOException {
305 return com.google.protobuf.GeneratedMessage
306 .parseWithIOException(PARSER, input);
309 com.google.protobuf.CodedInputStream input,
310 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
311 throws java.io.IOException {
312 return com.google.protobuf.GeneratedMessage
313 .parseWithIOException(PARSER, input, extensionRegistry);
326 return this == DEFAULT_INSTANCE
332 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
346 com.google.protobuf.GeneratedMessage.
Builder<Builder> implements
349 public static final com.google.protobuf.Descriptors.Descriptor
351 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_descriptor;
355 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
357 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_fieldAccessorTable
358 .ensureFieldAccessorsInitialized(
359 com.google.ortools.sat.LinearExpressionProto.class, com.google.ortools.sat.LinearExpressionProto.Builder.class);
368 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
376 vars_ = emptyIntList();
377 coeffs_ = emptyLongList();
383 public com.google.protobuf.Descriptors.Descriptor
385 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_LinearExpressionProto_descriptor;
390 return com.google.ortools.sat.LinearExpressionProto.getDefaultInstance();
397 throw newUninitializedMessageException(result);
405 if (bitField0_ != 0) { buildPartial0(result); }
410 private void buildPartial0(com.google.ortools.sat.LinearExpressionProto result) {
411 int from_bitField0_ = bitField0_;
412 if (((from_bitField0_ & 0x00000001) != 0)) {
413 vars_.makeImmutable();
414 result.vars_ = vars_;
416 if (((from_bitField0_ & 0x00000002) != 0)) {
417 coeffs_.makeImmutable();
418 result.coeffs_ = coeffs_;
420 if (((from_bitField0_ & 0x00000004) != 0)) {
421 result.offset_ = offset_;
427 if (other instanceof com.google.ortools.sat.LinearExpressionProto) {
428 return mergeFrom((com.google.ortools.sat.LinearExpressionProto)other);
430 super.mergeFrom(other);
436 if (other == com.google.ortools.sat.LinearExpressionProto.getDefaultInstance())
return this;
437 if (!other.vars_.isEmpty()) {
438 if (vars_.isEmpty()) {
440 vars_.makeImmutable();
441 bitField0_ |= 0x00000001;
443 ensureVarsIsMutable();
444 vars_.addAll(other.vars_);
448 if (!other.coeffs_.isEmpty()) {
449 if (coeffs_.isEmpty()) {
450 coeffs_ = other.coeffs_;
451 coeffs_.makeImmutable();
452 bitField0_ |= 0x00000002;
454 ensureCoeffsIsMutable();
455 coeffs_.addAll(other.coeffs_);
459 if (other.getOffset() != 0L) {
462 this.mergeUnknownFields(other.getUnknownFields());
474 com.google.protobuf.CodedInputStream input,
475 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
476 throws java.io.IOException {
477 if (extensionRegistry ==
null) {
478 throw new java.lang.NullPointerException();
481 boolean done =
false;
483 int tag = input.readTag();
489 int v = input.readInt32();
490 ensureVarsIsMutable();
495 int length = input.readRawVarint32();
496 int limit = input.pushLimit(length);
497 ensureVarsIsMutable();
498 while (input.getBytesUntilLimit() > 0) {
499 vars_.addInt(input.readInt32());
501 input.popLimit(limit);
505 long v = input.readInt64();
506 ensureCoeffsIsMutable();
511 int length = input.readRawVarint32();
512 int limit = input.pushLimit(length);
513 ensureCoeffsIsMutable();
514 while (input.getBytesUntilLimit() > 0) {
515 coeffs_.addLong(input.readInt64());
517 input.popLimit(limit);
521 offset_ = input.readInt64();
522 bitField0_ |= 0x00000004;
526 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
533 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
534 throw e.unwrapIOException();
540 private int bitField0_;
542 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
543 private void ensureVarsIsMutable() {
544 if (!vars_.isModifiable()) {
545 vars_ = makeMutableCopy(vars_);
547 bitField0_ |= 0x00000001;
553 public java.util.List<java.lang.Integer>
555 vars_.makeImmutable();
571 return vars_.getInt(index);
580 int index,
int value) {
582 ensureVarsIsMutable();
583 vars_.setInt(index, value);
584 bitField0_ |= 0x00000001;
595 ensureVarsIsMutable();
597 bitField0_ |= 0x00000001;
607 java.lang.Iterable<? extends java.lang.Integer> values) {
608 ensureVarsIsMutable();
609 com.google.protobuf.AbstractMessageLite.Builder.addAll(
611 bitField0_ |= 0x00000001;
620 vars_ = emptyIntList();
621 bitField0_ = (bitField0_ & ~0x00000001);
626 private com.google.protobuf.Internal.LongList coeffs_ = emptyLongList();
627 private void ensureCoeffsIsMutable() {
628 if (!coeffs_.isModifiable()) {
629 coeffs_ = makeMutableCopy(coeffs_);
631 bitField0_ |= 0x00000002;
637 public java.util.List<java.lang.Long>
639 coeffs_.makeImmutable();
647 return coeffs_.size();
655 return coeffs_.getLong(index);
664 int index,
long value) {
666 ensureCoeffsIsMutable();
667 coeffs_.setLong(index, value);
668 bitField0_ |= 0x00000002;
679 ensureCoeffsIsMutable();
680 coeffs_.addLong(value);
681 bitField0_ |= 0x00000002;
691 java.lang.Iterable<? extends java.lang.Long> values) {
692 ensureCoeffsIsMutable();
693 com.google.protobuf.AbstractMessageLite.Builder.addAll(
695 bitField0_ |= 0x00000002;
704 coeffs_ = emptyLongList();
705 bitField0_ = (bitField0_ & ~0x00000002);
710 private long offset_ ;
727 bitField0_ |= 0x00000004;
736 bitField0_ = (bitField0_ & ~0x00000004);
748 DEFAULT_INSTANCE =
new com.google.ortools.sat.LinearExpressionProto();
752 return DEFAULT_INSTANCE;
759 com.google.protobuf.CodedInputStream input,
760 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
761 throws com.google.protobuf.InvalidProtocolBufferException {
764 builder.mergeFrom(input, extensionRegistry);
765 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
766 throw e.setUnfinishedMessage(builder.buildPartial());
767 }
catch (com.google.protobuf.UninitializedMessageException e) {
768 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
769 }
catch (java.io.IOException e) {
770 throw new com.google.protobuf.InvalidProtocolBufferException(e)
771 .setUnfinishedMessage(builder.buildPartial());
773 return builder.buildPartial();
788 return DEFAULT_INSTANCE;