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