Class NumericValue<N extends Number,​NAV extends NumericValue<N,​NAV>>

  • Type Parameters:
    N - actual Java type of the underlying numeric value (Integer, Double...)
    NAV - Concrete numeric AttributeValue type subclass
    All Implemented Interfaces:
    AttributeValue, PrimitiveValue, Value
    Direct Known Subclasses:
    DoubleValue, IntegerValue

    public abstract class NumericValue<N extends Number,​NAV extends NumericValue<N,​NAV>>
    extends StringParseableValue<N>
    Superclass of all numeric Attribute Values (integer, double...)
    Version:
    $Id: $
    • Method Detail

      • abs

        public abstract NAV abs()
        Returns the absolute value of this. Used by the XACML "abs" functions.
        Returns:
        the absolute value
      • add

        public abstract NAV add​(Deque<? extends NAV> others)
                         throws ArithmeticException
        Adds numbers to this. Used by the XACML numeric *-add functions.
        Parameters:
        others - values to add to this value
        Returns:
        sum of this and the others.
        Throws:
        ArithmeticException - if the result overflows the value space of N
      • subtract

        public abstract NAV subtract​(NAV subtractedVal)
                              throws ArithmeticException
        Subtract a number from this. Used by XACML numeric *-subtract functions.
        Parameters:
        subtractedVal - value to be subtracted from this
        Returns:
        this - subtractedVal
        Throws:
        ArithmeticException - if the result overflows the value space of N
      • multiply

        public abstract NAV multiply​(Deque<? extends NAV> others)
                              throws ArithmeticException
        Multiply this by other numbers. Used by the XACML "multiply" functions.
        Parameters:
        others - other values to multiply by
        Returns:
        product of this by the others
        Throws:
        ArithmeticException - if the result overflows the value space of N
      • divide

        public abstract NAV divide​(NAV divisor)
                            throws ArithmeticException
        Divide this by some other number. Used by XACML *-divide functions.
        Parameters:
        divisor - number by which this is divided
        Returns:
        the result quotient
        Throws:
        ArithmeticException - if divisor is zero