Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
OptionalDouble.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/linear_solver/linear_solver.proto
4// Protobuf Java Version: 4.31.1
5
6package com.google.ortools.linearsolver;
7
16@com.google.protobuf.Generated
17public final class OptionalDouble extends
18 com.google.protobuf.GeneratedMessage implements
19 // @@protoc_insertion_point(message_implements:operations_research.OptionalDouble)
21private static final long serialVersionUID = 0L;
22 static {
23 com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
24 com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
25 /* major= */ 4,
26 /* minor= */ 31,
27 /* patch= */ 1,
28 /* suffix= */ "",
29 OptionalDouble.class.getName());
30 }
31 // Use OptionalDouble.newBuilder() to construct.
32 private OptionalDouble(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
33 super(builder);
34 }
35 private OptionalDouble() {
36 }
37
38 public static final com.google.protobuf.Descriptors.Descriptor
40 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_OptionalDouble_descriptor;
41 }
42
43 @java.lang.Override
44 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
46 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_OptionalDouble_fieldAccessorTable
47 .ensureFieldAccessorsInitialized(
48 com.google.ortools.linearsolver.OptionalDouble.class, com.google.ortools.linearsolver.OptionalDouble.Builder.class);
49 }
50
51 private int bitField0_;
52 public static final int VALUE_FIELD_NUMBER = 1;
53 private double value_ = 0D;
58 @java.lang.Override
59 public boolean hasValue() {
60 return ((bitField0_ & 0x00000001) != 0);
61 }
62
66 @java.lang.Override
67 public double getValue() {
68 return value_;
69 }
70
71 private byte memoizedIsInitialized = -1;
72 @java.lang.Override
73 public final boolean isInitialized() {
74 byte isInitialized = memoizedIsInitialized;
75 if (isInitialized == 1) return true;
76 if (isInitialized == 0) return false;
77
78 memoizedIsInitialized = 1;
79 return true;
80 }
81
82 @java.lang.Override
83 public void writeTo(com.google.protobuf.CodedOutputStream output)
84 throws java.io.IOException {
85 if (((bitField0_ & 0x00000001) != 0)) {
86 output.writeDouble(1, value_);
87 }
88 getUnknownFields().writeTo(output);
89 }
90
91 @java.lang.Override
92 public int getSerializedSize() {
93 int size = memoizedSize;
94 if (size != -1) return size;
95
96 size = 0;
97 if (((bitField0_ & 0x00000001) != 0)) {
98 size += com.google.protobuf.CodedOutputStream
99 .computeDoubleSize(1, value_);
100 }
101 size += getUnknownFields().getSerializedSize();
102 memoizedSize = size;
103 return size;
104 }
105
106 @java.lang.Override
107 public boolean equals(final java.lang.Object obj) {
108 if (obj == this) {
109 return true;
110 }
111 if (!(obj instanceof com.google.ortools.linearsolver.OptionalDouble)) {
112 return super.equals(obj);
113 }
114 com.google.ortools.linearsolver.OptionalDouble other = (com.google.ortools.linearsolver.OptionalDouble) obj;
115
116 if (hasValue() != other.hasValue()) return false;
117 if (hasValue()) {
118 if (java.lang.Double.doubleToLongBits(getValue())
119 != java.lang.Double.doubleToLongBits(
120 other.getValue())) return false;
121 }
122 if (!getUnknownFields().equals(other.getUnknownFields())) return false;
123 return true;
124 }
125
126 @java.lang.Override
127 public int hashCode() {
128 if (memoizedHashCode != 0) {
129 return memoizedHashCode;
130 }
131 int hash = 41;
132 hash = (19 * hash) + getDescriptor().hashCode();
133 if (hasValue()) {
134 hash = (37 * hash) + VALUE_FIELD_NUMBER;
135 hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
136 java.lang.Double.doubleToLongBits(getValue()));
137 }
138 hash = (29 * hash) + getUnknownFields().hashCode();
139 memoizedHashCode = hash;
140 return hash;
141 }
142
144 java.nio.ByteBuffer data)
145 throws com.google.protobuf.InvalidProtocolBufferException {
146 return PARSER.parseFrom(data);
147 }
149 java.nio.ByteBuffer data,
150 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
151 throws com.google.protobuf.InvalidProtocolBufferException {
152 return PARSER.parseFrom(data, extensionRegistry);
153 }
155 com.google.protobuf.ByteString data)
156 throws com.google.protobuf.InvalidProtocolBufferException {
157 return PARSER.parseFrom(data);
158 }
160 com.google.protobuf.ByteString data,
161 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
162 throws com.google.protobuf.InvalidProtocolBufferException {
163 return PARSER.parseFrom(data, extensionRegistry);
164 }
166 throws com.google.protobuf.InvalidProtocolBufferException {
167 return PARSER.parseFrom(data);
168 }
170 byte[] data,
171 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
172 throws com.google.protobuf.InvalidProtocolBufferException {
173 return PARSER.parseFrom(data, extensionRegistry);
174 }
175 public static com.google.ortools.linearsolver.OptionalDouble parseFrom(java.io.InputStream input)
176 throws java.io.IOException {
177 return com.google.protobuf.GeneratedMessage
178 .parseWithIOException(PARSER, input);
179 }
181 java.io.InputStream input,
182 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
183 throws java.io.IOException {
184 return com.google.protobuf.GeneratedMessage
185 .parseWithIOException(PARSER, input, extensionRegistry);
186 }
187
189 throws java.io.IOException {
190 return com.google.protobuf.GeneratedMessage
191 .parseDelimitedWithIOException(PARSER, input);
192 }
193
195 java.io.InputStream input,
196 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
197 throws java.io.IOException {
198 return com.google.protobuf.GeneratedMessage
199 .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
200 }
202 com.google.protobuf.CodedInputStream input)
203 throws java.io.IOException {
204 return com.google.protobuf.GeneratedMessage
205 .parseWithIOException(PARSER, input);
206 }
208 com.google.protobuf.CodedInputStream input,
209 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
210 throws java.io.IOException {
211 return com.google.protobuf.GeneratedMessage
212 .parseWithIOException(PARSER, input, extensionRegistry);
213 }
214
215 @java.lang.Override
216 public Builder newBuilderForType() { return newBuilder(); }
217 public static Builder newBuilder() {
218 return DEFAULT_INSTANCE.toBuilder();
219 }
220 public static Builder newBuilder(com.google.ortools.linearsolver.OptionalDouble prototype) {
221 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
222 }
223 @java.lang.Override
225 return this == DEFAULT_INSTANCE
226 ? new Builder() : new Builder().mergeFrom(this);
227 }
228
229 @java.lang.Override
231 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
232 Builder builder = new Builder(parent);
233 return builder;
234 }
235
243 public static final class Builder extends
244 com.google.protobuf.GeneratedMessage.Builder<Builder> implements
245 // @@protoc_insertion_point(builder_implements:operations_research.OptionalDouble)
247 public static final com.google.protobuf.Descriptors.Descriptor
249 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_OptionalDouble_descriptor;
250 }
251
252 @java.lang.Override
253 protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
255 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_OptionalDouble_fieldAccessorTable
256 .ensureFieldAccessorsInitialized(
257 com.google.ortools.linearsolver.OptionalDouble.class, com.google.ortools.linearsolver.OptionalDouble.Builder.class);
258 }
259
260 // Construct using com.google.ortools.linearsolver.OptionalDouble.newBuilder()
261 private Builder() {
262
263 }
264
265 private Builder(
266 com.google.protobuf.GeneratedMessage.BuilderParent parent) {
267 super(parent);
268
269 }
270 @java.lang.Override
271 public Builder clear() {
272 super.clear();
273 bitField0_ = 0;
274 value_ = 0D;
275 return this;
276 }
277
278 @java.lang.Override
279 public com.google.protobuf.Descriptors.Descriptor
281 return com.google.ortools.linearsolver.LinearSolver.internal_static_operations_research_OptionalDouble_descriptor;
282 }
283
284 @java.lang.Override
286 return com.google.ortools.linearsolver.OptionalDouble.getDefaultInstance();
287 }
288
289 @java.lang.Override
292 if (!result.isInitialized()) {
293 throw newUninitializedMessageException(result);
294 }
295 return result;
296 }
297
298 @java.lang.Override
300 com.google.ortools.linearsolver.OptionalDouble result = new com.google.ortools.linearsolver.OptionalDouble(this);
301 if (bitField0_ != 0) { buildPartial0(result); }
302 onBuilt();
303 return result;
304 }
305
306 private void buildPartial0(com.google.ortools.linearsolver.OptionalDouble result) {
307 int from_bitField0_ = bitField0_;
308 int to_bitField0_ = 0;
309 if (((from_bitField0_ & 0x00000001) != 0)) {
310 result.value_ = value_;
311 to_bitField0_ |= 0x00000001;
312 }
313 result.bitField0_ |= to_bitField0_;
314 }
315
316 @java.lang.Override
317 public Builder mergeFrom(com.google.protobuf.Message other) {
318 if (other instanceof com.google.ortools.linearsolver.OptionalDouble) {
319 return mergeFrom((com.google.ortools.linearsolver.OptionalDouble)other);
320 } else {
321 super.mergeFrom(other);
322 return this;
323 }
324 }
325
326 public Builder mergeFrom(com.google.ortools.linearsolver.OptionalDouble other) {
327 if (other == com.google.ortools.linearsolver.OptionalDouble.getDefaultInstance()) return this;
328 if (other.hasValue()) {
329 setValue(other.getValue());
330 }
331 this.mergeUnknownFields(other.getUnknownFields());
332 onChanged();
333 return this;
334 }
335
336 @java.lang.Override
337 public final boolean isInitialized() {
338 return true;
339 }
340
341 @java.lang.Override
342 public Builder mergeFrom(
343 com.google.protobuf.CodedInputStream input,
344 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
345 throws java.io.IOException {
346 if (extensionRegistry == null) {
347 throw new java.lang.NullPointerException();
348 }
349 try {
350 boolean done = false;
351 while (!done) {
352 int tag = input.readTag();
353 switch (tag) {
354 case 0:
355 done = true;
356 break;
357 case 9: {
358 value_ = input.readDouble();
359 bitField0_ |= 0x00000001;
360 break;
361 } // case 9
362 default: {
363 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
364 done = true; // was an endgroup tag
365 }
366 break;
367 } // default:
368 } // switch (tag)
369 } // while (!done)
370 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
371 throw e.unwrapIOException();
372 } finally {
373 onChanged();
374 } // finally
375 return this;
376 }
377 private int bitField0_;
378
379 private double value_ ;
384 @java.lang.Override
385 public boolean hasValue() {
386 return ((bitField0_ & 0x00000001) != 0);
387 }
388
392 @java.lang.Override
393 public double getValue() {
394 return value_;
395 }
396
401 public Builder setValue(double value) {
402
403 value_ = value;
404 bitField0_ |= 0x00000001;
405 onChanged();
406 return this;
407 }
408
412 public Builder clearValue() {
413 bitField0_ = (bitField0_ & ~0x00000001);
414 value_ = 0D;
415 onChanged();
416 return this;
417 }
418
419 // @@protoc_insertion_point(builder_scope:operations_research.OptionalDouble)
420 }
421
422 // @@protoc_insertion_point(class_scope:operations_research.OptionalDouble)
423 private static final com.google.ortools.linearsolver.OptionalDouble DEFAULT_INSTANCE;
424 static {
425 DEFAULT_INSTANCE = new com.google.ortools.linearsolver.OptionalDouble();
426 }
427
429 return DEFAULT_INSTANCE;
430 }
431
432 private static final com.google.protobuf.Parser<OptionalDouble>
433 PARSER = new com.google.protobuf.AbstractParser<OptionalDouble>() {
434 @java.lang.Override
435 public OptionalDouble parsePartialFrom(
436 com.google.protobuf.CodedInputStream input,
437 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
438 throws com.google.protobuf.InvalidProtocolBufferException {
439 Builder builder = newBuilder();
440 try {
441 builder.mergeFrom(input, extensionRegistry);
442 } catch (com.google.protobuf.InvalidProtocolBufferException e) {
443 throw e.setUnfinishedMessage(builder.buildPartial());
444 } catch (com.google.protobuf.UninitializedMessageException e) {
445 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
446 } catch (java.io.IOException e) {
447 throw new com.google.protobuf.InvalidProtocolBufferException(e)
448 .setUnfinishedMessage(builder.buildPartial());
449 }
450 return builder.buildPartial();
451 }
452 };
453
454 public static com.google.protobuf.Parser<OptionalDouble> parser() {
455 return PARSER;
456 }
457
458 @java.lang.Override
459 public com.google.protobuf.Parser<OptionalDouble> getParserForType() {
460 return PARSER;
461 }
462
463 @java.lang.Override
467
468}
469
com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
com.google.ortools.linearsolver.OptionalDouble getDefaultInstanceForType()
Builder mergeFrom(com.google.protobuf.Message other)
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
com.google.ortools.linearsolver.OptionalDouble buildPartial()
Builder mergeFrom(com.google.ortools.linearsolver.OptionalDouble other)
Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
com.google.ortools.linearsolver.OptionalDouble build()
com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
static com.google.ortools.linearsolver.OptionalDouble parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
boolean equals(final java.lang.Object obj)
static com.google.ortools.linearsolver.OptionalDouble parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.linearsolver.OptionalDouble parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static Builder newBuilder(com.google.ortools.linearsolver.OptionalDouble prototype)
static com.google.ortools.linearsolver.OptionalDouble parseDelimitedFrom(java.io.InputStream input)
static com.google.ortools.linearsolver.OptionalDouble parseFrom(com.google.protobuf.ByteString data)
static com.google.ortools.linearsolver.OptionalDouble getDefaultInstance()
static com.google.ortools.linearsolver.OptionalDouble parseFrom(com.google.protobuf.CodedInputStream input)
static com.google.ortools.linearsolver.OptionalDouble parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
com.google.protobuf.Parser< OptionalDouble > getParserForType()
static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
static com.google.ortools.linearsolver.OptionalDouble parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent)
static com.google.ortools.linearsolver.OptionalDouble parseFrom(java.io.InputStream input)
static com.google.protobuf.Parser< OptionalDouble > parser()
com.google.ortools.linearsolver.OptionalDouble getDefaultInstanceForType()
static com.google.ortools.linearsolver.OptionalDouble parseFrom(java.nio.ByteBuffer data)
static com.google.ortools.linearsolver.OptionalDouble parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.ortools.linearsolver.OptionalDouble parseFrom(byte[] data)
void writeTo(com.google.protobuf.CodedOutputStream output)