Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
NoOverlapConstraintProto.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
18public final class NoOverlapConstraintProto extends
19 com.google.protobuf.GeneratedMessage implements
20 // @@protoc_insertion_point(message_implements:operations_research.sat.NoOverlapConstraintProto)
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 NoOverlapConstraintProto.class.getName());
31 }
32 // Use NoOverlapConstraintProto.newBuilder() to construct.
33 private NoOverlapConstraintProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
34 super(builder);
35 }
36 private NoOverlapConstraintProto() {
37 intervals_ = emptyIntList();
38 }
39
40 public static final com.google.protobuf.Descriptors.Descriptor
42 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_NoOverlapConstraintProto_descriptor;
43 }
44
45 @java.lang.Override
46 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
48 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_NoOverlapConstraintProto_fieldAccessorTable
49 .ensureFieldAccessorsInitialized(
50 com.google.ortools.sat.NoOverlapConstraintProto.class, com.google.ortools.sat.NoOverlapConstraintProto.Builder.class);
51 }
52
53 public static final int INTERVALS_FIELD_NUMBER = 1;
54 @SuppressWarnings("serial")
55 private com.google.protobuf.Internal.IntList intervals_ =
56 emptyIntList();
61 @java.lang.Override
62 public java.util.List<java.lang.Integer>
64 return intervals_;
65 }
70 public int getIntervalsCount() {
71 return intervals_.size();
72 }
78 public int getIntervals(int index) {
79 return intervals_.getInt(index);
80 }
81 private int intervalsMemoizedSerializedSize = -1;
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 {
98 if (getIntervalsList().size() > 0) {
99 output.writeUInt32NoTag(10);
100 output.writeUInt32NoTag(intervalsMemoizedSerializedSize);
101 }
102 for (int i = 0; i < intervals_.size(); i++) {
103 output.writeInt32NoTag(intervals_.getInt(i));
104 }
105 getUnknownFields().writeTo(output);
106 }
107
108 @java.lang.Override
109 public int getSerializedSize() {
110 int size = memoizedSize;
111 if (size != -1) return size;
112
113 size = 0;
114 {
115 int dataSize = 0;
116 for (int i = 0; i < intervals_.size(); i++) {
117 dataSize += com.google.protobuf.CodedOutputStream
118 .computeInt32SizeNoTag(intervals_.getInt(i));
119 }
120 size += dataSize;
121 if (!getIntervalsList().isEmpty()) {
122 size += 1;
123 size += com.google.protobuf.CodedOutputStream
124 .computeInt32SizeNoTag(dataSize);
125 }
126 intervalsMemoizedSerializedSize = dataSize;
127 }
128 size += getUnknownFields().getSerializedSize();
129 memoizedSize = size;
130 return size;
131 }
132
133 @java.lang.Override
134 public boolean equals(final java.lang.Object obj) {
135 if (obj == this) {
136 return true;
137 }
138 if (!(obj instanceof com.google.ortools.sat.NoOverlapConstraintProto)) {
139 return super.equals(obj);
140 }
141 com.google.ortools.sat.NoOverlapConstraintProto other = (com.google.ortools.sat.NoOverlapConstraintProto) obj;
142
143 if (!getIntervalsList()
144 .equals(other.getIntervalsList())) return false;
145 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
146 return true;
147 }
148
149 @java.lang.Override
150 public int hashCode() {
151 if (memoizedHashCode != 0) {
152 return memoizedHashCode;
153 }
154 int hash = 41;
155 hash = (19 * hash) + getDescriptor().hashCode();
156 if (getIntervalsCount() > 0) {
157 hash = (37 * hash) + INTERVALS_FIELD_NUMBER;
158 hash = (53 * hash) + getIntervalsList().hashCode();
159 }
160 hash = (29 * hash) + getUnknownFields().hashCode();
161 memoizedHashCode = hash;
162 return hash;
163 }
164
166 java.nio.ByteBuffer data)
167 throws com.google.protobuf.InvalidProtocolBufferException {
168 return PARSER.parseFrom(data);
169 }
171 java.nio.ByteBuffer data,
172 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
173 throws com.google.protobuf.InvalidProtocolBufferException {
174 return PARSER.parseFrom(data, extensionRegistry);
175 }
177 com.google.protobuf.ByteString data)
178 throws com.google.protobuf.InvalidProtocolBufferException {
179 return PARSER.parseFrom(data);
180 }
182 com.google.protobuf.ByteString data,
183 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
184 throws com.google.protobuf.InvalidProtocolBufferException {
185 return PARSER.parseFrom(data, extensionRegistry);
186 }
188 throws com.google.protobuf.InvalidProtocolBufferException {
189 return PARSER.parseFrom(data);
190 }
192 byte[] data,
193 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
194 throws com.google.protobuf.InvalidProtocolBufferException {
195 return PARSER.parseFrom(data, extensionRegistry);
196 }
197 public static com.google.ortools.sat.NoOverlapConstraintProto parseFrom(java.io.InputStream input)
198 throws java.io.IOException {
199 return com.google.protobuf.GeneratedMessage
200 .parseWithIOException(PARSER, input);
201 }
203 java.io.InputStream input,
204 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
205 throws java.io.IOException {
206 return com.google.protobuf.GeneratedMessage
207 .parseWithIOException(PARSER, input, extensionRegistry);
208 }
209
211 throws java.io.IOException {
212 return com.google.protobuf.GeneratedMessage
213 .parseDelimitedWithIOException(PARSER, input);
214 }
215
217 java.io.InputStream input,
218 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
219 throws java.io.IOException {
220 return com.google.protobuf.GeneratedMessage
221 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
222 }
224 com.google.protobuf.CodedInputStream input)
225 throws java.io.IOException {
226 return com.google.protobuf.GeneratedMessage
227 .parseWithIOException(PARSER, input);
228 }
230 com.google.protobuf.CodedInputStream input,
231 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
232 throws java.io.IOException {
233 return com.google.protobuf.GeneratedMessage
234 .parseWithIOException(PARSER, input, extensionRegistry);
235 }
236
237 @java.lang.Override
238 public Builder newBuilderForType() { return newBuilder(); }
239 public static Builder newBuilder() {
240 return DEFAULT_INSTANCE.toBuilder();
241 }
242 public static Builder newBuilder(com.google.ortools.sat.NoOverlapConstraintProto prototype) {
243 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
244 }
245 @java.lang.Override
247 return this == DEFAULT_INSTANCE
248 ? new Builder() : new Builder().mergeFrom(this);
249 }
250
251 @java.lang.Override
253 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
254 Builder builder = new Builder(parent);
255 return builder;
256 }
268 public static final class Builder extends
269 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
270 // @@protoc_insertion_point(builder_implements:operations_research.sat.NoOverlapConstraintProto)
271 com.google.ortools.sat.NoOverlapConstraintProtoOrBuilder {
272 public static final com.google.protobuf.Descriptors.Descriptor
274 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_NoOverlapConstraintProto_descriptor;
275 }
276
277 @java.lang.Override
278 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
280 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_NoOverlapConstraintProto_fieldAccessorTable
281 .ensureFieldAccessorsInitialized(
282 com.google.ortools.sat.NoOverlapConstraintProto.class, com.google.ortools.sat.NoOverlapConstraintProto.Builder.class);
283 }
284
285 // Construct using com.google.ortools.sat.NoOverlapConstraintProto.newBuilder()
286 private Builder() {
287
288 }
289
290 private Builder(
291 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
292 super(parent);
293
294 }
295 @java.lang.Override
296 public Builder clear() {
297 super.clear();
298 bitField0_ = 0;
299 intervals_ = emptyIntList();
300 return this;
301 }
302
303 @java.lang.Override
304 public com.google.protobuf.Descriptors.Descriptor
306 return com.google.ortools.sat.CpModelProtobuf.internal_static_operations_research_sat_NoOverlapConstraintProto_descriptor;
307 }
308
309 @java.lang.Override
311 return com.google.ortools.sat.NoOverlapConstraintProto.getDefaultInstance();
312 }
313
314 @java.lang.Override
317 if (!result.isInitialized()) {
318 throw newUninitializedMessageException(result);
319 }
320 return result;
321 }
322
323 @java.lang.Override
325 com.google.ortools.sat.NoOverlapConstraintProto result = new com.google.ortools.sat.NoOverlapConstraintProto(this);
326 if (bitField0_ != 0) { buildPartial0(result); }
327 onBuilt();
328 return result;
329 }
330
331 private void buildPartial0(com.google.ortools.sat.NoOverlapConstraintProto result) {
332 int from_bitField0_ = bitField0_;
333 if (((from_bitField0_ & 0x00000001) != 0)) {
334 intervals_.makeImmutable();
335 result.intervals_ = intervals_;
336 }
337 }
338
339 @java.lang.Override
340 public Builder mergeFrom(com.google.protobuf.Message other) {
341 if (other instanceof com.google.ortools.sat.NoOverlapConstraintProto) {
342 return mergeFrom((com.google.ortools.sat.NoOverlapConstraintProto)other);
343 } else {
344 super.mergeFrom(other);
345 return this;
346 }
347 }
348
349 public Builder mergeFrom(com.google.ortools.sat.NoOverlapConstraintProto other) {
350 if (other == com.google.ortools.sat.NoOverlapConstraintProto.getDefaultInstance()) return this;
351 if (!other.intervals_.isEmpty()) {
352 if (intervals_.isEmpty()) {
353 intervals_ = other.intervals_;
354 intervals_.makeImmutable();
355 bitField0_ |= 0x00000001;
356 } else {
357 ensureIntervalsIsMutable();
358 intervals_.addAll(other.intervals_);
359 }
360 onChanged();
361 }
362 this.mergeUnknownFields(other.getUnknownFields());
363 onChanged();
364 return this;
365 }
366
367 @java.lang.Override
368 public final boolean isInitialized() {
369 return true;
370 }
371
372 @java.lang.Override
374 com.google.protobuf.CodedInputStream input,
375 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
376 throws java.io.IOException {
377 if (extensionRegistry == null) {
378 throw new java.lang.NullPointerException();
379 }
380 try {
381 boolean done = false;
382 while (!done) {
383 int tag = input.readTag();
384 switch (tag) {
385 case 0:
386 done = true;
387 break;
388 case 8: {
389 int v = input.readInt32();
390 ensureIntervalsIsMutable();
391 intervals_.addInt(v);
392 break;
393 } // case 8
394 case 10: {
395 int length = input.readRawVarint32();
396 int limit = input.pushLimit(length);
397 ensureIntervalsIsMutable();
398 while (input.getBytesUntilLimit() > 0) {
399 intervals_.addInt(input.readInt32());
400 }
401 input.popLimit(limit);
402 break;
403 } // case 10
404 default: {
405 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
406 done = true; // was an endgroup tag
407 }
408 break;
409 } // default:
410 } // switch (tag)
411 } // while (!done)
412 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
413 throw e.unwrapIOException();
414 } finally {
415 onChanged();
416 } // finally
417 return this;
418 }
419 private int bitField0_;
420
421 private com.google.protobuf.Internal.IntList intervals_ = emptyIntList();
422 private void ensureIntervalsIsMutable() {
423 if (!intervals_.isModifiable()) {
424 intervals_ = makeMutableCopy(intervals_);
425 }
426 bitField0_ |= 0x00000001;
427 }
432 public java.util.List<java.lang.Integer>
434 intervals_.makeImmutable();
435 return intervals_;
436 }
441 public int getIntervalsCount() {
442 return intervals_.size();
443 }
449 public int getIntervals(int index) {
450 return intervals_.getInt(index);
451 }
459 int index, int value) {
460
461 ensureIntervalsIsMutable();
462 intervals_.setInt(index, value);
463 bitField0_ |= 0x00000001;
464 onChanged();
465 return this;
466 }
472 public Builder addIntervals(int value) {
473
474 ensureIntervalsIsMutable();
475 intervals_.addInt(value);
476 bitField0_ |= 0x00000001;
477 onChanged();
478 return this;
479 }
486 java.lang.Iterable<? extends java.lang.Integer> values) {
487 ensureIntervalsIsMutable();
488 com.google.protobuf.AbstractMessageLite.Builder.addAll(
489 values, intervals_);
490 bitField0_ |= 0x00000001;
491 onChanged();
492 return this;
493 }
499 intervals_ = emptyIntList();
500 bitField0_ = (bitField0_ & ~0x00000001);
501 onChanged();
502 return this;
503 }
504
505 // @@protoc_insertion_point(builder_scope:operations_research.sat.NoOverlapConstraintProto)
506 }
507
508 // @@protoc_insertion_point(class_scope:operations_research.sat.NoOverlapConstraintProto)
509 private static final com.google.ortools.sat.NoOverlapConstraintProto DEFAULT_INSTANCE;
510 static {
511 DEFAULT_INSTANCE = new com.google.ortools.sat.NoOverlapConstraintProto();
512 }
513
515 return DEFAULT_INSTANCE;
516 }
517
518 private static final com.google.protobuf.Parser<NoOverlapConstraintProto>
519 PARSER = new com.google.protobuf.AbstractParser<NoOverlapConstraintProto>() {
520 @java.lang.Override
521 public NoOverlapConstraintProto parsePartialFrom(
522 com.google.protobuf.CodedInputStream input,
523 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
524 throws com.google.protobuf.InvalidProtocolBufferException {
525 Builder builder = newBuilder();
526 try {
527 builder.mergeFrom(input, extensionRegistry);
528 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
529 throw e.setUnfinishedMessage(builder.buildPartial());
530 } catch (com.google.protobuf.UninitializedMessageException e) {
531 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
532 } catch (java.io.IOException e) {
533 throw new com.google.protobuf.InvalidProtocolBufferException(e)
534 .setUnfinishedMessage(builder.buildPartial());
535 }
536 return builder.buildPartial();
537 }
538 };
539
540 public static com.google.protobuf.Parser<NoOverlapConstraintProto> parser() {
541 return PARSER;
542 }
543
544 @java.lang.Override
545 public com.google.protobuf.Parser<NoOverlapConstraintProto> getParserForType() {
546 return PARSER;
547 }
548
549 @java.lang.Override
553
554}
555
Builder addAllIntervals(java.lang.Iterable<? extends java.lang.Integer > values)
com.google.ortools.sat.NoOverlapConstraintProto getDefaultInstanceForType()
Builder mergeFrom(com.google.ortools.sat.NoOverlapConstraintProto other)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
com.google.ortools.sat.NoOverlapConstraintProto buildPartial()
com.google.ortools.sat.NoOverlapConstraintProto build()
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.NoOverlapConstraintProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.NoOverlapConstraintProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
static com.google.protobuf.Parser< NoOverlapConstraintProto > parser()
static com.google.ortools.sat.NoOverlapConstraintProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static Builder newBuilder(com.google.ortools.sat.NoOverlapConstraintProto prototype)
static com.google.ortools.sat.NoOverlapConstraintProto parseFrom(com.google.protobuf.ByteString data)
static com.google.ortools.sat.NoOverlapConstraintProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.NoOverlapConstraintProto parseDelimitedFrom(java.io.InputStream input)
static com.google.ortools.sat.NoOverlapConstraintProto getDefaultInstance()
java.util.List< java.lang.Integer > getIntervalsList()
static com.google.ortools.sat.NoOverlapConstraintProto parseFrom(com.google.protobuf.CodedInputStream input)
void writeTo(com.google.protobuf.CodedOutputStream output)
static com.google.ortools.sat.NoOverlapConstraintProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.NoOverlapConstraintProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.sat.NoOverlapConstraintProto parseFrom(byte[] data)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
com.google.protobuf.Parser< NoOverlapConstraintProto > getParserForType()
static com.google.ortools.sat.NoOverlapConstraintProto parseFrom(java.nio.ByteBuffer data)
com.google.ortools.sat.NoOverlapConstraintProto getDefaultInstanceForType()
static com.google.ortools.sat.NoOverlapConstraintProto parseFrom(java.io.InputStream input)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()