Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
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
4// Protobuf Java Version: 4.26.1
5package com.google.ortools.sat;
6
14public final class ListOfVariablesProto extends
15 com.google.protobuf.GeneratedMessage implements
16 // @@protoc_insertion_point(message_implements:operations_research.sat.ListOfVariablesProto)
18private static final long serialVersionUID = 0L;
19 static {
20 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
21 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
22 /* major= */ 4,
23 /* minor= */ 26,
24 /* patch= */ 1,
25 /* suffix= */ "",
26 ListOfVariablesProto.class.getName());
27 }
28 // Use ListOfVariablesProto.newBuilder() to construct.
29 private ListOfVariablesProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
30 super(builder);
31 }
32 private ListOfVariablesProto() {
33 vars_ = emptyIntList();
34 }
35
36 public static final com.google.protobuf.Descriptors.Descriptor
38 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ListOfVariablesProto_descriptor;
39 }
40
41 @java.lang.Override
42 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
44 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ListOfVariablesProto_fieldAccessorTable
45 .ensureFieldAccessorsInitialized(
46 com.google.ortools.sat.ListOfVariablesProto.class, com.google.ortools.sat.ListOfVariablesProto.Builder.class);
47 }
48
49 public static final int VARS_FIELD_NUMBER = 1;
50 @SuppressWarnings("serial")
51 private com.google.protobuf.Internal.IntList vars_ =
52 emptyIntList();
57 @java.lang.Override
58 public java.util.List<java.lang.Integer>
60 return vars_;
61 }
66 public int getVarsCount() {
67 return vars_.size();
68 }
74 public int getVars(int index) {
75 return vars_.getInt(index);
76 }
77 private int varsMemoizedSerializedSize = -1;
78
79 private byte memoizedIsInitialized = -1;
80 @java.lang.Override
81 public final boolean isInitialized() {
82 byte isInitialized = memoizedIsInitialized;
83 if (isInitialized == 1) return true;
84 if (isInitialized == 0) return false;
85
86 memoizedIsInitialized = 1;
87 return true;
88 }
89
90 @java.lang.Override
91 public void writeTo(com.google.protobuf.CodedOutputStream output)
92 throws java.io.IOException {
94 if (getVarsList().size() > 0) {
95 output.writeUInt32NoTag(10);
96 output.writeUInt32NoTag(varsMemoizedSerializedSize);
97 }
98 for (int i = 0; i < vars_.size(); i++) {
99 output.writeInt32NoTag(vars_.getInt(i));
100 }
101 getUnknownFields().writeTo(output);
102 }
103
104 @java.lang.Override
105 public int getSerializedSize() {
106 int size = memoizedSize;
107 if (size != -1) return size;
108
109 size = 0;
110 {
111 int dataSize = 0;
112 for (int i = 0; i < vars_.size(); i++) {
113 dataSize += com.google.protobuf.CodedOutputStream
114 .computeInt32SizeNoTag(vars_.getInt(i));
115 }
116 size += dataSize;
117 if (!getVarsList().isEmpty()) {
118 size += 1;
119 size += com.google.protobuf.CodedOutputStream
120 .computeInt32SizeNoTag(dataSize);
121 }
122 varsMemoizedSerializedSize = dataSize;
123 }
124 size += getUnknownFields().getSerializedSize();
125 memoizedSize = size;
126 return size;
127 }
128
129 @java.lang.Override
130 public boolean equals(final java.lang.Object obj) {
131 if (obj == this) {
132 return true;
133 }
134 if (!(obj instanceof com.google.ortools.sat.ListOfVariablesProto)) {
135 return super.equals(obj);
136 }
137 com.google.ortools.sat.ListOfVariablesProto other = (com.google.ortools.sat.ListOfVariablesProto) obj;
138
139 if (!getVarsList()
140 .equals(other.getVarsList())) return false;
141 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
142 return true;
143 }
144
145 @java.lang.Override
146 public int hashCode() {
147 if (memoizedHashCode != 0) {
148 return memoizedHashCode;
149 }
150 int hash = 41;
151 hash = (19 * hash) + getDescriptor().hashCode();
152 if (getVarsCount() > 0) {
153 hash = (37 * hash) + VARS_FIELD_NUMBER;
154 hash = (53 * hash) + getVarsList().hashCode();
155 }
156 hash = (29 * hash) + getUnknownFields().hashCode();
157 memoizedHashCode = hash;
158 return hash;
159 }
160
162 java.nio.ByteBuffer data)
163 throws com.google.protobuf.InvalidProtocolBufferException {
164 return PARSER.parseFrom(data);
165 }
167 java.nio.ByteBuffer data,
168 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
169 throws com.google.protobuf.InvalidProtocolBufferException {
170 return PARSER.parseFrom(data, extensionRegistry);
171 }
173 com.google.protobuf.ByteString data)
174 throws com.google.protobuf.InvalidProtocolBufferException {
175 return PARSER.parseFrom(data);
176 }
178 com.google.protobuf.ByteString data,
179 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
180 throws com.google.protobuf.InvalidProtocolBufferException {
181 return PARSER.parseFrom(data, extensionRegistry);
182 }
184 throws com.google.protobuf.InvalidProtocolBufferException {
185 return PARSER.parseFrom(data);
186 }
188 byte[] data,
189 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
190 throws com.google.protobuf.InvalidProtocolBufferException {
191 return PARSER.parseFrom(data, extensionRegistry);
192 }
193 public static com.google.ortools.sat.ListOfVariablesProto parseFrom(java.io.InputStream input)
194 throws java.io.IOException {
195 return com.google.protobuf.GeneratedMessage
196 .parseWithIOException(PARSER, input);
197 }
199 java.io.InputStream input,
200 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
201 throws java.io.IOException {
202 return com.google.protobuf.GeneratedMessage
203 .parseWithIOException(PARSER, input, extensionRegistry);
204 }
205
207 throws java.io.IOException {
208 return com.google.protobuf.GeneratedMessage
209 .parseDelimitedWithIOException(PARSER, input);
210 }
211
213 java.io.InputStream input,
214 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
215 throws java.io.IOException {
216 return com.google.protobuf.GeneratedMessage
217 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
218 }
220 com.google.protobuf.CodedInputStream input)
221 throws java.io.IOException {
222 return com.google.protobuf.GeneratedMessage
223 .parseWithIOException(PARSER, input);
224 }
226 com.google.protobuf.CodedInputStream input,
227 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
228 throws java.io.IOException {
229 return com.google.protobuf.GeneratedMessage
230 .parseWithIOException(PARSER, input, extensionRegistry);
231 }
232
233 @java.lang.Override
234 public Builder newBuilderForType() { return newBuilder(); }
235 public static Builder newBuilder() {
236 return DEFAULT_INSTANCE.toBuilder();
237 }
238 public static Builder newBuilder(com.google.ortools.sat.ListOfVariablesProto prototype) {
239 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
240 }
241 @java.lang.Override
243 return this == DEFAULT_INSTANCE
244 ? new Builder() : new Builder().mergeFrom(this);
245 }
246
247 @java.lang.Override
249 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
250 Builder builder = new Builder(parent);
251 return builder;
252 }
260 public static final class Builder extends
261 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
262 // @@protoc_insertion_point(builder_implements:operations_research.sat.ListOfVariablesProto)
263 com.google.ortools.sat.ListOfVariablesProtoOrBuilder {
264 public static final com.google.protobuf.Descriptors.Descriptor
266 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ListOfVariablesProto_descriptor;
267 }
268
269 @java.lang.Override
270 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
272 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ListOfVariablesProto_fieldAccessorTable
273 .ensureFieldAccessorsInitialized(
274 com.google.ortools.sat.ListOfVariablesProto.class, com.google.ortools.sat.ListOfVariablesProto.Builder.class);
275 }
276
277 // Construct using com.google.ortools.sat.ListOfVariablesProto.newBuilder()
278 private Builder() {
279
280 }
281
282 private Builder(
283 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
284 super(parent);
285
286 }
287 @java.lang.Override
288 public Builder clear() {
289 super.clear();
290 bitField0_ = 0;
291 vars_ = emptyIntList();
292 return this;
293 }
294
295 @java.lang.Override
296 public com.google.protobuf.Descriptors.Descriptor
298 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_ListOfVariablesProto_descriptor;
299 }
300
301 @java.lang.Override
303 return com.google.ortools.sat.ListOfVariablesProto.getDefaultInstance();
304 }
305
306 @java.lang.Override
309 if (!result.isInitialized()) {
310 throw newUninitializedMessageException(result);
311 }
312 return result;
313 }
314
315 @java.lang.Override
317 com.google.ortools.sat.ListOfVariablesProto result = new com.google.ortools.sat.ListOfVariablesProto(this);
318 if (bitField0_ != 0) { buildPartial0(result); }
319 onBuilt();
320 return result;
321 }
322
323 private void buildPartial0(com.google.ortools.sat.ListOfVariablesProto result) {
324 int from_bitField0_ = bitField0_;
325 if (((from_bitField0_ & 0x00000001) != 0)) {
326 vars_.makeImmutable();
327 result.vars_ = vars_;
328 }
329 }
330
331 @java.lang.Override
332 public Builder mergeFrom(com.google.protobuf.Message other) {
333 if (other instanceof com.google.ortools.sat.ListOfVariablesProto) {
334 return mergeFrom((com.google.ortools.sat.ListOfVariablesProto)other);
335 } else {
336 super.mergeFrom(other);
337 return this;
338 }
339 }
340
341 public Builder mergeFrom(com.google.ortools.sat.ListOfVariablesProto other) {
342 if (other == com.google.ortools.sat.ListOfVariablesProto.getDefaultInstance()) return this;
343 if (!other.vars_.isEmpty()) {
344 if (vars_.isEmpty()) {
345 vars_ = other.vars_;
346 vars_.makeImmutable();
347 bitField0_ |= 0x00000001;
348 } else {
349 ensureVarsIsMutable();
350 vars_.addAll(other.vars_);
351 }
352 onChanged();
353 }
354 this.mergeUnknownFields(other.getUnknownFields());
355 onChanged();
356 return this;
357 }
358
359 @java.lang.Override
360 public final boolean isInitialized() {
361 return true;
362 }
363
364 @java.lang.Override
366 com.google.protobuf.CodedInputStream input,
367 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
368 throws java.io.IOException {
369 if (extensionRegistry == null) {
370 throw new java.lang.NullPointerException();
371 }
372 try {
373 boolean done = false;
374 while (!done) {
375 int tag = input.readTag();
376 switch (tag) {
377 case 0:
378 done = true;
379 break;
380 case 8: {
381 int v = input.readInt32();
382 ensureVarsIsMutable();
383 vars_.addInt(v);
384 break;
385 } // case 8
386 case 10: {
387 int length = input.readRawVarint32();
388 int limit = input.pushLimit(length);
389 ensureVarsIsMutable();
390 while (input.getBytesUntilLimit() > 0) {
391 vars_.addInt(input.readInt32());
392 }
393 input.popLimit(limit);
394 break;
395 } // case 10
396 default: {
397 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
398 done = true; // was an endgroup tag
399 }
400 break;
401 } // default:
402 } // switch (tag)
403 } // while (!done)
404 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
405 throw e.unwrapIOException();
406 } finally {
407 onChanged();
408 } // finally
409 return this;
410 }
411 private int bitField0_;
412
413 private com.google.protobuf.Internal.IntList vars_ = emptyIntList();
414 private void ensureVarsIsMutable() {
415 if (!vars_.isModifiable()) {
416 vars_ = makeMutableCopy(vars_);
417 }
418 bitField0_ |= 0x00000001;
419 }
424 public java.util.List<java.lang.Integer>
426 vars_.makeImmutable();
427 return vars_;
428 }
433 public int getVarsCount() {
434 return vars_.size();
435 }
441 public int getVars(int index) {
442 return vars_.getInt(index);
443 }
451 int index, int value) {
452
453 ensureVarsIsMutable();
454 vars_.setInt(index, value);
455 bitField0_ |= 0x00000001;
456 onChanged();
457 return this;
458 }
464 public Builder addVars(int value) {
465
466 ensureVarsIsMutable();
467 vars_.addInt(value);
468 bitField0_ |= 0x00000001;
469 onChanged();
470 return this;
471 }
478 java.lang.Iterable<? extends java.lang.Integer> values) {
479 ensureVarsIsMutable();
480 com.google.protobuf.AbstractMessageLite.Builder.addAll(
481 values, vars_);
482 bitField0_ |= 0x00000001;
483 onChanged();
484 return this;
485 }
491 vars_ = emptyIntList();
492 bitField0_ = (bitField0_ & ~0x00000001);
493 onChanged();
494 return this;
495 }
496
497 // @@protoc_insertion_point(builder_scope:operations_research.sat.ListOfVariablesProto)
498 }
499
500 // @@protoc_insertion_point(class_scope:operations_research.sat.ListOfVariablesProto)
501 private static final com.google.ortools.sat.ListOfVariablesProto DEFAULT_INSTANCE;
502 static {
503 DEFAULT_INSTANCE = new com.google.ortools.sat.ListOfVariablesProto();
504 }
505
507 return DEFAULT_INSTANCE;
508 }
509
510 private static final com.google.protobuf.Parser<ListOfVariablesProto>
511 PARSER = new com.google.protobuf.AbstractParser<ListOfVariablesProto>() {
512 @java.lang.Override
513 public ListOfVariablesProto parsePartialFrom(
514 com.google.protobuf.CodedInputStream input,
515 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
516 throws com.google.protobuf.InvalidProtocolBufferException {
517 Builder builder = newBuilder();
518 try {
519 builder.mergeFrom(input, extensionRegistry);
520 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
521 throw e.setUnfinishedMessage(builder.buildPartial());
522 } catch (com.google.protobuf.UninitializedMessageException e) {
523 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
524 } catch (java.io.IOException e) {
525 throw new com.google.protobuf.InvalidProtocolBufferException(e)
526 .setUnfinishedMessage(builder.buildPartial());
527 }
528 return builder.buildPartial();
529 }
530 };
531
532 public static com.google.protobuf.Parser<ListOfVariablesProto> parser() {
533 return PARSER;
534 }
535
536 @java.lang.Override
537 public com.google.protobuf.Parser<ListOfVariablesProto> getParserForType() {
538 return PARSER;
539 }
540
541 @java.lang.Override
543 return DEFAULT_INSTANCE;
544 }
545
546}
547
Builder mergeFrom(com.google.protobuf.Message other)
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
com.google.ortools.sat.ListOfVariablesProto getDefaultInstanceForType()
Builder addAllVars(java.lang.Iterable<? extends java.lang.Integer > values)
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
com.google.ortools.sat.ListOfVariablesProto build()
Builder mergeFrom(com.google.ortools.sat.ListOfVariablesProto other)
com.google.ortools.sat.ListOfVariablesProto buildPartial()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
static com.google.ortools.sat.ListOfVariablesProto parseFrom(com.google.protobuf.ByteString data)
static com.google.ortools.sat.ListOfVariablesProto parseFrom(byte[] data)
java.util.List< java.lang.Integer > getVarsList()
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)
static com.google.ortools.sat.ListOfVariablesProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
static com.google.ortools.sat.ListOfVariablesProto parseFrom(com.google.protobuf.CodedInputStream input)
static com.google.ortools.sat.ListOfVariablesProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
void writeTo(com.google.protobuf.CodedOutputStream output)
static com.google.ortools.sat.ListOfVariablesProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.ListOfVariablesProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
static com.google.protobuf.Parser< ListOfVariablesProto > parser()
boolean equals(final java.lang.Object obj)
com.google.ortools.sat.ListOfVariablesProto getDefaultInstanceForType()
static com.google.ortools.sat.ListOfVariablesProto parseDelimitedFrom(java.io.InputStream input)
static com.google.ortools.sat.ListOfVariablesProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.ListOfVariablesProto getDefaultInstance()
com.google.protobuf.Parser< ListOfVariablesProto > getParserForType()
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
static Builder newBuilder(com.google.ortools.sat.ListOfVariablesProto prototype)
static com.google.ortools.sat.ListOfVariablesProto parseFrom(java.nio.ByteBuffer data)