Class 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>

static final class ArithmeticFunction.Subtract<R> extends ArithmeticFunction<R>
The "Subtract" (−) expression.
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility during (de)serialization.
      See Also:
    • TYPE

      private static final DefaultAttributeType<Number> TYPE
      Description of results of the "Subtract" expression.
    • NAME

      private static final org.opengis.util.ScopedName NAME
      Identification 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

      protected DefaultAttributeType<Number> expectedType()
      Description copied from class: ArithmeticFunction
      Returns the type of results computed by this arithmetic function.
      Specified by:
      expectedType in class ArithmeticFunction<R>
    • recreate

      public Expression<R,Number> recreate(Expression<? super R,?>[] effective)
      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 + − × ÷.
      Overrides:
      symbol in class Node
      Returns:
      the mathematical symbol, or 0 if none.
    • applyAsDouble

      protected Number applyAsDouble(double left, double right)
      Applies this expression to the given operands.
      Overrides:
      applyAsDouble in class BinaryFunction<R,Number,Number>
    • applyAsFraction

      protected Number applyAsFraction(Fraction left, Fraction right)
      Description copied from class: BinaryFunction
      Calculates this function using given operands of Fraction type. If this function is a filter, then this method should returns an Integer value 0 or 1 for false or true respectively. Otherwise the result is usually a Fraction. This method may return null if the operation cannot apply on numbers.
      Overrides:
      applyAsFraction in class BinaryFunction<R,Number,Number>
    • applyAsDecimal

      protected Number applyAsDecimal(BigDecimal left, BigDecimal right)
      Description copied from class: BinaryFunction
      Calculates this function using given operands of BigDecimal type. If this function is a filter, then this method should returns an Integer value 0 or 1 for false or true respectively. Otherwise the result is usually a BigDecimal. This method may return null if the operation cannot apply on numbers.
      Overrides:
      applyAsDecimal in class BinaryFunction<R,Number,Number>
    • applyAsInteger

      protected Number applyAsInteger(BigInteger left, BigInteger right)
      Description copied from class: BinaryFunction
      Calculates this function using given operands of BigInteger type. If this function is a filter, then this method should returns an Integer value 0 or 1 for false or true respectively. Otherwise the result is usually a BigInteger, except for division which may produce other types. This method may return null if the operation cannot apply on numbers.
      Overrides:
      applyAsInteger in class BinaryFunction<R,Number,Number>
    • applyAsLong

      protected Number applyAsLong(long left, long right)
      Description copied from class: BinaryFunction
      Calculates this function using given operands of long primitive type. If this function is a filter, then this method should returns an Integer value 0 or 1 for false or true respectively. Otherwise the result is usually a Long, except for division which may produce other types. This method may return null if the operation cannot apply on numbers.
      Overrides:
      applyAsLong in class BinaryFunction<R,Number,Number>