Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
PartialVariableAssignment.java
Go to the documentation of this file.
1// Generated by the protocol buffer compiler. DO NOT EDIT!
2// source: ortools/linear_solver/linear_solver.proto
3
4// Protobuf Java Version: 4.26.1
5package com.google.ortools.linearsolver;
6
16public final class PartialVariableAssignment extends
17 com.google.protobuf.GeneratedMessage implements
18 // @@protoc_insertion_point(message_implements:operations_research.PartialVariableAssignment)
20private static final long serialVersionUID = 0L;
21 static {
22 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
23 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
24 /* major= */ 4,
25 /* minor= */ 26,
26 /* patch= */ 1,
27 /* suffix= */ "",
28 PartialVariableAssignment.class.getName());
29 }
30 // Use PartialVariableAssignment.newBuilder() to construct.
31 private PartialVariableAssignment(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
32 super(builder);
33 }
35 varIndex_ = emptyIntList();
36 varValue_ = emptyDoubleList();
37 }
38
39 public static final com.google.protobuf.Descriptors.Descriptor
41 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_descriptor;
42 }
43
44 @java.lang.Override
45 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
47 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_fieldAccessorTable
48 .ensureFieldAccessorsInitialized(
49 com.google.ortools.linearsolver.PartialVariableAssignment.class, com.google.ortools.linearsolver.PartialVariableAssignment.Builder.class);
50 }
51
52 public static final int VAR_INDEX_FIELD_NUMBER = 1;
53 @SuppressWarnings("serial")
54 private com.google.protobuf.Internal.IntList varIndex_ =
55 emptyIntList();
60 @java.lang.Override
61 public java.util.List<java.lang.Integer>
63 return varIndex_;
64 }
69 public int getVarIndexCount() {
70 return varIndex_.size();
71 }
77 public int getVarIndex(int index) {
78 return varIndex_.getInt(index);
79 }
80 private int varIndexMemoizedSerializedSize = -1;
81
82 public static final int VAR_VALUE_FIELD_NUMBER = 2;
83 @SuppressWarnings("serial")
84 private com.google.protobuf.Internal.DoubleList varValue_ =
85 emptyDoubleList();
90 @java.lang.Override
91 public java.util.List<java.lang.Double>
93 return varValue_;
94 }
99 public int getVarValueCount() {
100 return varValue_.size();
101 }
107 public double getVarValue(int index) {
108 return varValue_.getDouble(index);
109 }
110 private int varValueMemoizedSerializedSize = -1;
111
112 private byte memoizedIsInitialized = -1;
113 @java.lang.Override
114 public final boolean isInitialized() {
115 byte isInitialized = memoizedIsInitialized;
116 if (isInitialized == 1) return true;
117 if (isInitialized == 0) return false;
118
119 memoizedIsInitialized = 1;
120 return true;
121 }
122
123 @java.lang.Override
124 public void writeTo(com.google.protobuf.CodedOutputStream output)
125 throws java.io.IOException {
127 if (getVarIndexList().size() > 0) {
128 output.writeUInt32NoTag(10);
129 output.writeUInt32NoTag(varIndexMemoizedSerializedSize);
130 }
131 for (int i = 0; i < varIndex_.size(); i++) {
132 output.writeInt32NoTag(varIndex_.getInt(i));
133 }
134 if (getVarValueList().size() > 0) {
135 output.writeUInt32NoTag(18);
136 output.writeUInt32NoTag(varValueMemoizedSerializedSize);
137 }
138 for (int i = 0; i < varValue_.size(); i++) {
139 output.writeDoubleNoTag(varValue_.getDouble(i));
140 }
141 getUnknownFields().writeTo(output);
142 }
143
144 @java.lang.Override
145 public int getSerializedSize() {
146 int size = memoizedSize;
147 if (size != -1) return size;
148
149 size = 0;
150 {
151 int dataSize = 0;
152 for (int i = 0; i < varIndex_.size(); i++) {
153 dataSize += com.google.protobuf.CodedOutputStream
154 .computeInt32SizeNoTag(varIndex_.getInt(i));
155 }
156 size += dataSize;
157 if (!getVarIndexList().isEmpty()) {
158 size += 1;
159 size += com.google.protobuf.CodedOutputStream
160 .computeInt32SizeNoTag(dataSize);
161 }
162 varIndexMemoizedSerializedSize = dataSize;
163 }
164 {
165 int dataSize = 0;
166 dataSize = 8 * getVarValueList().size();
167 size += dataSize;
168 if (!getVarValueList().isEmpty()) {
169 size += 1;
170 size += com.google.protobuf.CodedOutputStream
171 .computeInt32SizeNoTag(dataSize);
172 }
173 varValueMemoizedSerializedSize = dataSize;
174 }
175 size += getUnknownFields().getSerializedSize();
176 memoizedSize = size;
177 return size;
178 }
179
180 @java.lang.Override
181 public boolean equals(final java.lang.Object obj) {
182 if (obj == this) {
183 return true;
184 }
185 if (!(obj instanceof com.google.ortools.linearsolver.PartialVariableAssignment)) {
186 return super.equals(obj);
187 }
188 com.google.ortools.linearsolver.PartialVariableAssignment other = (com.google.ortools.linearsolver.PartialVariableAssignment) obj;
189
190 if (!getVarIndexList()
191 .equals(other.getVarIndexList())) return false;
192 if (!getVarValueList()
193 .equals(other.getVarValueList())) return false;
194 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
195 return true;
196 }
197
198 @java.lang.Override
199 public int hashCode() {
200 if (memoizedHashCode != 0) {
201 return memoizedHashCode;
202 }
203 int hash = 41;
204 hash = (19 * hash) + getDescriptor().hashCode();
205 if (getVarIndexCount() > 0) {
206 hash = (37 * hash) + VAR_INDEX_FIELD_NUMBER;
207 hash = (53 * hash) + getVarIndexList().hashCode();
208 }
209 if (getVarValueCount() > 0) {
210 hash = (37 * hash) + VAR_VALUE_FIELD_NUMBER;
211 hash = (53 * hash) + getVarValueList().hashCode();
212 }
213 hash = (29 * hash) + getUnknownFields().hashCode();
214 memoizedHashCode = hash;
215 return hash;
216 }
217
219 java.nio.ByteBuffer data)
220 throws com.google.protobuf.InvalidProtocolBufferException {
221 return PARSER.parseFrom(data);
222 }
224 java.nio.ByteBuffer data,
225 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
226 throws com.google.protobuf.InvalidProtocolBufferException {
227 return PARSER.parseFrom(data, extensionRegistry);
228 }
230 com.google.protobuf.ByteString data)
231 throws com.google.protobuf.InvalidProtocolBufferException {
232 return PARSER.parseFrom(data);
233 }
235 com.google.protobuf.ByteString data,
236 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
237 throws com.google.protobuf.InvalidProtocolBufferException {
238 return PARSER.parseFrom(data, extensionRegistry);
239 }
241 throws com.google.protobuf.InvalidProtocolBufferException {
242 return PARSER.parseFrom(data);
243 }
245 byte[] data,
246 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
247 throws com.google.protobuf.InvalidProtocolBufferException {
248 return PARSER.parseFrom(data, extensionRegistry);
249 }
251 throws java.io.IOException {
252 return com.google.protobuf.GeneratedMessage
253 .parseWithIOException(PARSER, input);
254 }
256 java.io.InputStream input,
257 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
258 throws java.io.IOException {
259 return com.google.protobuf.GeneratedMessage
260 .parseWithIOException(PARSER, input, extensionRegistry);
261 }
262
264 throws java.io.IOException {
265 return com.google.protobuf.GeneratedMessage
266 .parseDelimitedWithIOException(PARSER, input);
267 }
268
270 java.io.InputStream input,
271 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
272 throws java.io.IOException {
273 return com.google.protobuf.GeneratedMessage
274 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
275 }
277 com.google.protobuf.CodedInputStream input)
278 throws java.io.IOException {
279 return com.google.protobuf.GeneratedMessage
280 .parseWithIOException(PARSER, input);
281 }
283 com.google.protobuf.CodedInputStream input,
284 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
285 throws java.io.IOException {
286 return com.google.protobuf.GeneratedMessage
287 .parseWithIOException(PARSER, input, extensionRegistry);
288 }
289
290 @java.lang.Override
291 public Builder newBuilderForType() { return newBuilder(); }
292 public static Builder newBuilder() {
293 return DEFAULT_INSTANCE.toBuilder();
294 }
295 public static Builder newBuilder(com.google.ortools.linearsolver.PartialVariableAssignment prototype) {
296 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
297 }
298 @java.lang.Override
300 return this == DEFAULT_INSTANCE
301 ? new Builder() : new Builder().mergeFrom(this);
302 }
303
304 @java.lang.Override
306 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
307 Builder builder = new Builder(parent);
308 return builder;
309 }
319 public static final class Builder extends
320 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
321 // @@protoc_insertion_point(builder_implements:operations_research.PartialVariableAssignment)
322 com.google.ortools.linearsolver.PartialVariableAssignmentOrBuilder {
323 public static final com.google.protobuf.Descriptors.Descriptor
325 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_descriptor;
326 }
327
328 @java.lang.Override
329 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
331 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_fieldAccessorTable
332 .ensureFieldAccessorsInitialized(
333 com.google.ortools.linearsolver.PartialVariableAssignment.class, com.google.ortools.linearsolver.PartialVariableAssignment.Builder.class);
334 }
335
336 // Construct using com.google.ortools.linearsolver.PartialVariableAssignment.newBuilder()
337 private Builder() {
338
339 }
340
341 private Builder(
342 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
343 super(parent);
344
345 }
346 @java.lang.Override
347 public Builder clear() {
348 super.clear();
349 bitField0_ = 0;
350 varIndex_ = emptyIntList();
351 varValue_ = emptyDoubleList();
352 return this;
353 }
354
355 @java.lang.Override
356 public com.google.protobuf.Descriptors.Descriptor
358 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_PartialVariableAssignment_descriptor;
359 }
360
361 @java.lang.Override
363 return com.google.ortools.linearsolver.PartialVariableAssignment.getDefaultInstance();
364 }
365
366 @java.lang.Override
369 if (!result.isInitialized()) {
370 throw newUninitializedMessageException(result);
371 }
372 return result;
373 }
374
375 @java.lang.Override
377 com.google.ortools.linearsolver.PartialVariableAssignment result = new com.google.ortools.linearsolver.PartialVariableAssignment(this);
378 if (bitField0_ != 0) { buildPartial0(result); }
379 onBuilt();
380 return result;
381 }
382
383 private void buildPartial0(com.google.ortools.linearsolver.PartialVariableAssignment result) {
384 int from_bitField0_ = bitField0_;
385 if (((from_bitField0_ & 0x00000001) != 0)) {
386 varIndex_.makeImmutable();
387 result.varIndex_ = varIndex_;
388 }
389 if (((from_bitField0_ & 0x00000002) != 0)) {
390 varValue_.makeImmutable();
391 result.varValue_ = varValue_;
392 }
393 }
394
395 @java.lang.Override
396 public Builder mergeFrom(com.google.protobuf.Message other) {
397 if (other instanceof com.google.ortools.linearsolver.PartialVariableAssignment) {
398 return mergeFrom((com.google.ortools.linearsolver.PartialVariableAssignment)other);
399 } else {
400 super.mergeFrom(other);
401 return this;
402 }
403 }
404
405 public Builder mergeFrom(com.google.ortools.linearsolver.PartialVariableAssignment other) {
406 if (other == com.google.ortools.linearsolver.PartialVariableAssignment.getDefaultInstance()) return this;
407 if (!other.varIndex_.isEmpty()) {
408 if (varIndex_.isEmpty()) {
409 varIndex_ = other.varIndex_;
410 varIndex_.makeImmutable();
411 bitField0_ |= 0x00000001;
412 } else {
413 ensureVarIndexIsMutable();
414 varIndex_.addAll(other.varIndex_);
415 }
416 onChanged();
417 }
418 if (!other.varValue_.isEmpty()) {
419 if (varValue_.isEmpty()) {
420 varValue_ = other.varValue_;
421 varValue_.makeImmutable();
422 bitField0_ |= 0x00000002;
423 } else {
424 ensureVarValueIsMutable();
425 varValue_.addAll(other.varValue_);
426 }
427 onChanged();
428 }
429 this.mergeUnknownFields(other.getUnknownFields());
430 onChanged();
431 return this;
432 }
433
434 @java.lang.Override
435 public final boolean isInitialized() {
436 return true;
437 }
438
439 @java.lang.Override
441 com.google.protobuf.CodedInputStream input,
442 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
443 throws java.io.IOException {
444 if (extensionRegistry == null) {
445 throw new java.lang.NullPointerException();
446 }
447 try {
448 boolean done = false;
449 while (!done) {
450 int tag = input.readTag();
451 switch (tag) {
452 case 0:
453 done = true;
454 break;
455 case 8: {
456 int v = input.readInt32();
457 ensureVarIndexIsMutable();
458 varIndex_.addInt(v);
459 break;
460 } // case 8
461 case 10: {
462 int length = input.readRawVarint32();
463 int limit = input.pushLimit(length);
464 ensureVarIndexIsMutable();
465 while (input.getBytesUntilLimit() > 0) {
466 varIndex_.addInt(input.readInt32());
467 }
468 input.popLimit(limit);
469 break;
470 } // case 10
471 case 17: {
472 double v = input.readDouble();
473 ensureVarValueIsMutable();
474 varValue_.addDouble(v);
475 break;
476 } // case 17
477 case 18: {
478 int length = input.readRawVarint32();
479 int limit = input.pushLimit(length);
480 int alloc = length > 4096 ? 4096 : length;
481 ensureVarValueIsMutable(alloc / 8);
482 while (input.getBytesUntilLimit() > 0) {
483 varValue_.addDouble(input.readDouble());
484 }
485 input.popLimit(limit);
486 break;
487 } // case 18
488 default: {
489 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
490 done = true; // was an endgroup tag
491 }
492 break;
493 } // default:
494 } // switch (tag)
495 } // while (!done)
496 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
497 throw e.unwrapIOException();
498 } finally {
499 onChanged();
500 } // finally
501 return this;
502 }
503 private int bitField0_;
504
505 private com.google.protobuf.Internal.IntList varIndex_ = emptyIntList();
506 private void ensureVarIndexIsMutable() {
507 if (!varIndex_.isModifiable()) {
508 varIndex_ = makeMutableCopy(varIndex_);
509 }
510 bitField0_ |= 0x00000001;
511 }
516 public java.util.List<java.lang.Integer>
518 varIndex_.makeImmutable();
519 return varIndex_;
520 }
525 public int getVarIndexCount() {
526 return varIndex_.size();
527 }
533 public int getVarIndex(int index) {
534 return varIndex_.getInt(index);
535 }
543 int index, int value) {
544
545 ensureVarIndexIsMutable();
546 varIndex_.setInt(index, value);
547 bitField0_ |= 0x00000001;
548 onChanged();
549 return this;
550 }
556 public Builder addVarIndex(int value) {
557
558 ensureVarIndexIsMutable();
559 varIndex_.addInt(value);
560 bitField0_ |= 0x00000001;
561 onChanged();
562 return this;
563 }
570 java.lang.Iterable<? extends java.lang.Integer> values) {
571 ensureVarIndexIsMutable();
572 com.google.protobuf.AbstractMessageLite.Builder.addAll(
573 values, varIndex_);
574 bitField0_ |= 0x00000001;
575 onChanged();
576 return this;
577 }
583 varIndex_ = emptyIntList();
584 bitField0_ = (bitField0_ & ~0x00000001);
585 onChanged();
586 return this;
587 }
588
589 private com.google.protobuf.Internal.DoubleList varValue_ = emptyDoubleList();
590 private void ensureVarValueIsMutable() {
591 if (!varValue_.isModifiable()) {
592 varValue_ = makeMutableCopy(varValue_);
593 }
594 bitField0_ |= 0x00000002;
595 }
596 private void ensureVarValueIsMutable(int capacity) {
597 if (!varValue_.isModifiable()) {
598 varValue_ = makeMutableCopy(varValue_, capacity);
599 }
600 bitField0_ |= 0x00000002;
601 }
606 public java.util.List<java.lang.Double>
608 varValue_.makeImmutable();
609 return varValue_;
610 }
615 public int getVarValueCount() {
616 return varValue_.size();
617 }
623 public double getVarValue(int index) {
624 return varValue_.getDouble(index);
625 }
633 int index, double value) {
634
635 ensureVarValueIsMutable();
636 varValue_.setDouble(index, value);
637 bitField0_ |= 0x00000002;
638 onChanged();
639 return this;
640 }
646 public Builder addVarValue(double value) {
647
648 ensureVarValueIsMutable();
649 varValue_.addDouble(value);
650 bitField0_ |= 0x00000002;
651 onChanged();
652 return this;
653 }
660 java.lang.Iterable<? extends java.lang.Double> values) {
661 ensureVarValueIsMutable();
662 com.google.protobuf.AbstractMessageLite.Builder.addAll(
663 values, varValue_);
664 bitField0_ |= 0x00000002;
665 onChanged();
666 return this;
667 }
673 varValue_ = emptyDoubleList();
674 bitField0_ = (bitField0_ & ~0x00000002);
675 onChanged();
676 return this;
677 }
678
679 // @@protoc_insertion_point(builder_scope:operations_research.PartialVariableAssignment)
680 }
681
682 // @@protoc_insertion_point(class_scope:operations_research.PartialVariableAssignment)
683 private static final com.google.ortools.linearsolver.PartialVariableAssignment DEFAULT_INSTANCE;
684 static {
685 DEFAULT_INSTANCE = new com.google.ortools.linearsolver.PartialVariableAssignment();
686 }
687
689 return DEFAULT_INSTANCE;
690 }
691
692 private static final com.google.protobuf.Parser<PartialVariableAssignment>
693 PARSER = new com.google.protobuf.AbstractParser<PartialVariableAssignment>() {
694 @java.lang.Override
695 public PartialVariableAssignment parsePartialFrom(
696 com.google.protobuf.CodedInputStream input,
697 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
698 throws com.google.protobuf.InvalidProtocolBufferException {
699 Builder builder = newBuilder();
700 try {
701 builder.mergeFrom(input, extensionRegistry);
702 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
703 throw e.setUnfinishedMessage(builder.buildPartial());
704 } catch (com.google.protobuf.UninitializedMessageException e) {
705 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
706 } catch (java.io.IOException e) {
707 throw new com.google.protobuf.InvalidProtocolBufferException(e)
708 .setUnfinishedMessage(builder.buildPartial());
709 }
710 return builder.buildPartial();
711 }
712 };
713
714 public static com.google.protobuf.Parser<PartialVariableAssignment> parser() {
715 return PARSER;
716 }
717
718 @java.lang.Override
719 public com.google.protobuf.Parser<PartialVariableAssignment> getParserForType() {
720 return PARSER;
721 }
722
723 @java.lang.Override
727
728}
729
Builder addAllVarValue(java.lang.Iterable<? extends java.lang.Double > values)
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.ortools.linearsolver.PartialVariableAssignment getDefaultInstanceForType()
Builder mergeFrom(com.google.ortools.linearsolver.PartialVariableAssignment other)
com.google.ortools.linearsolver.PartialVariableAssignment build()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
com.google.ortools.linearsolver.PartialVariableAssignment buildPartial()
Builder addAllVarIndex(java.lang.Iterable<? extends java.lang.Integer > values)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
static com.google.ortools.linearsolver.PartialVariableAssignment parseDelimitedFrom(java.io.InputStream input)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
static com.google.ortools.linearsolver.PartialVariableAssignment parseFrom(com.google.protobuf.ByteString data)
static com.google.ortools.linearsolver.PartialVariableAssignment parseFrom(java.io.InputStream input)
com.google.ortools.linearsolver.PartialVariableAssignment getDefaultInstanceForType()
static com.google.ortools.linearsolver.PartialVariableAssignment parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
static com.google.ortools.linearsolver.PartialVariableAssignment parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
void writeTo(com.google.protobuf.CodedOutputStream output)
static com.google.ortools.linearsolver.PartialVariableAssignment parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.linearsolver.PartialVariableAssignment parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static Builder newBuilder(com.google.ortools.linearsolver.PartialVariableAssignment prototype)
static com.google.ortools.linearsolver.PartialVariableAssignment parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.linearsolver.PartialVariableAssignment parseFrom(java.nio.ByteBuffer data)
static com.google.ortools.linearsolver.PartialVariableAssignment parseFrom(com.google.protobuf.CodedInputStream input)
static com.google.ortools.linearsolver.PartialVariableAssignment parseFrom(byte[] data)
static com.google.ortools.linearsolver.PartialVariableAssignment parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.Parser< PartialVariableAssignment > getParserForType()
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
static com.google.ortools.linearsolver.PartialVariableAssignment getDefaultInstance()
static com.google.protobuf.Parser< PartialVariableAssignment > parser()