Package zone.lamprey.function
Interface DoubleSupplier
- All Superinterfaces:
DoubleSupplier,Supplier<Double>,Supplier<Double>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface DoubleSupplier extends Supplier<Double>, DoubleSupplier
Represents a supplier of
double-valued results. This is the
double-producing primitive specialization of Supplier.
There is no requirement that a distinct result be returned each time the supplier is invoked.
This is a functional interface whose
functional method is getAsDouble().
- Since:
- 1.8
- See Also:
Supplier
-
Field Summary
Fields Modifier and Type Field Description static DoubleSupplierRANDOMFunctional interface toMath.random() -
Method Summary
Modifier and Type Method Description default Runnableconsume(DoubleConsumer consumer)Consume a supplier.default Doubleget()Gets a result.doublegetAsDouble()Gets a result.default DoubleSuppliermap(DoubleUnaryOperator functor)Lift a supplier.default BooleanSuppliermapToBoolean(DoublePredicate functor)Lift a supplier.default IntSuppliermapToInt(DoubleToIntFunction functor)Lift a supplier.default LongSuppliermapToLong(DoubleToLongFunction functor)Lift a supplier.default <R> Supplier<R>mapToObj(DoubleFunction<R> functor)Lift a supplier.
-
Field Details
-
RANDOM
Functional interface toMath.random()
-
-
Method Details
-
getAsDouble
double getAsDouble()Gets a result.- Specified by:
getAsDoublein interfaceDoubleSupplier- Returns:
- a result
-
get
Gets a result. -
consume
Consume a supplier.- Parameters:
consumer- The consumer to use in consuming.- Returns:
- A Runnable which passes the result of this supplier into the given consumer when run.
-
map
Lift a supplier.- Parameters:
functor- The function to use in lifting.- Returns:
- A function that passes the result of fn through a functor to produce a lifted function.
-
mapToObj
Lift a supplier.- Type Parameters:
R- The new return type.- Parameters:
functor- The function to use in lifting.- Returns:
- A supplier that passes the result of fn through a functor to produce a lifted supplier.
-
mapToBoolean
Lift a supplier.- Parameters:
functor- The function to use in lifting.- Returns:
- A function that passes the result of fn through a functor to produce a lifted function.
-
mapToInt
Lift a supplier.- Parameters:
functor- The function to use in lifting.- Returns:
- A function that passes the result of fn through a functor to produce a lifted function.
-
mapToLong
Lift a supplier.- Parameters:
functor- The function to use in lifting.- Returns:
- A function that passes the result of fn through a functor to produce a lifted function.
-