Package org.apache.sis.filter
Class ArithmeticFunction.Subtract<R>
java.lang.Object
org.apache.sis.internal.filter.Node
org.apache.sis.filter.BinaryFunction<R,Number,Number>
org.apache.sis.filter.ArithmeticFunction<R>
org.apache.sis.filter.ArithmeticFunction.Subtract<R>
- Type Parameters:
R
- the type of resources used as inputs.
- All Implemented Interfaces:
Serializable
,Function<R,
,Number> Expression<R,
,Number> Optimization.OnExpression<R,
,Number> FeatureExpression<R,
Number>
- Enclosing class:
ArithmeticFunction<R>
The "Subtract" (−) expression.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.filter.ArithmeticFunction
ArithmeticFunction.Add<R>, ArithmeticFunction.Divide<R>, ArithmeticFunction.Multiply<R>, ArithmeticFunction.Subtract<R>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.opengis.util.ScopedName
Identification of the"Subtract"
operation.private static final long
For cross-version compatibility during (de)serialization.private static final DefaultAttributeType
<Number> Description of results of the"Subtract"
expression.Fields inherited from class org.apache.sis.filter.BinaryFunction
expression1, expression2
-
Constructor Summary
ConstructorsConstructorDescriptionSubtract
(Expression<? super R, ? extends Number> expression1, Expression<? super R, ? extends Number> expression2) Creates a new expression for the"Subtract"
operation. -
Method Summary
Modifier and TypeMethodDescriptionprotected Number
applyAsDecimal
(BigDecimal left, BigDecimal right) Calculates this function using given operands ofBigDecimal
type.protected Number
applyAsDouble
(double left, double right) Applies this expression to the given operands.protected Number
applyAsFraction
(Fraction left, Fraction right) Calculates this function using given operands ofFraction
type.protected Number
applyAsInteger
(BigInteger left, BigInteger right) Calculates this function using given operands ofBigInteger
type.protected Number
applyAsLong
(long left, long right) Calculates this function using given operands oflong
primitive type.protected DefaultAttributeType
<Number> Returns the type of results computed by this arithmetic function.org.opengis.util.ScopedName
Returns the name of the function to be called.recreate
(Expression<? super R, ?>[] effective) Creates a new expression of the same type but different parameters.protected char
symbol()
Returns the mathematical symbol for this binary function.Methods inherited from class org.apache.sis.filter.ArithmeticFunction
apply, createNumericType, expectedType, getValueClass, toValueType
Methods inherited from class org.apache.sis.filter.BinaryFunction
apply, getChildren, getExpressions, getParameters
Methods inherited from class org.apache.sis.internal.filter.Node
createName, createType, equals, getGeometryLibrary, hashCode, toGeometryWrapper, toString, unwrap, warning
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.sis.filter.Expression
getParameters
Methods inherited from interface org.apache.sis.filter.Optimization.OnExpression
optimize
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility during (de)serialization.- See Also:
-
TYPE
Description of results of the"Subtract"
expression. -
NAME
private static final org.opengis.util.ScopedName NAMEIdentification of the"Subtract"
operation.
-
-
Constructor Details
-
Subtract
Subtract(Expression<? super R, ? extends Number> expression1, Expression<? super R, ? extends Number> expression2) Creates a new expression for the"Subtract"
operation.
-
-
Method Details
-
expectedType
Description copied from class:ArithmeticFunction
Returns the type of results computed by this arithmetic function.- Specified by:
expectedType
in classArithmeticFunction<R>
-
recreate
Creates a new expression of the same type but different parameters.- Parameters:
effective
- the expressions to use as a replacement of this expression parameters.- Returns:
- the new expression, or
this
if unsupported.
-
getFunctionName
public org.opengis.util.ScopedName getFunctionName()Description copied from interface:Expression
Returns the name of the function to be called.- Returns:
- name of the function to be called.
-
symbol
protected char symbol()Description copied from class:Node
Returns the mathematical symbol for this binary function. For comparison operators, the symbol should be one of < > ≤ ≥ = ≠. For arithmetic operators, the symbol should be one of + − × ÷. -
applyAsDouble
Applies this expression to the given operands.- Overrides:
applyAsDouble
in classBinaryFunction<R,
Number, Number>
-
applyAsFraction
Description copied from class:BinaryFunction
Calculates this function using given operands ofFraction
type. If this function is a filter, then this method should returns anInteger
value 0 or 1 for false or true respectively. Otherwise the result is usually aFraction
. This method may returnnull
if the operation cannot apply on numbers.- Overrides:
applyAsFraction
in classBinaryFunction<R,
Number, Number>
-
applyAsDecimal
Description copied from class:BinaryFunction
Calculates this function using given operands ofBigDecimal
type. If this function is a filter, then this method should returns anInteger
value 0 or 1 for false or true respectively. Otherwise the result is usually aBigDecimal
. This method may returnnull
if the operation cannot apply on numbers.- Overrides:
applyAsDecimal
in classBinaryFunction<R,
Number, Number>
-
applyAsInteger
Description copied from class:BinaryFunction
Calculates this function using given operands ofBigInteger
type. If this function is a filter, then this method should returns anInteger
value 0 or 1 for false or true respectively. Otherwise the result is usually aBigInteger
, except for division which may produce other types. This method may returnnull
if the operation cannot apply on numbers.- Overrides:
applyAsInteger
in classBinaryFunction<R,
Number, Number>
-
applyAsLong
Description copied from class:BinaryFunction
Calculates this function using given operands oflong
primitive type. If this function is a filter, then this method should returns anInteger
value 0 or 1 for false or true respectively. Otherwise the result is usually aLong
, except for division which may produce other types. This method may returnnull
if the operation cannot apply on numbers.- Overrides:
applyAsLong
in classBinaryFunction<R,
Number, Number>
-