6package com.google.ortools.sat;
19public final class BooleanAssignment
extends
20 com.google.protobuf.GeneratedMessage implements
23private static final long serialVersionUID = 0L;
25 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
26 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
31 BooleanAssignment.class.getName());
34 private BooleanAssignment(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
37 private BooleanAssignment() {
38 literals_ = emptyIntList();
41 public static final com.google.protobuf.Descriptors.Descriptor
43 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_BooleanAssignment_descriptor;
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);
55 @SuppressWarnings(
"serial")
56 private com.google.protobuf.Internal.IntList literals_ =
63 public java.
util.List<java.lang.Integer>
72 return literals_.size();
80 return literals_.getInt(index);
83 private byte memoizedIsInitialized = -1;
90 memoizedIsInitialized = 1;
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));
100 getUnknownFields().writeTo(output);
105 int size = memoizedSize;
106 if (size != -1)
return size;
111 for (
int i = 0; i < literals_.size(); i++) {
112 dataSize += com.google.protobuf.CodedOutputStream
113 .computeInt32SizeNoTag(literals_.getInt(i));
118 size += getUnknownFields().getSerializedSize();
124 public boolean equals(
final java.lang.Object obj) {
128 if (!(obj instanceof com.google.ortools.sat.BooleanAssignment)) {
129 return super.equals(obj);
135 if (!getUnknownFields().
equals(other.getUnknownFields()))
return false;
141 if (memoizedHashCode != 0) {
142 return memoizedHashCode;
150 hash = (29 * hash) + getUnknownFields().hashCode();
151 memoizedHashCode = hash;
156 java.nio.ByteBuffer data)
157 throws com.google.protobuf.InvalidProtocolBufferException {
158 return PARSER.parseFrom(data);
161 java.nio.ByteBuffer data,
162 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
163 throws com.google.protobuf.InvalidProtocolBufferException {
164 return PARSER.parseFrom(data, extensionRegistry);
167 com.google.protobuf.ByteString data)
168 throws com.google.protobuf.InvalidProtocolBufferException {
169 return PARSER.parseFrom(data);
172 com.google.protobuf.ByteString data,
173 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
174 throws com.google.protobuf.InvalidProtocolBufferException {
175 return PARSER.parseFrom(data, extensionRegistry);
178 throws com.google.protobuf.InvalidProtocolBufferException {
179 return PARSER.parseFrom(data);
183 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
184 throws com.google.protobuf.InvalidProtocolBufferException {
185 return PARSER.parseFrom(data, extensionRegistry);
188 throws java.io.IOException {
189 return com.google.protobuf.GeneratedMessage
190 .parseWithIOException(PARSER, input);
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);
201 throws java.io.IOException {
202 return com.google.protobuf.GeneratedMessage
203 .parseDelimitedWithIOException(PARSER, input);
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);
214 com.google.protobuf.CodedInputStream input)
215 throws java.io.IOException {
216 return com.google.protobuf.GeneratedMessage
217 .parseWithIOException(PARSER, input);
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);
230 return DEFAULT_INSTANCE.toBuilder();
233 return DEFAULT_INSTANCE.toBuilder().
mergeFrom(prototype);
237 return this == DEFAULT_INSTANCE
243 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
258 public static final class Builder
extends
259 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
262 public static final com.google.protobuf.Descriptors.Descriptor
264 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_BooleanAssignment_descriptor;
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);
281 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
289 literals_ = emptyIntList();
294 public com.google.protobuf.Descriptors.Descriptor
296 return com.google.ortools.sat.BooleanProblem.internal_static_operations_research_sat_BooleanAssignment_descriptor;
301 return com.google.ortools.sat.BooleanAssignment.getDefaultInstance();
308 throw newUninitializedMessageException(result);
316 if (bitField0_ != 0) { buildPartial0(result); }
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_;
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);
334 super.mergeFrom(other);
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;
347 ensureLiteralsIsMutable();
348 literals_.addAll(other.literals_);
352 this.mergeUnknownFields(other.getUnknownFields());
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();
371 boolean done =
false;
373 int tag = input.readTag();
379 int v = input.readInt32();
380 ensureLiteralsIsMutable();
385 int length = input.readRawVarint32();
386 int limit = input.pushLimit(length);
387 ensureLiteralsIsMutable();
388 while (input.getBytesUntilLimit() > 0) {
389 literals_.addInt(input.readInt32());
391 input.popLimit(limit);
395 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
402 }
catch (com.google.protobuf.InvalidProtocolBufferException e) {
403 throw e.unwrapIOException();
409 private int bitField0_;
411 private com.google.protobuf.Internal.IntList literals_ = emptyIntList();
412 private void ensureLiteralsIsMutable() {
413 if (!literals_.isModifiable()) {
414 literals_ = makeMutableCopy(literals_);
416 bitField0_ |= 0x00000001;
422 public java.util.List<java.lang.Integer>
424 literals_.makeImmutable();
432 return literals_.size();
440 return literals_.getInt(index);
449 int index,
int value) {
451 ensureLiteralsIsMutable();
452 literals_.setInt(index, value);
453 bitField0_ |= 0x00000001;
464 ensureLiteralsIsMutable();
465 literals_.addInt(value);
466 bitField0_ |= 0x00000001;
476 java.lang.Iterable<? extends java.lang.Integer> values) {
477 ensureLiteralsIsMutable();
478 com.google.protobuf.AbstractMessageLite.Builder.addAll(
480 bitField0_ |= 0x00000001;
489 literals_ = emptyIntList();
490 bitField0_ = (bitField0_ & ~0x00000001);
501 DEFAULT_INSTANCE =
new com.google.ortools.sat.BooleanAssignment();
505 return DEFAULT_INSTANCE;
512 com.google.protobuf.CodedInputStream input,
513 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
514 throws com.google.protobuf.InvalidProtocolBufferException {
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());
526 return builder.buildPartial();
530 public static com.google.protobuf.Parser<BooleanAssignment>
parser() {
541 return DEFAULT_INSTANCE;