T
- type to extract from@FunctionalInterface public interface ToFloat<T> extends Expression<T>, com.speedment.common.function.ToFloatFunction<T>, HasAsDouble<T>, HasAsInt<T>, HasAsLong<T>, HasAbs<ToFloat<T>>, HasSign<ToByte<T>>, HasSqrt<ToDouble<T>>, HasNegate<ToFloat<T>>, HasPow<T>, HasPlus<T>, HasMinus<T>, HasMultiply<T>, HasDivide<T>, HasMap<T,com.speedment.common.function.FloatUnaryOperator,ToFloat<T>>, HasMapToDouble<T,com.speedment.common.function.FloatToDoubleFunction>, HasHash<T>, HasCompare<T>, HasCompose<T>
float
value. This
expression can be implemented using a lambda, or it can be a result of
another operation. It has additional methods for operating on it.ToFloatFunction
Modifier and Type | Method and Description |
---|---|
default ToFloat<T> |
abs()
Returns a new expression that returns the absolute value of the result
of the current expression.
|
float |
applyAsFloat(T object)
Applies this function to the given argument.
|
default ToDouble<T> |
asDouble()
Returns an expression that casts the result of the current expression
into a
double . |
default ToInt<T> |
asInt()
Returns an expression that casts the result of the current expression
into an
int . |
default ToLong<T> |
asLong()
Returns an expression that casts the result of the current expression
into a
long . |
default int |
compare(T first,
T second) |
default <V> ToFloatNullable<V> |
compose(Function<? super V,? extends T> before)
Returns a composed expression that first applies the
before
function to its input, and then applies this function to the result. |
default ToDouble<T> |
divide(double divisor)
Creates and returns an expression that returns the quotient of the result
from the current expression and the divisor.
|
default ToDouble<T> |
divide(int divisor)
Creates and returns an expression that returns the quotient of
the result from the current expression and the divisor.
|
default ToDouble<T> |
divide(long divisor)
Creates and returns an expression that returns the quotient of the result
from the current expression and the divisor.
|
default ToDouble<T> |
divide(ToDouble<T> divisor)
Creates and returns an expression that returns the quotient of the result
from the current expression and the divisor.
|
default ToDouble<T> |
divide(ToInt<T> divisor)
Creates and returns an expression that returns the quotient of the result
from the current expression and the divisor.
|
default ToDouble<T> |
divide(ToLong<T> divisor)
Creates and returns an expression that returns the quotient of the result
from the current expression and the divisor.
|
default ExpressionType |
expressionType()
Returns the expression type of this expression.
|
default long |
hash(T object)
Hash the specified object into a 64-bit hash.
|
default ToFloat<T> |
map(com.speedment.common.function.FloatUnaryOperator operator)
Returns an expression for the value of this expression mapped using the
specified mapping function.
|
default ToDouble<T> |
mapToDouble(com.speedment.common.function.FloatToDoubleFunction operator)
Maps the result of this expression into a
double by passing it to
the specified mapper , producing a new expression that implements
ToDouble . |
default ToFloat<T> |
minus(byte other)
Creates and returns an expression that returns the difference of the
result from the current expression and the other term.
|
default ToDouble<T> |
minus(double other)
Creates and returns an expression that returns the difference of the
result from the current expression and the other term.
|
default ToFloat<T> |
minus(int other)
Creates and returns an expression that returns the difference of the
result from the current expression and the other term.
|
default ToDouble<T> |
minus(long other)
Creates and returns an expression that returns the difference of the
result from the current expression and the other term.
|
default ToFloat<T> |
minus(ToByte<T> other)
Creates and returns an expression that returns the difference of the
result from the current expression and the other term.
|
default ToDouble<T> |
minus(ToDouble<T> other)
Creates and returns an expression that returns the difference of the
result from the current expression and the other term.
|
default ToFloat<T> |
minus(ToInt<T> other)
Creates and returns an expression that returns the difference of the
result from the current expression and the other term.
|
default ToDouble<T> |
minus(ToLong<T> other)
Creates and returns an expression that returns the difference of the
result from the current expression and the other term.
|
default ToFloat<T> |
multiply(byte other)
Creates and returns an expression that returns the product of the result
from the current expression and the other factor.
|
default ToDouble<T> |
multiply(double other)
Creates and returns an expression that returns the product of the result
from the current expression and the other factor.
|
default ToFloat<T> |
multiply(int other)
Creates and returns an expression that returns the product of the result
from the current expression and the other factor.
|
default ToDouble<T> |
multiply(long other)
Creates and returns an expression that returns the product of the result
from the current expression and the other factor.
|
default ToFloat<T> |
multiply(ToByte<T> other)
Creates and returns an expression that returns the product of the result
from the current expression and the other factor.
|
default ToDouble<T> |
multiply(ToDouble<T> other)
Creates and returns an expression that returns the product of the result
from the current expression and the other factor.
|
default ToFloat<T> |
multiply(ToInt<T> other)
Creates and returns an expression that returns the product of the result
from the current expression and the other factor.
|
default ToDouble<T> |
multiply(ToLong<T> other)
Creates and returns an expression that returns the product of the result
from the current expression and the other factor.
|
default ToFloat<T> |
negate()
Returns a new expression that returns the absolute value of the result
of the current expression.
|
static <T> ToFloat<T> |
of(com.speedment.common.function.ToFloatFunction<T> lambda)
Returns a typed
ToFloat<T> using the provided lambda . |
default ToFloat<T> |
plus(byte other)
Creates and returns an expression that returns the sum of the result from
the current expression and the other term.
|
default ToDouble<T> |
plus(double other)
Creates and returns an expression that returns the sum of the result from
the current expression and the other term.
|
default ToFloat<T> |
plus(int other)
Creates and returns an expression that returns the sum of the result from
the current expression and the other term.
|
default ToDouble<T> |
plus(long other)
Creates and returns an expression that returns the sum of the result from
the current expression and the other term.
|
default ToFloat<T> |
plus(ToByte<T> other)
Creates and returns an expression that returns the sum of the result from
the current expression and the other term.
|
default ToDouble<T> |
plus(ToDouble<T> other)
Creates and returns an expression that returns the sum of the result from
the current expression and the other term.
|
default ToFloat<T> |
plus(ToInt<T> other)
Creates and returns an expression that returns the sum of the result from
the current expression and the other term.
|
default ToDouble<T> |
plus(ToLong<T> other)
Creates and returns an expression that returns the sum of the result from
the current expression and the other term.
|
default ToDouble<T> |
pow(double power)
Creates and returns an expression that returns the exponential power of
the result from the current expression.
|
default ToDouble<T> |
pow(int power)
Creates and returns an expression that returns the exponential power of
the result from the current expression.
|
default ToDouble<T> |
pow(ToDouble<T> power)
Creates and returns an expression that returns the exponential power of
the result from the current expression.
|
default ToDouble<T> |
pow(ToInt<T> power)
Creates and returns an expression that returns the exponential power of
the result from the current expression.
|
default ToByte<T> |
sign()
Creates and returns an expression that returns
1 if the result of
the this expression is positive, -1 if the result of this
expression is negative and 0 if the result of this expression is
0 . |
default ToDouble<T> |
sqrt()
Creates and returns an expression that returns the square root of the
result from the current expression.
|
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
static <T> ToFloat<T> of(com.speedment.common.function.ToFloatFunction<T> lambda)
ToFloat<T>
using the provided lambda
.T
- type to extract fromlambda
- to convertToFloat<T>
using the provided lambda
NullPointerException
- if the provided lambda
is
null
float applyAsFloat(T object)
com.speedment.common.function.ToFloatFunction
applyAsFloat
in interface com.speedment.common.function.ToFloatFunction<T>
object
- the argumentdefault ExpressionType expressionType()
Expression
expressionType
in interface Expression<T>
default ToDouble<T> asDouble()
HasAsDouble
double
.asDouble
in interface HasAsDouble<T>
default ToInt<T> asInt()
HasAsInt
int
.default ToLong<T> asLong()
HasAsLong
long
.default ToDouble<T> mapToDouble(com.speedment.common.function.FloatToDoubleFunction operator)
HasMapToDouble
double
by passing it to
the specified mapper
, producing a new expression that implements
ToDouble
.mapToDouble
in interface HasMapToDouble<T,com.speedment.common.function.FloatToDoubleFunction>
operator
- the mapper to use on the result of this expressiondefault ToFloat<T> map(com.speedment.common.function.FloatUnaryOperator operator)
HasMap
default ToFloat<T> abs()
HasAbs
default ToByte<T> sign()
HasSign
1
if the result of
the this expression is positive, -1
if the result of this
expression is negative and 0
if the result of this expression is
0
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToDouble<T> sqrt()
HasSqrt
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToFloat<T> negate()
HasNegate
default ToDouble<T> pow(int power)
HasPow
-3
and the power was set to 2
,
then the result of the returned expression would be 9
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToDouble<T> pow(double power)
HasPow
-3
and the power was set to 2
,
then the result of the returned expression would be 9
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToDouble<T> pow(ToInt<T> power)
HasPow
-3
and the power was set to 2
,
then the result of the returned expression would be 9
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToDouble<T> pow(ToDouble<T> power)
HasPow
-3
and the power was set to 2
,
then the result of the returned expression would be 9
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToFloat<T> plus(byte other)
HasPlus
9
and the other term was set to
3
, then the result of the returned expression would be 12
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToFloat<T> plus(ToByte<T> other)
HasPlus
9
and the other term was set to
3
, then the result of the returned expression would be 12
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToFloat<T> plus(int other)
HasPlus
9
and the other term was set to
3
, then the result of the returned expression would be 12
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToFloat<T> plus(ToInt<T> other)
HasPlus
9
and the other term was set to
3
, then the result of the returned expression would be 12
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToDouble<T> plus(long other)
HasPlus
9
and the other term was set to
3
, then the result of the returned expression would be 12
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToDouble<T> plus(ToLong<T> other)
HasPlus
9
and the other term was set to
3
, then the result of the returned expression would be 12
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToDouble<T> plus(double other)
HasPlus
9
and the other term was set to
3
, then the result of the returned expression would be 12
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToDouble<T> plus(ToDouble<T> other)
HasPlus
9
and the other term was set to
3
, then the result of the returned expression would be 12
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToFloat<T> minus(byte other)
HasMinus
9
and the other term was
set to 3
, then the result of the returned expression would be
6
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToFloat<T> minus(ToByte<T> other)
HasMinus
9
and the other term was
set to 3
, then the result of the returned expression would be
6
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToFloat<T> minus(int other)
HasMinus
9
and the other term was
set to 3
, then the result of the returned expression would be
6
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToFloat<T> minus(ToInt<T> other)
HasMinus
9
and the other term was
set to 3
, then the result of the returned expression would be
6
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToDouble<T> minus(long other)
HasMinus
9
and the other term was
set to 3
, then the result of the returned expression would be
6
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToDouble<T> minus(ToLong<T> other)
HasMinus
9
and the other term was
set to 3
, then the result of the returned expression would be
6
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToDouble<T> minus(double other)
HasMinus
9
and the other term was
set to 3
, then the result of the returned expression would be
6
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToDouble<T> minus(ToDouble<T> other)
HasMinus
9
and the other term was
set to 3
, then the result of the returned expression would be
6
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToFloat<T> multiply(byte other)
HasMultiply
9
and the factor was set to
3
, then the result of the returned expression would be 27
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
multiply
in interface HasMultiply<T>
other
- the other factor used for the multiplicationdefault ToFloat<T> multiply(ToByte<T> other)
HasMultiply
9
and the factor was set to
3
, then the result of the returned expression would be 27
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
multiply
in interface HasMultiply<T>
other
- the other factor used for the multiplicationdefault ToFloat<T> multiply(int other)
HasMultiply
9
and the factor was set to
3
, then the result of the returned expression would be 27
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
multiply
in interface HasMultiply<T>
other
- the other factor used for the multiplicationdefault ToFloat<T> multiply(ToInt<T> other)
HasMultiply
9
and the factor was set to
3
, then the result of the returned expression would be 27
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
multiply
in interface HasMultiply<T>
other
- the other factor used for the multiplicationdefault ToDouble<T> multiply(long other)
HasMultiply
9
and the factor was set to
3
, then the result of the returned expression would be 27
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
multiply
in interface HasMultiply<T>
other
- the other factor used for the multiplicationdefault ToDouble<T> multiply(ToLong<T> other)
HasMultiply
9
and the factor was set to
3
, then the result of the returned expression would be 27
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
multiply
in interface HasMultiply<T>
other
- the other factor used for the multiplicationdefault ToDouble<T> multiply(double other)
HasMultiply
9
and the factor was set to
3
, then the result of the returned expression would be 27
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
multiply
in interface HasMultiply<T>
other
- the other factor used for the multiplicationdefault ToDouble<T> multiply(ToDouble<T> other)
HasMultiply
9
and the factor was set to
3
, then the result of the returned expression would be 27
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
multiply
in interface HasMultiply<T>
other
- the other factor used for the multiplicationdefault ToDouble<T> divide(int divisor)
HasDivide
9
and the divisor was set to 3
,
then the result of the returned expression would be 3
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToDouble<T> divide(ToInt<T> divisor)
HasDivide
9
and the divisor was set to
3
, then the result of the returned expression would be 3
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToDouble<T> divide(long divisor)
HasDivide
9
and the divisor was set to
3
, then the result of the returned expression would be 3
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToDouble<T> divide(ToLong<T> divisor)
HasDivide
9
and the divisor was set to
3
, then the result of the returned expression would be 3
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToDouble<T> divide(double divisor)
HasDivide
9
and the divisor was set to
3
, then the result of the returned expression would be 3
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default ToDouble<T> divide(ToDouble<T> divisor)
HasDivide
9
and the divisor was set to
3
, then the result of the returned expression would be 3
.
If this expression is nullable and the result was null
, then the
result of the returned expression will also be null
.
default long hash(T object)
HasHash
default int compare(T first, T second)
compare
in interface Comparator<T>
compare
in interface HasCompare<T>
default <V> ToFloatNullable<V> compose(Function<? super V,? extends T> before)
HasCompose
before
function to its input, and then applies this function to the result.
If evaluation of either function throws an exception, it is relayed to
the caller of the composed function.compose
in interface HasCompose<T>
V
- the type of input to the before
function, and to the
composed expressionbefore
- the function to apply before this function is appliedbefore
function and then applies this functionCopyright © 2018 Speedment, Inc.. All rights reserved.