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