Java Reference

Java Reference

ListOfVariablesProto.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
4package com.google.ortools.sat;
5
13public final class ListOfVariablesProto extends
14 com.google.protobuf.GeneratedMessageV3 implements
15 // @@protoc_insertion_point(message_implements:operations_research.sat.ListOfVariablesProto)
17private static final long serialVersionUID = 0L;
18 // Use ListOfVariablesProto.newBuilder() to construct.
19 private ListOfVariablesProto(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
20 super(builder);
21 }
22 private ListOfVariablesProto() {
23 vars_ = emptyIntList();
24 }
25
26 @java.lang.Override
27 @SuppressWarnings({"unused"})
28 protected java.lang.Object newInstance(
29 UnusedPrivateParameter unused) {
30 return new ListOfVariablesProto();
31 }
32
33 @java.lang.Override
34 public final com.google.protobuf.UnknownFieldSet
36 return this.unknownFields;
37 }
39 com.google.protobuf.CodedInputStream input,
40 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
41 throws com.google.protobuf.InvalidProtocolBufferException {
42 this();
43 if (extensionRegistry == null) {
44 throw new java.lang.NullPointerException();
45 }
46 int mutable_bitField0_ = 0;
47 com.google.protobuf.UnknownFieldSet.Builder unknownFields =
48 com.google.protobuf.UnknownFieldSet.newBuilder();
49 try {
50 boolean done = false;
51 while (!done) {
52 int tag = input.readTag();
53 switch (tag) {
54 case 0:
55 done = true;
56 break;
57 case 8: {
58 if (!((mutable_bitField0_ & 0x00000001) != 0)) {
59 vars_ = newIntList();
60 mutable_bitField0_ |= 0x00000001;
61 }
62 vars_.addInt(input.readInt32());
63 break;
64 }
65 case 10: {
66 int length = input.readRawVarint32();
67 int limit = input.pushLimit(length);
68 if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) {
69 vars_ = newIntList();
70 mutable_bitField0_ |= 0x00000001;
71 }
72 while (input.getBytesUntilLimit() > 0) {
73 vars_.addInt(input.readInt32());
74 }
75 input.popLimit(limit);
76 break;
77 }
78 default: {
79 if (!parseUnknownField(
80 input, unknownFields, extensionRegistry, tag)) {
81 done = true;
82 }
83 break;
84 }
85 }
86 }
87 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
88 throw e.setUnfinishedMessage(this);
89 } catch (java.io.IOException e) {
90 throw new com.google.protobuf.InvalidProtocolBufferException(
91 e).setUnfinishedMessage(this);
92 } finally {
93 if (((mutable_bitField0_ & 0x00000001) != 0)) {
94 vars_.makeImmutable(); // C
95 }
96 this.unknownFields = unknownFields.build();
97 makeExtensionsImmutable();
98 }
99 }
100 public static final com.google.protobuf.Descriptors.Descriptor
102 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ListOfVariablesProto_descriptor;
103 }
104
105 @java.lang.Override
106 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
108 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ListOfVariablesProto_fieldAccessorTable
109 .ensureFieldAccessorsInitialized(
110 com.google.ortools.sat.ListOfVariablesProto.class, com.google.ortools.sat.ListOfVariablesProto.Builder.class);
111 }
112
113 public static final int VARS_FIELD_NUMBER = 1;
114 private com.google.protobuf.Internal.IntList vars_;
119 @java.lang.Override
120 public java.util.List<java.lang.Integer>
122 return vars_;
123 }
128 public int getVarsCount() {
129 return vars_.size();
130 }
136 public int getVars(int index) {
137 return vars_.getInt(index);
138 }
139 private int varsMemoizedSerializedSize = -1;
140
141 private byte memoizedIsInitialized = -1;
142 @java.lang.Override
143 public final boolean isInitialized() {
144 byte isInitialized = memoizedIsInitialized;
145 if (isInitialized == 1) return true;
146 if (isInitialized == 0) return false;
147
148 memoizedIsInitialized = 1;
149 return true;
150 }
151
152 @java.lang.Override
153 public void writeTo(com.google.protobuf.CodedOutputStream output)
154 throws java.io.IOException {
156 if (getVarsList().size() > 0) {
157 output.writeUInt32NoTag(10);
158 output.writeUInt32NoTag(varsMemoizedSerializedSize);
159 }
160 for (int i = 0; i < vars_.size(); i++) {
161 output.writeInt32NoTag(vars_.getInt(i));
162 }
163 unknownFields.writeTo(output);
164 }
165
166 @java.lang.Override
167 public int getSerializedSize() {
168 int size = memoizedSize;
169 if (size != -1) return size;
170
171 size = 0;
172 {
173 int dataSize = 0;
174 for (int i = 0; i < vars_.size(); i++) {
175 dataSize += com.google.protobuf.CodedOutputStream
176 .computeInt32SizeNoTag(vars_.getInt(i));
177 }
178 size += dataSize;
179 if (!getVarsList().isEmpty()) {
180 size += 1;
181 size += com.google.protobuf.CodedOutputStream
182 .computeInt32SizeNoTag(dataSize);
183 }
184 varsMemoizedSerializedSize = dataSize;
185 }
186 size += unknownFields.getSerializedSize();
187 memoizedSize = size;
188 return size;
189 }
190
191 @java.lang.Override
192 public boolean equals(final java.lang.Object obj) {
193 if (obj == this) {
194 return true;
195 }
196 if (!(obj instanceof com.google.ortools.sat.ListOfVariablesProto)) {
197 return super.equals(obj);
198 }
199 com.google.ortools.sat.ListOfVariablesProto other = (com.google.ortools.sat.ListOfVariablesProto) obj;
200
201 if (!getVarsList()
202 .equals(other.getVarsList())) return false;
203 if (!unknownFields.equals(other.unknownFields)) return false;
204 return true;
205 }
206
207 @java.lang.Override
208 public int hashCode() {
209 if (memoizedHashCode != 0) {
210 return memoizedHashCode;
211 }
212 int hash = 41;
213 hash = (19 * hash) + getDescriptor().hashCode();
214 if (getVarsCount() > 0) {
215 hash = (37 * hash) + VARS_FIELD_NUMBER;
216 hash = (53 * hash) + getVarsList().hashCode();
217 }
218 hash = (29 * hash) + unknownFields.hashCode();
219 memoizedHashCode = hash;
220 return hash;
221 }
222
223 public static com.google.ortools.sat.ListOfVariablesProto parseFrom(
224 java.nio.ByteBuffer data)
225 throws com.google.protobuf.InvalidProtocolBufferException {
226 return PARSER.parseFrom(data);
227 }
228 public static com.google.ortools.sat.ListOfVariablesProto parseFrom(
229 java.nio.ByteBuffer data,
230 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
231 throws com.google.protobuf.InvalidProtocolBufferException {
232 return PARSER.parseFrom(data, extensionRegistry);
233 }
234 public static com.google.ortools.sat.ListOfVariablesProto parseFrom(
235 com.google.protobuf.ByteString data)
236 throws com.google.protobuf.InvalidProtocolBufferException {
237 return PARSER.parseFrom(data);
238 }
239 public static com.google.ortools.sat.ListOfVariablesProto parseFrom(
240 com.google.protobuf.ByteString data,
241 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
242 throws com.google.protobuf.InvalidProtocolBufferException {
243 return PARSER.parseFrom(data, extensionRegistry);
244 }
245 public static com.google.ortools.sat.ListOfVariablesProto parseFrom(byte[] data)
246 throws com.google.protobuf.InvalidProtocolBufferException {
247 return PARSER.parseFrom(data);
248 }
249 public static com.google.ortools.sat.ListOfVariablesProto parseFrom(
250 byte[] data,
251 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
252 throws com.google.protobuf.InvalidProtocolBufferException {
253 return PARSER.parseFrom(data, extensionRegistry);
254 }
255 public static com.google.ortools.sat.ListOfVariablesProto parseFrom(java.io.InputStream input)
256 throws java.io.IOException {
257 return com.google.protobuf.GeneratedMessageV3
258 .parseWithIOException(PARSER, input);
259 }
260 public static com.google.ortools.sat.ListOfVariablesProto parseFrom(
261 java.io.InputStream input,
262 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
263 throws java.io.IOException {
264 return com.google.protobuf.GeneratedMessageV3
265 .parseWithIOException(PARSER, input, extensionRegistry);
266 }
267 public static com.google.ortools.sat.ListOfVariablesProto parseDelimitedFrom(java.io.InputStream input)
268 throws java.io.IOException {
269 return com.google.protobuf.GeneratedMessageV3
270 .parseDelimitedWithIOException(PARSER, input);
271 }
272 public static com.google.ortools.sat.ListOfVariablesProto parseDelimitedFrom(
273 java.io.InputStream input,
274 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
275 throws java.io.IOException {
276 return com.google.protobuf.GeneratedMessageV3
277 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
278 }
279 public static com.google.ortools.sat.ListOfVariablesProto parseFrom(
280 com.google.protobuf.CodedInputStream input)
281 throws java.io.IOException {
282 return com.google.protobuf.GeneratedMessageV3
283 .parseWithIOException(PARSER, input);
284 }
285 public static com.google.ortools.sat.ListOfVariablesProto parseFrom(
286 com.google.protobuf.CodedInputStream input,
287 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
288 throws java.io.IOException {
289 return com.google.protobuf.GeneratedMessageV3
290 .parseWithIOException(PARSER, input, extensionRegistry);
291 }
292
293 @java.lang.Override
294 public Builder newBuilderForType() { return newBuilder(); }
295 public static Builder newBuilder() {
296 return DEFAULT_INSTANCE.toBuilder();
297 }
298 public static Builder newBuilder(com.google.ortools.sat.ListOfVariablesProto prototype) {
299 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
300 }
301 @java.lang.Override
303 return this == DEFAULT_INSTANCE
304 ? new Builder() : new Builder().mergeFrom(this);
305 }
306
307 @java.lang.Override
309 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
310 Builder builder = new Builder(parent);
311 return builder;
312 }
320 public static final class Builder extends
321 com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
322 // @@protoc_insertion_point(builder_implements:operations_research.sat.ListOfVariablesProto)
323 com.google.ortools.sat.ListOfVariablesProtoOrBuilder {
324 public static final com.google.protobuf.Descriptors.Descriptor
326 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ListOfVariablesProto_descriptor;
327 }
328
329 @java.lang.Override
330 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
332 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ListOfVariablesProto_fieldAccessorTable
333 .ensureFieldAccessorsInitialized(
334 com.google.ortools.sat.ListOfVariablesProto.class, com.google.ortools.sat.ListOfVariablesProto.Builder.class);
335 }
336
337 // Construct using com.google.ortools.sat.ListOfVariablesProto.newBuilder()
338 private Builder() {
339 maybeForceBuilderInitialization();
340 }
341
342 private Builder(
343 com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
344 super(parent);
345 maybeForceBuilderInitialization();
346 }
347 private void maybeForceBuilderInitialization() {
348 if (com.google.protobuf.GeneratedMessageV3
349 .alwaysUseFieldBuilders) {
350 }
351 }
352 @java.lang.Override
353 public Builder clear() {
354 super.clear();
355 vars_ = emptyIntList();
356 bitField0_ = (bitField0_ & ~0x00000001);
357 return this;
358 }
359
360 @java.lang.Override
361 public com.google.protobuf.Descriptors.Descriptor
363 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ListOfVariablesProto_descriptor;
364 }
365
366 @java.lang.Override
367 public com.google.ortools.sat.ListOfVariablesProto getDefaultInstanceForType() {
368 return com.google.ortools.sat.ListOfVariablesProto.getDefaultInstance();
369 }
370
371 @java.lang.Override
372 public com.google.ortools.sat.ListOfVariablesProto build() {
373 com.google.ortools.sat.ListOfVariablesProto result = buildPartial();
374 if (!result.isInitialized()) {
375 throw newUninitializedMessageException(result);
376 }
377 return result;
378 }
379
380 @java.lang.Override
381 public com.google.ortools.sat.ListOfVariablesProto buildPartial() {
382 com.google.ortools.sat.ListOfVariablesProto result = new com.google.ortools.sat.ListOfVariablesProto(this);
383 int from_bitField0_ = bitField0_;
384 if (((bitField0_ & 0x00000001) != 0)) {
385 vars_.makeImmutable();
386 bitField0_ = (bitField0_ & ~0x00000001);
387 }
388 result.vars_ = vars_;
389 onBuilt();
390 return result;
391 }
392
393 @java.lang.Override
394 public Builder clone() {
395 return super.clone();
396 }
397 @java.lang.Override
399 com.google.protobuf.Descriptors.FieldDescriptor field,
400 java.lang.Object value) {
401 return super.setField(field, value);
402 }
403 @java.lang.Override
405 com.google.protobuf.Descriptors.FieldDescriptor field) {
406 return super.clearField(field);
407 }
408 @java.lang.Override
410 com.google.protobuf.Descriptors.OneofDescriptor oneof) {
411 return super.clearOneof(oneof);
412 }
413 @java.lang.Override
415 com.google.protobuf.Descriptors.FieldDescriptor field,
416 int index, java.lang.Object value) {
417 return super.setRepeatedField(field, index, value);
418 }
419 @java.lang.Override
421 com.google.protobuf.Descriptors.FieldDescriptor field,
422 java.lang.Object value) {
423 return super.addRepeatedField(field, value);
424 }
425 @java.lang.Override
426 public Builder mergeFrom(com.google.protobuf.Message other) {
427 if (other instanceof com.google.ortools.sat.ListOfVariablesProto) {
428 return mergeFrom((com.google.ortools.sat.ListOfVariablesProto)other);
429 } else {
430 super.mergeFrom(other);
431 return this;
432 }
433 }
434
435 public Builder mergeFrom(com.google.ortools.sat.ListOfVariablesProto other) {
436 if (other == com.google.ortools.sat.ListOfVariablesProto.getDefaultInstance()) return this;
437 if (!other.vars_.isEmpty()) {
438 if (vars_.isEmpty()) {
439 vars_ = other.vars_;
440 bitField0_ = (bitField0_ & ~0x00000001);
441 } else {
442 ensureVarsIsMutable();
443 vars_.addAll(other.vars_);
444 }
445 onChanged();
446 }
447 this.mergeUnknownFields(other.unknownFields);
448 onChanged();
449 return this;
450 }
451
452 @java.lang.Override
453 public final boolean isInitialized() {
454 return true;
455 }
456
457 @java.lang.Override
459 com.google.protobuf.CodedInputStream input,
460 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
461 throws java.io.IOException {
462 com.google.ortools.sat.ListOfVariablesProto parsedMessage = null;
463 try {
464 parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
465 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
466 parsedMessage = (com.google.ortools.sat.ListOfVariablesProto) e.getUnfinishedMessage();
467 throw e.unwrapIOException();
468 } finally {
469 if (parsedMessage != null) {
470 mergeFrom(parsedMessage);
471 }
472 }
473 return this;
474 }
475 private int bitField0_;
476
477 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
478 private void ensureVarsIsMutable() {
479 if (!((bitField0_ & 0x00000001) != 0)) {
480 vars_ = mutableCopy(vars_);
481 bitField0_ |= 0x00000001;
482 }
483 }
488 public java.util.List<java.lang.Integer>
490 return ((bitField0_ & 0x00000001) != 0) ?
491 java.util.Collections.unmodifiableList(vars_) : vars_;
492 }
497 public int getVarsCount() {
498 return vars_.size();
499 }
505 public int getVars(int index) {
506 return vars_.getInt(index);
507 }
515 int index, int value) {
516 ensureVarsIsMutable();
517 vars_.setInt(index, value);
518 onChanged();
519 return this;
520 }
526 public Builder addVars(int value) {
527 ensureVarsIsMutable();
528 vars_.addInt(value);
529 onChanged();
530 return this;
531 }
538 java.lang.Iterable<? extends java.lang.Integer> values) {
539 ensureVarsIsMutable();
540 com.google.protobuf.AbstractMessageLite.Builder.addAll(
541 values, vars_);
542 onChanged();
543 return this;
544 }
550 vars_ = emptyIntList();
551 bitField0_ = (bitField0_ & ~0x00000001);
552 onChanged();
553 return this;
554 }
555 @java.lang.Override
557 final com.google.protobuf.UnknownFieldSet unknownFields) {
558 return super.setUnknownFields(unknownFields);
559 }
560
561 @java.lang.Override
563 final com.google.protobuf.UnknownFieldSet unknownFields) {
564 return super.mergeUnknownFields(unknownFields);
565 }
566
567
568 // @@protoc_insertion_point(builder_scope:operations_research.sat.ListOfVariablesProto)
569 }
570
571 // @@protoc_insertion_point(class_scope:operations_research.sat.ListOfVariablesProto)
572 private static final com.google.ortools.sat.ListOfVariablesProto DEFAULT_INSTANCE;
573 static {
574 DEFAULT_INSTANCE = new com.google.ortools.sat.ListOfVariablesProto();
575 }
576
577 public static com.google.ortools.sat.ListOfVariablesProto getDefaultInstance() {
578 return DEFAULT_INSTANCE;
579 }
580
581 private static final com.google.protobuf.Parser<ListOfVariablesProto>
582 PARSER = new com.google.protobuf.AbstractParser<ListOfVariablesProto>() {
583 @java.lang.Override
584 public ListOfVariablesProto parsePartialFrom(
585 com.google.protobuf.CodedInputStream input,
586 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
587 throws com.google.protobuf.InvalidProtocolBufferException {
588 return new ListOfVariablesProto(input, extensionRegistry);
589 }
590 };
591
592 public static com.google.protobuf.Parser<ListOfVariablesProto> parser() {
593 return PARSER;
594 }
595
596 @java.lang.Override
597 public com.google.protobuf.Parser<ListOfVariablesProto> getParserForType() {
598 return PARSER;
599 }
600
601 @java.lang.Override
602 public com.google.ortools.sat.ListOfVariablesProto getDefaultInstanceForType() {
603 return DEFAULT_INSTANCE;
604 }
605
606}
607
com.google.ortools.sat.ListOfVariablesProto build()
final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
Builder mergeFrom(com.google.ortools.sat.ListOfVariablesProto other)
Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Builder mergeFrom(com.google.protobuf.Message other)
Builder setVars(int index, int value)
repeated int32 vars = 1;
Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
Builder addAllVars(java.lang.Iterable<? extends java.lang.Integer > values)
repeated int32 vars = 1;
Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
com.google.ortools.sat.ListOfVariablesProto getDefaultInstanceForType()
Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
Builder addVars(int value)
repeated int32 vars = 1;
com.google.ortools.sat.ListOfVariablesProto buildPartial()
Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
java.util.List< java.lang.Integer > getVarsList()
repeated int32 vars = 1;
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.ListOfVariablesProto parseFrom(byte[] data)
static com.google.ortools.sat.ListOfVariablesProto parseDelimitedFrom(java.io.InputStream input)
void writeTo(com.google.protobuf.CodedOutputStream output)
static com.google.ortools.sat.ListOfVariablesProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
static com.google.ortools.sat.ListOfVariablesProto parseFrom(com.google.protobuf.ByteString data)
boolean equals(final java.lang.Object obj)
static com.google.ortools.sat.ListOfVariablesProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
final com.google.protobuf.UnknownFieldSet getUnknownFields()
static com.google.ortools.sat.ListOfVariablesProto getDefaultInstance()
static com.google.ortools.sat.ListOfVariablesProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.sat.ListOfVariablesProto getDefaultInstanceForType()
static com.google.ortools.sat.ListOfVariablesProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.ListOfVariablesProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.Parser< ListOfVariablesProto > getParserForType()
static com.google.ortools.sat.ListOfVariablesProto parseFrom(java.nio.ByteBuffer data)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
java.lang.Object newInstance(UnusedPrivateParameter unused)
int getVars(int index)
repeated int32 vars = 1;
java.util.List< java.lang.Integer > getVarsList()
repeated int32 vars = 1;
static com.google.ortools.sat.ListOfVariablesProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.protobuf.Parser< ListOfVariablesProto > parser()
static Builder newBuilder(com.google.ortools.sat.ListOfVariablesProto prototype)
static com.google.ortools.sat.ListOfVariablesProto parseFrom(java.io.InputStream input)
Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
static com.google.ortools.sat.ListOfVariablesProto parseFrom(com.google.protobuf.CodedInputStream input)