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