Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
ElementConstraintProto.java
Go to the documentation of this file.
1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: ortools/sat/cp_model.proto
3
4// Protobuf Java Version: 4.26.1
5package com.google.ortools.sat;
6
15public final class ElementConstraintProto extends
16 com.google.protobuf.GeneratedMessage implements
17 // @@protoc_insertion_point(message_implements:operations_research.sat.ElementConstraintProto)
19private static final long serialVersionUID = 0L;
20 static {
21 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
22 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
23 /* major= */ 4,
24 /* minor= */ 26,
25 /* patch= */ 1,
26 /* suffix= */ "",
27 ElementConstraintProto.class.getName());
28 }
29 // Use ElementConstraintProto.newBuilder() to construct.
30 private ElementConstraintProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
31 super(builder);
32 }
33 private ElementConstraintProto() {
34 vars_ = emptyIntList();
35 }
36
37 public static final com.google.protobuf.Descriptors.Descriptor
39 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ElementConstraintProto_descriptor;
40 }
41
42 @java.lang.Override
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);
48 }
49
50 public static final int INDEX_FIELD_NUMBER = 1;
51 private int index_ = 0;
56 @java.lang.Override
57 public int getIndex() {
58 return index_;
59 }
60
61 public static final int TARGET_FIELD_NUMBER = 2;
62 private int target_ = 0;
67 @java.lang.Override
68 public int getTarget() {
69 return target_;
70 }
71
72 public static final int VARS_FIELD_NUMBER = 3;
73 @SuppressWarnings("serial")
74 private com.google.protobuf.Internal.IntList vars_ =
75 emptyIntList();
80 @java.lang.Override
81 public java.util.List<java.lang.Integer>
83 return vars_;
84 }
89 public int getVarsCount() {
90 return vars_.size();
91 }
97 public int getVars(int index) {
98 return vars_.getInt(index);
99 }
100 private int varsMemoizedSerializedSize = -1;
101
102 private byte memoizedIsInitialized = -1;
103 @java.lang.Override
104 public final boolean isInitialized() {
105 byte isInitialized = memoizedIsInitialized;
106 if (isInitialized == 1) return true;
107 if (isInitialized == 0) return false;
108
109 memoizedIsInitialized = 1;
110 return true;
111 }
112
113 @java.lang.Override
114 public void writeTo(com.google.protobuf.CodedOutputStream output)
115 throws java.io.IOException {
117 if (index_ != 0) {
118 output.writeInt32(1, index_);
119 }
120 if (target_ != 0) {
121 output.writeInt32(2, target_);
122 }
123 if (getVarsList().size() > 0) {
124 output.writeUInt32NoTag(26);
125 output.writeUInt32NoTag(varsMemoizedSerializedSize);
126 }
127 for (int i = 0; i < vars_.size(); i++) {
128 output.writeInt32NoTag(vars_.getInt(i));
129 }
130 getUnknownFields().writeTo(output);
131 }
132
133 @java.lang.Override
134 public int getSerializedSize() {
135 int size = memoizedSize;
136 if (size != -1) return size;
137
138 size = 0;
139 if (index_ != 0) {
140 size += com.google.protobuf.CodedOutputStream
141 .computeInt32Size(1, index_);
142 }
143 if (target_ != 0) {
144 size += com.google.protobuf.CodedOutputStream
145 .computeInt32Size(2, target_);
146 }
147 {
148 int dataSize = 0;
149 for (int i = 0; i < vars_.size(); i++) {
150 dataSize += com.google.protobuf.CodedOutputStream
151 .computeInt32SizeNoTag(vars_.getInt(i));
152 }
153 size += dataSize;
154 if (!getVarsList().isEmpty()) {
155 size += 1;
156 size += com.google.protobuf.CodedOutputStream
157 .computeInt32SizeNoTag(dataSize);
158 }
159 varsMemoizedSerializedSize = dataSize;
160 }
161 size += getUnknownFields().getSerializedSize();
162 memoizedSize = size;
163 return size;
164 }
165
166 @java.lang.Override
167 public boolean equals(final java.lang.Object obj) {
168 if (obj == this) {
169 return true;
170 }
171 if (!(obj instanceof com.google.ortools.sat.ElementConstraintProto)) {
172 return super.equals(obj);
173 }
174 com.google.ortools.sat.ElementConstraintProto other = (com.google.ortools.sat.ElementConstraintProto) obj;
175
176 if (getIndex()
177 != other.getIndex()) return false;
178 if (getTarget()
179 != other.getTarget()) return false;
180 if (!getVarsList()
181 .equals(other.getVarsList())) return false;
182 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
183 return true;
184 }
185
186 @java.lang.Override
187 public int hashCode() {
188 if (memoizedHashCode != 0) {
189 return memoizedHashCode;
190 }
191 int hash = 41;
192 hash = (19 * hash) + getDescriptor().hashCode();
193 hash = (37 * hash) + INDEX_FIELD_NUMBER;
194 hash = (53 * hash) + getIndex();
195 hash = (37 * hash) + TARGET_FIELD_NUMBER;
196 hash = (53 * hash) + getTarget();
197 if (getVarsCount() > 0) {
198 hash = (37 * hash) + VARS_FIELD_NUMBER;
199 hash = (53 * hash) + getVarsList().hashCode();
200 }
201 hash = (29 * hash) + getUnknownFields().hashCode();
202 memoizedHashCode = hash;
203 return hash;
204 }
205
207 java.nio.ByteBuffer data)
208 throws com.google.protobuf.InvalidProtocolBufferException {
209 return PARSER.parseFrom(data);
210 }
212 java.nio.ByteBuffer data,
213 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
214 throws com.google.protobuf.InvalidProtocolBufferException {
215 return PARSER.parseFrom(data, extensionRegistry);
216 }
218 com.google.protobuf.ByteString data)
219 throws com.google.protobuf.InvalidProtocolBufferException {
220 return PARSER.parseFrom(data);
221 }
223 com.google.protobuf.ByteString data,
224 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
225 throws com.google.protobuf.InvalidProtocolBufferException {
226 return PARSER.parseFrom(data, extensionRegistry);
227 }
229 throws com.google.protobuf.InvalidProtocolBufferException {
230 return PARSER.parseFrom(data);
231 }
233 byte[] data,
234 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
235 throws com.google.protobuf.InvalidProtocolBufferException {
236 return PARSER.parseFrom(data, extensionRegistry);
237 }
238 public static com.google.ortools.sat.ElementConstraintProto parseFrom(java.io.InputStream input)
239 throws java.io.IOException {
240 return com.google.protobuf.GeneratedMessage
241 .parseWithIOException(PARSER, input);
242 }
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);
249 }
250
252 throws java.io.IOException {
253 return com.google.protobuf.GeneratedMessage
254 .parseDelimitedWithIOException(PARSER, input);
255 }
256
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);
263 }
265 com.google.protobuf.CodedInputStream input)
266 throws java.io.IOException {
267 return com.google.protobuf.GeneratedMessage
268 .parseWithIOException(PARSER, input);
269 }
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);
276 }
277
278 @java.lang.Override
279 public Builder newBuilderForType() { return newBuilder(); }
280 public static Builder newBuilder() {
281 return DEFAULT_INSTANCE.toBuilder();
282 }
283 public static Builder newBuilder(com.google.ortools.sat.ElementConstraintProto prototype) {
284 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
285 }
286 @java.lang.Override
288 return this == DEFAULT_INSTANCE
289 ? new Builder() : new Builder().mergeFrom(this);
290 }
291
292 @java.lang.Override
294 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
295 Builder builder = new Builder(parent);
296 return builder;
297 }
306 public static final class Builder extends
307 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
308 // @@protoc_insertion_point(builder_implements:operations_research.sat.ElementConstraintProto)
309 com.google.ortools.sat.ElementConstraintProtoOrBuilder {
310 public static final com.google.protobuf.Descriptors.Descriptor
312 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ElementConstraintProto_descriptor;
313 }
314
315 @java.lang.Override
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);
321 }
322
323 // Construct using com.google.ortools.sat.ElementConstraintProto.newBuilder()
324 private Builder() {
325
326 }
327
328 private Builder(
329 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
330 super(parent);
331
332 }
333 @java.lang.Override
334 public Builder clear() {
335 super.clear();
336 bitField0_ = 0;
337 index_ = 0;
338 target_ = 0;
339 vars_ = emptyIntList();
340 return this;
341 }
342
343 @java.lang.Override
344 public com.google.protobuf.Descriptors.Descriptor
346 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ElementConstraintProto_descriptor;
347 }
348
349 @java.lang.Override
351 return com.google.ortools.sat.ElementConstraintProto.getDefaultInstance();
352 }
353
354 @java.lang.Override
357 if (!result.isInitialized()) {
358 throw newUninitializedMessageException(result);
359 }
360 return result;
361 }
362
363 @java.lang.Override
365 com.google.ortools.sat.ElementConstraintProto result = new com.google.ortools.sat.ElementConstraintProto(this);
366 if (bitField0_ != 0) { buildPartial0(result); }
367 onBuilt();
368 return result;
369 }
370
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_;
375 }
376 if (((from_bitField0_ & 0x00000002) != 0)) {
377 result.target_ = target_;
378 }
379 if (((from_bitField0_ & 0x00000004) != 0)) {
380 vars_.makeImmutable();
381 result.vars_ = vars_;
382 }
383 }
384
385 @java.lang.Override
386 public Builder mergeFrom(com.google.protobuf.Message other) {
387 if (other instanceof com.google.ortools.sat.ElementConstraintProto) {
388 return mergeFrom((com.google.ortools.sat.ElementConstraintProto)other);
389 } else {
390 super.mergeFrom(other);
391 return this;
392 }
393 }
394
395 public Builder mergeFrom(com.google.ortools.sat.ElementConstraintProto other) {
396 if (other == com.google.ortools.sat.ElementConstraintProto.getDefaultInstance()) return this;
397 if (other.getIndex() != 0) {
398 setIndex(other.getIndex());
399 }
400 if (other.getTarget() != 0) {
401 setTarget(other.getTarget());
402 }
403 if (!other.vars_.isEmpty()) {
404 if (vars_.isEmpty()) {
405 vars_ = other.vars_;
406 vars_.makeImmutable();
407 bitField0_ |= 0x00000004;
408 } else {
409 ensureVarsIsMutable();
410 vars_.addAll(other.vars_);
411 }
412 onChanged();
413 }
414 this.mergeUnknownFields(other.getUnknownFields());
415 onChanged();
416 return this;
417 }
418
419 @java.lang.Override
420 public final boolean isInitialized() {
421 return true;
422 }
423
424 @java.lang.Override
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();
431 }
432 try {
433 boolean done = false;
434 while (!done) {
435 int tag = input.readTag();
436 switch (tag) {
437 case 0:
438 done = true;
439 break;
440 case 8: {
441 index_ = input.readInt32();
442 bitField0_ |= 0x00000001;
443 break;
444 } // case 8
445 case 16: {
446 target_ = input.readInt32();
447 bitField0_ |= 0x00000002;
448 break;
449 } // case 16
450 case 24: {
451 int v = input.readInt32();
452 ensureVarsIsMutable();
453 vars_.addInt(v);
454 break;
455 } // case 24
456 case 26: {
457 int length = input.readRawVarint32();
458 int limit = input.pushLimit(length);
459 ensureVarsIsMutable();
460 while (input.getBytesUntilLimit() > 0) {
461 vars_.addInt(input.readInt32());
462 }
463 input.popLimit(limit);
464 break;
465 } // case 26
466 default: {
467 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
468 done = true; // was an endgroup tag
469 }
470 break;
471 } // default:
472 } // switch (tag)
473 } // while (!done)
474 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
475 throw e.unwrapIOException();
476 } finally {
477 onChanged();
478 } // finally
479 return this;
480 }
481 private int bitField0_;
482
483 private int index_ ;
488 @java.lang.Override
489 public int getIndex() {
490 return index_;
491 }
497 public Builder setIndex(int value) {
498
499 index_ = value;
500 bitField0_ |= 0x00000001;
501 onChanged();
502 return this;
503 }
509 bitField0_ = (bitField0_ & ~0x00000001);
510 index_ = 0;
511 onChanged();
512 return this;
513 }
514
515 private int target_ ;
520 @java.lang.Override
521 public int getTarget() {
522 return target_;
523 }
529 public Builder setTarget(int value) {
530
531 target_ = value;
532 bitField0_ |= 0x00000002;
533 onChanged();
534 return this;
535 }
541 bitField0_ = (bitField0_ & ~0x00000002);
542 target_ = 0;
543 onChanged();
544 return this;
545 }
546
547 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
548 private void ensureVarsIsMutable() {
549 if (!vars_.isModifiable()) {
550 vars_ = makeMutableCopy(vars_);
551 }
552 bitField0_ |= 0x00000004;
553 }
558 public java.util.List<java.lang.Integer>
560 vars_.makeImmutable();
561 return vars_;
562 }
567 public int getVarsCount() {
568 return vars_.size();
569 }
575 public int getVars(int index) {
576 return vars_.getInt(index);
577 }
585 int index, int value) {
586
587 ensureVarsIsMutable();
588 vars_.setInt(index, value);
589 bitField0_ |= 0x00000004;
590 onChanged();
591 return this;
592 }
598 public Builder addVars(int value) {
599
600 ensureVarsIsMutable();
601 vars_.addInt(value);
602 bitField0_ |= 0x00000004;
603 onChanged();
604 return this;
605 }
612 java.lang.Iterable<? extends java.lang.Integer> values) {
613 ensureVarsIsMutable();
614 com.google.protobuf.AbstractMessageLite.Builder.addAll(
615 values, vars_);
616 bitField0_ |= 0x00000004;
617 onChanged();
618 return this;
619 }
625 vars_ = emptyIntList();
626 bitField0_ = (bitField0_ & ~0x00000004);
627 onChanged();
628 return this;
629 }
630
631 // @@protoc_insertion_point(builder_scope:operations_research.sat.ElementConstraintProto)
632 }
633
634 // @@protoc_insertion_point(class_scope:operations_research.sat.ElementConstraintProto)
635 private static final com.google.ortools.sat.ElementConstraintProto DEFAULT_INSTANCE;
636 static {
637 DEFAULT_INSTANCE = new com.google.ortools.sat.ElementConstraintProto();
638 }
639
641 return DEFAULT_INSTANCE;
642 }
643
644 private static final com.google.protobuf.Parser<ElementConstraintProto>
645 PARSER = new com.google.protobuf.AbstractParser<ElementConstraintProto>() {
646 @java.lang.Override
647 public ElementConstraintProto parsePartialFrom(
648 com.google.protobuf.CodedInputStream input,
649 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
650 throws com.google.protobuf.InvalidProtocolBufferException {
651 Builder builder = newBuilder();
652 try {
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());
661 }
662 return builder.buildPartial();
663 }
664 };
665
666 public static com.google.protobuf.Parser<ElementConstraintProto> parser() {
667 return PARSER;
668 }
669
670 @java.lang.Override
671 public com.google.protobuf.Parser<ElementConstraintProto> getParserForType() {
672 return PARSER;
673 }
674
675 @java.lang.Override
679
680}
681
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
Builder mergeFrom(com.google.ortools.sat.ElementConstraintProto other)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
com.google.ortools.sat.ElementConstraintProto build()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.sat.ElementConstraintProto getDefaultInstanceForType()
Builder mergeFrom(com.google.protobuf.Message other)
Builder addAllVars(java.lang.Iterable<? extends java.lang.Integer > values)
com.google.ortools.sat.ElementConstraintProto buildPartial()
static com.google.ortools.sat.ElementConstraintProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.ElementConstraintProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.Parser< ElementConstraintProto > getParserForType()
static com.google.ortools.sat.ElementConstraintProto parseFrom(java.io.InputStream input)
void writeTo(com.google.protobuf.CodedOutputStream output)
static Builder newBuilder(com.google.ortools.sat.ElementConstraintProto prototype)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
static com.google.ortools.sat.ElementConstraintProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.ElementConstraintProto parseFrom(com.google.protobuf.CodedInputStream input)
static com.google.ortools.sat.ElementConstraintProto parseFrom(java.nio.ByteBuffer data)
static com.google.protobuf.Parser< ElementConstraintProto > parser()
static com.google.ortools.sat.ElementConstraintProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.ElementConstraintProto parseDelimitedFrom(java.io.InputStream input)
java.util.List< java.lang.Integer > getVarsList()
static com.google.ortools.sat.ElementConstraintProto getDefaultInstance()
com.google.ortools.sat.ElementConstraintProto getDefaultInstanceForType()
static com.google.ortools.sat.ElementConstraintProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
static com.google.ortools.sat.ElementConstraintProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
static com.google.ortools.sat.ElementConstraintProto parseFrom(byte[] data)
static com.google.ortools.sat.ElementConstraintProto parseFrom(com.google.protobuf.ByteString data)