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