Lines Matching refs:other
142 * Return the value if present, otherwise return {@code other}.
144 * @param other the value to be returned if there is no value present
145 * @return the value, if present, otherwise {@code other}
147 public double orElse(double other) {
148 return isPresent ? value : other;
152 * Return the value if present, otherwise invoke {@code other} and return
155 * @param other a {@code DoubleSupplier} whose result is returned if no value
157 * @return the value if present otherwise the result of {@code other.getAsDouble()}
158 * @throws NullPointerException if value is not present and {@code other} is
161 public double orElseGet(DoubleSupplier other) {
162 return isPresent ? value : other.getAsDouble();
190 * Indicates whether some other object is "equal to" this OptionalDouble. The
191 * other object is considered equal if:
195 * <li>the present values are "equal to" each other via {@code Double.compare() == 0}.
199 * @return {code true} if the other object is "equal to" this object
212 OptionalDouble other = (OptionalDouble) obj;
213 return (isPresent && other.isPresent)
214 ? Double.compare(value, other.value) == 0
215 : isPresent == other.isPresent;