5package com.google.ortools.sat;
16 com.google.protobuf.GeneratedMessage implements
19private static final long serialVersionUID = 0L;
21 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
22 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
34 vars_ = emptyIntList();
37 public static final com.google.protobuf.Descriptors.Descriptor
39 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ElementConstraintProto_descriptor;
43 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
45 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ElementConstraintProto_fieldAccessorTable
46 .ensureFieldAccessorsInitialized(
47 com.google.ortools.sat.ElementConstraintProto.class, com.google.ortools.sat.ElementConstraintProto.Builder.class);
51 private int index_ = 0;
62 private int target_ = 0;
73 @SuppressWarnings(
"serial")
74 private com.google.protobuf.Internal.IntList vars_ =
81 public java.util.List<java.lang.Integer>
98 return vars_.getInt(index);
100 private int varsMemoizedSerializedSize = -1;
102 private byte memoizedIsInitialized = -1;
109 memoizedIsInitialized = 1;
114 public void writeTo(com.google.protobuf.CodedOutputStream output)
115 throws java.io.IOException {
118 output.writeInt32(1, index_);
121 output.writeInt32(2, target_);
124 output.writeUInt32NoTag(26);
125 output.writeUInt32NoTag(varsMemoizedSerializedSize);
127 for (
int i = 0; i < vars_.size(); i++) {
128 output.writeInt32NoTag(vars_.getInt(i));
130 getUnknownFields().writeTo(output);
135 int size = memoizedSize;
136 if (size != -1)
return size;
140 size += com.google.protobuf.CodedOutputStream
141 .computeInt32Size(1, index_);
144 size += com.google.protobuf.CodedOutputStream
145 .computeInt32Size(2, target_);
149 for (
int i = 0; i < vars_.size(); i++) {
150 dataSize += com.google.protobuf.CodedOutputStream
151 .computeInt32SizeNoTag(vars_.getInt(i));
156 size += com.google.protobuf.CodedOutputStream
157 .computeInt32SizeNoTag(dataSize);
159 varsMemoizedSerializedSize = dataSize;
161 size += getUnknownFields().getSerializedSize();
167 public boolean equals(
final java.lang.Object obj) {
171 if (!(obj instanceof com.google.ortools.sat.ElementConstraintProto)) {
172 return super.equals(obj);
182 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
188 if (memoizedHashCode != 0) {
189 return memoizedHashCode;
201 hash = (29 * hash) + getUnknownFields().hashCode();
202 memoizedHashCode = hash;
207 java.nio.ByteBuffer data)
208 throws com.google.protobuf.InvalidProtocolBufferException {
209 return PARSER.parseFrom(data);
212 java.nio.ByteBuffer data,
213 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
214 throws com.google.protobuf.InvalidProtocolBufferException {
215 return PARSER.parseFrom(data, extensionRegistry);
218 com.google.protobuf.ByteString data)
219 throws com.google.protobuf.InvalidProtocolBufferException {
220 return PARSER.parseFrom(data);
223 com.google.protobuf.ByteString data,
224 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
225 throws com.google.protobuf.InvalidProtocolBufferException {
226 return PARSER.parseFrom(data, extensionRegistry);
229 throws com.google.protobuf.InvalidProtocolBufferException {
230 return PARSER.parseFrom(data);
234 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
235 throws com.google.protobuf.InvalidProtocolBufferException {
236 return PARSER.parseFrom(data, extensionRegistry);
239 throws java.io.IOException {
240 return com.google.protobuf.GeneratedMessage
241 .parseWithIOException(PARSER, input);
244 java.io.InputStream input,
245 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
246 throws java.io.IOException {
247 return com.google.protobuf.GeneratedMessage
248 .parseWithIOException(PARSER, input, extensionRegistry);
252 throws java.io.IOException {
253 return com.google.protobuf.GeneratedMessage
254 .parseDelimitedWithIOException(PARSER, input);
258 java.io.InputStream input,
259 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
260 throws java.io.IOException {
261 return com.google.protobuf.GeneratedMessage
262 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
265 com.google.protobuf.CodedInputStream input)
266 throws java.io.IOException {
267 return com.google.protobuf.GeneratedMessage
268 .parseWithIOException(PARSER, input);
271 com.google.protobuf.CodedInputStream input,
272 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
273 throws java.io.IOException {
274 return com.google.protobuf.GeneratedMessage
275 .parseWithIOException(PARSER, input, extensionRegistry);
288 return this == DEFAULT_INSTANCE
294 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
307 com.google.protobuf.GeneratedMessage.
Builder<Builder> implements
310 public static final com.google.protobuf.Descriptors.Descriptor
312 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ElementConstraintProto_descriptor;
316 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
318 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ElementConstraintProto_fieldAccessorTable
319 .ensureFieldAccessorsInitialized(
320 com.google.ortools.sat.ElementConstraintProto.class, com.google.ortools.sat.ElementConstraintProto.Builder.class);
329 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
339 vars_ = emptyIntList();
344 public com.google.protobuf.Descriptors.Descriptor
346 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ElementConstraintProto_descriptor;
351 return com.google.ortools.sat.ElementConstraintProto.getDefaultInstance();
358 throw newUninitializedMessageException(result);
366 if (bitField0_ != 0) { buildPartial0(result); }
371 private void buildPartial0(com.google.ortools.sat.ElementConstraintProto result) {
372 int from_bitField0_ = bitField0_;
373 if (((from_bitField0_ & 0x00000001) != 0)) {
374 result.index_ = index_;
376 if (((from_bitField0_ & 0x00000002) != 0)) {
377 result.target_ = target_;
379 if (((from_bitField0_ & 0x00000004) != 0)) {
380 vars_.makeImmutable();
381 result.vars_ = vars_;
387 if (other instanceof com.google.ortools.sat.ElementConstraintProto) {
388 return mergeFrom((com.google.ortools.sat.ElementConstraintProto)other);
390 super.mergeFrom(other);
396 if (other == com.google.ortools.sat.ElementConstraintProto.getDefaultInstance())
return this;
397 if (other.getIndex() != 0) {
400 if (other.getTarget() != 0) {
403 if (!other.vars_.isEmpty()) {
404 if (vars_.isEmpty()) {
406 vars_.makeImmutable();
407 bitField0_ |= 0x00000004;
409 ensureVarsIsMutable();
410 vars_.addAll(other.vars_);
414 this.mergeUnknownFields(other.getUnknownFields());
426 com.google.protobuf.CodedInputStream input,
427 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
428 throws java.io.IOException {
429 if (extensionRegistry ==
null) {
430 throw new java.lang.NullPointerException();
433 boolean done =
false;
435 int tag = input.readTag();
441 index_ = input.readInt32();
442 bitField0_ |= 0x00000001;
446 target_ = input.readInt32();
447 bitField0_ |= 0x00000002;
451 int v = input.readInt32();
452 ensureVarsIsMutable();
457 int length = input.readRawVarint32();
458 int limit = input.pushLimit(length);
459 ensureVarsIsMutable();
460 while (input.getBytesUntilLimit() > 0) {
461 vars_.addInt(input.readInt32());
463 input.popLimit(limit);
467 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
474 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
475 throw e.unwrapIOException();
481 private int bitField0_;
500 bitField0_ |= 0x00000001;
509 bitField0_ = (bitField0_ & ~0x00000001);
515 private int target_ ;
532 bitField0_ |= 0x00000002;
541 bitField0_ = (bitField0_ & ~0x00000002);
547 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
548 private void ensureVarsIsMutable() {
549 if (!vars_.isModifiable()) {
550 vars_ = makeMutableCopy(vars_);
552 bitField0_ |= 0x00000004;
558 public java.util.List<java.lang.Integer>
560 vars_.makeImmutable();
576 return vars_.getInt(index);
585 int index,
int value) {
587 ensureVarsIsMutable();
588 vars_.setInt(index, value);
589 bitField0_ |= 0x00000004;
600 ensureVarsIsMutable();
602 bitField0_ |= 0x00000004;
612 java.lang.Iterable<? extends java.lang.Integer> values) {
613 ensureVarsIsMutable();
614 com.google.protobuf.AbstractMessageLite.Builder.addAll(
616 bitField0_ |= 0x00000004;
625 vars_ = emptyIntList();
626 bitField0_ = (bitField0_ & ~0x00000004);
637 DEFAULT_INSTANCE =
new com.google.ortools.sat.ElementConstraintProto();
641 return DEFAULT_INSTANCE;
648 com.google.protobuf.CodedInputStream input,
649 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
650 throws com.google.protobuf.InvalidProtocolBufferException {
653 builder.mergeFrom(input, extensionRegistry);
654 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
655 throw e.setUnfinishedMessage(builder.buildPartial());
656 }
catch (com.google.protobuf.UninitializedMessageException e) {
657 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
658 }
catch (java.io.IOException e) {
659 throw new com.google.protobuf.InvalidProtocolBufferException(e)
660 .setUnfinishedMessage(builder.buildPartial());
662 return builder.buildPartial();
677 return DEFAULT_INSTANCE;