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