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