Interface NumericFunctionExpression<T,N extends Number & Comparable<N>>
- Type Parameters:
T- entity type.N- result type of the function.
- All Superinterfaces:
ComparableExpression<T,,N> Expression<T,,N> FunctionExpression<T,,N> NumericExpression<T,N>
An expression that represents application of a function
to zero or more expressions supplied as arguments() to
compute a numeric result.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of the function that computes the absolute value of a numeric expression.static final StringName of the function that computes the length of astatic final StringName of the function that computes the negation of a numeric expression. -
Method Summary
Modifier and TypeMethodDescriptionList<? extends ComparableExpression<? super T, ?>> An ordered list of inputs to the function.static <T,N extends Number & Comparable<N>>
NumericFunctionExpression<T, N> of(String name, Class<? extends N> returnType, NumericExpression<? super T, N> expression) Creates aNumericFunctionExpressionto represent a function with the givennamethat accepts the given numericexpressionas input.static <T,N extends Number & Comparable<N>>
NumericFunctionExpression<T, N> of(String name, Class<N> returnType, TextExpression<? super T> expression) Creates aNumericFunctionExpressionto represent a function with the givennamethat accepts the given textualexpressionas input.Methods inherited from interface jakarta.data.expression.ComparableExpression
between, between, greaterThan, greaterThan, greaterThanEqual, greaterThanEqual, lessThan, lessThan, lessThanEqual, lessThanEqual, notBetween, notBetweenMethods inherited from interface jakarta.data.expression.Expression
equalTo, equalTo, in, in, in, isNull, notEqualTo, notEqualTo, notIn, notIn, notIn, notNull, satisfies, typeMethods inherited from interface jakarta.data.spi.expression.function.FunctionExpression
nameMethods inherited from interface jakarta.data.expression.NumericExpression
abs, asBigDecimal, asBigInteger, asDouble, asLong, dividedBy, dividedBy, dividedInto, minus, minus, negated, plus, plus, subtractedFrom, times, times
-
Field Details
-
ABS
Name of the function that computes the absolute value of a numeric expression.
This function accepts a numeric expression as its only argument.
The result of the
ABSfunction is a numeric expression of the same type as the argument. The resulting expression represents a non-negative numeric value.- See Also:
-
LENGTH
Name of the function that computes the length of a
Name of the function that computes the length of a textual expression. The length is the number of characters, as determined by the database, in the value to which the textual expression evaluates.
This function accepts a textual expression as its only argument.
The result of the
LENGTHfunction is a numeric expression in which the expression type isIntegerand the entity type is the same as the entity type of the textual expression. The resulting expression represents a non-negative numeric value, indicating the number of characters in theStringvalue to which the textual expression evaluates.- See Also:
-
NEG
Name of the function that computes the negation of a numeric expression. This is equivalent to multiplication by
-1, causing reversal of the sign on positive numbers to become negative and on negative numbers to becomeName of the function that computes the additive inverse of a numeric expression. This reverses the sign such that positive numbers become negative and negative numbers become positive.
This function accepts a numeric expression as its only argument.
The result of the
NEGfunction is a numeric expression of the same type as the argument.- See Also:
-
-
Method Details
-
of
static <T,N extends Number & Comparable<N>> NumericFunctionExpression<T,N> of(String name, Class<? extends N> returnType, NumericExpression<? super T, N> expression) Creates aNumericFunctionExpressionto represent a function with the givennamethat accepts the given numericexpressionas input.- Type Parameters:
T- entity type.N- result type of the function.- Parameters:
name- a function name constant (such asABS) defined in this class or a function name constant from a vendor extension.returnType- the type of the result to which the expression evaluates.expression- an expression that evaluates to a numeric value.- Returns:
- a
NumericFunctionExpressionrepresenting the function.
-
of
static <T,N extends Number & Comparable<N>> NumericFunctionExpression<T,N> of(String name, Class<N> returnType, TextExpression<? super T> expression) Creates aNumericFunctionExpressionto represent a function with the givennamethat accepts the given textualexpressionas input.- Type Parameters:
T- entity type.N- result type of the function.- Parameters:
name- a function name constant (such asLENGTH) defined in this class or a function name constant from a vendor extension.returnType- the type of the result to which the expression evaluates.expression- an expression that evaluates to aStringvalue.- Returns:
- a
NumericFunctionExpressionrepresenting the function.
-
arguments
List<? extends ComparableExpression<? super T,?>> arguments()An ordered list of inputs to the function.
A constant (such as
ABSorLENGTHdefined in this class or in a vendor extension) defines the function name and is also responsible for documenting the function arguments, including the meaning and data type of each argument and the order in which arguments must be supplied. By convention, when a method of anExpressionsubtype represents invocation of a function on a target expression, such asNumericExpression.abs(), the first element of the argument list should be the target expression, and subsequent elements should be the method arguments, in the same order, if present.- Specified by:
argumentsin interfaceFunctionExpression<T,N extends Number & Comparable<N>> - Returns:
- a list of expressions that represent the arguments to the function.
-