Class DoubleField

    • Constructor Summary

      Constructors 
      Constructor Description
      DoubleField()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Double add​(java.lang.Object l, java.lang.Object r)
      Add two members of the field.
      java.lang.Boolean and​(java.lang.Object l, java.lang.Object r)
      Logical and.
      java.lang.Object convertFromInt​(java.lang.Integer l)
      Attempt to convert argument from an integer
      java.lang.Integer convertToInt​(java.lang.Object l)
      Attempt to convert argument to an integer
      java.lang.Double div​(java.lang.Object l, java.lang.Object r)
      Divides two members of the field.
      java.lang.Boolean eq​(java.lang.Object l, java.lang.Object r)
      Equals
      java.lang.Boolean ge​(java.lang.Object l, java.lang.Object r)
      Greater or equal to
      java.lang.Object getOne()
      Get the multiplicative identity for this field.
      java.lang.Object getZero()
      Get the additive identity for this field
      java.lang.Boolean gt​(java.lang.Object l, java.lang.Object r)
      Greater than
      java.lang.Boolean le​(java.lang.Object l, java.lang.Object r)
      Less than or equals to
      java.lang.Boolean lt​(java.lang.Object l, java.lang.Object r)
      Less than
      java.lang.Double mod​(java.lang.Object l, java.lang.Object r)
      The modulus of two members of the field.
      java.lang.Double mul​(java.lang.Object l, java.lang.Object r)
      Multiplies two members of the field.
      java.lang.Boolean ne​(java.lang.Object l, java.lang.Object r)
      Not Equals
      java.lang.Double neg​(java.lang.Object l)
      The negation -x of an element.
      java.lang.Boolean not​(java.lang.Object l)
      Logical not.
      java.lang.Boolean or​(java.lang.Object l, java.lang.Object r)
      Logical or.
      java.lang.Double pow​(java.lang.Object l, java.lang.Object r)
      If l>=0 calls Math.pow, if l<0 (i.e. when the result would be complex) return null.
      java.lang.Double powG​(java.lang.Double l, java.lang.Double r)  
      java.lang.Double sub​(java.lang.Object l, java.lang.Object r)
      Subtract two members of the field.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DoubleField

        public DoubleField()
    • Method Detail

      • add

        public java.lang.Double add​(java.lang.Object l,
                                    java.lang.Object r)
                             throws EvaluationException
        Description copied from interface: FieldI
        Add two members of the field.
        Specified by:
        add in interface FieldI
        Parameters:
        l - left hand argument
        r - right hand argument
        Returns:
        an object representing the result or null if it can not be evaluated.
        Throws:
        EvaluationException - on error
      • sub

        public java.lang.Double sub​(java.lang.Object l,
                                    java.lang.Object r)
                             throws EvaluationException
        Description copied from interface: FieldI
        Subtract two members of the field.
        Specified by:
        sub in interface FieldI
        Parameters:
        l - left hand argument
        r - right hand argument
        Returns:
        an object representing the result or null if it can not be evaluated.
        Throws:
        EvaluationException - on error
      • neg

        public java.lang.Double neg​(java.lang.Object l)
                             throws EvaluationException
        Description copied from interface: FieldI
        The negation -x of an element.
        Specified by:
        neg in interface FieldI
        Parameters:
        l - the argument
        Returns:
        an object representing the result or null if it can not be evaluated.
        Throws:
        EvaluationException - on error
      • mul

        public java.lang.Double mul​(java.lang.Object l,
                                    java.lang.Object r)
                             throws EvaluationException
        Description copied from interface: FieldI
        Multiplies two members of the field.
        Specified by:
        mul in interface FieldI
        Parameters:
        l - left hand argument
        r - right hand argument
        Returns:
        an object representing the result or null if it can not be evaluated.
        Throws:
        EvaluationException - on error
      • div

        public java.lang.Double div​(java.lang.Object l,
                                    java.lang.Object r)
                             throws EvaluationException
        Description copied from interface: FieldI
        Divides two members of the field.
        Specified by:
        div in interface FieldI
        Parameters:
        l - left hand argument
        r - right hand argument
        Returns:
        an object representing the result or null if it can not be evaluated.
        Throws:
        EvaluationException - on error
      • mod

        public java.lang.Double mod​(java.lang.Object l,
                                    java.lang.Object r)
                             throws EvaluationException
        Description copied from interface: FieldI
        The modulus of two members of the field.
        Specified by:
        mod in interface FieldI
        Parameters:
        l - left hand argument
        r - right hand argument
        Returns:
        an object representing the result or null if it can not be evaluated.
        Throws:
        EvaluationException - on error
      • pow

        public java.lang.Double pow​(java.lang.Object l,
                                    java.lang.Object r)
                             throws EvaluationException
        If l>=0 calls Math.pow, if l<0 (i.e. when the result would be complex) return null. Integral exponents are handled by the powI method.
        Specified by:
        pow in interface FieldI
        Parameters:
        l - left hand argument
        r - right hand argument
        Returns:
        an object representing the result or null if it can not be evaluated.
        Throws:
        EvaluationException - on error
      • powG

        public java.lang.Double powG​(java.lang.Double l,
                                     java.lang.Double r)
      • eq

        public java.lang.Boolean eq​(java.lang.Object l,
                                    java.lang.Object r)
                             throws EvaluationException
        Description copied from interface: FieldI
        Equals
        Specified by:
        eq in interface FieldI
        Parameters:
        l - left hand argument
        r - right hand argument
        Returns:
        an object representing the result or null if it can not be evaluated.
        Throws:
        EvaluationException - on error
      • ne

        public java.lang.Boolean ne​(java.lang.Object l,
                                    java.lang.Object r)
                             throws EvaluationException
        Description copied from interface: FieldI
        Not Equals
        Specified by:
        ne in interface FieldI
        Parameters:
        l - left hand argument
        r - right hand argument
        Returns:
        an object representing the result or null if it can not be evaluated.
        Throws:
        EvaluationException - on error
      • gt

        public java.lang.Boolean gt​(java.lang.Object l,
                                    java.lang.Object r)
                             throws EvaluationException
        Description copied from interface: FieldI
        Greater than
        Specified by:
        gt in interface FieldI
        Parameters:
        l - left hand argument
        r - right hand argument
        Returns:
        an object representing the result or null if it can not be evaluated.
        Throws:
        EvaluationException - on error
      • ge

        public java.lang.Boolean ge​(java.lang.Object l,
                                    java.lang.Object r)
                             throws EvaluationException
        Description copied from interface: FieldI
        Greater or equal to
        Specified by:
        ge in interface FieldI
        Parameters:
        l - left hand argument
        r - right hand argument
        Returns:
        an object representing the result or null if it can not be evaluated.
        Throws:
        EvaluationException - on error
      • lt

        public java.lang.Boolean lt​(java.lang.Object l,
                                    java.lang.Object r)
                             throws EvaluationException
        Description copied from interface: FieldI
        Less than
        Specified by:
        lt in interface FieldI
        Parameters:
        l - left hand argument
        r - right hand argument
        Returns:
        an object representing the result or null if it can not be evaluated.
        Throws:
        EvaluationException - on error
      • le

        public java.lang.Boolean le​(java.lang.Object l,
                                    java.lang.Object r)
                             throws EvaluationException
        Description copied from interface: FieldI
        Less than or equals to
        Specified by:
        le in interface FieldI
        Parameters:
        l - left hand argument
        r - right hand argument
        Returns:
        an object representing the result or null if it can not be evaluated.
        Throws:
        EvaluationException - on error
      • and

        public java.lang.Boolean and​(java.lang.Object l,
                                     java.lang.Object r)
                              throws EvaluationException
        Description copied from interface: FieldI
        Logical and.
        Specified by:
        and in interface FieldI
        Parameters:
        l - left hand argument implimentation
        r - right hand argument
        Returns:
        an object representing the result or null if it can not be evaluated.
        Throws:
        EvaluationException - on error
      • or

        public java.lang.Boolean or​(java.lang.Object l,
                                    java.lang.Object r)
                             throws EvaluationException
        Description copied from interface: FieldI
        Logical or.
        Specified by:
        or in interface FieldI
        Parameters:
        l - left hand argument
        r - right hand argument
        Returns:
        an object representing the result or null if it can not be evaluated.
        Throws:
        EvaluationException - on error
      • not

        public java.lang.Boolean not​(java.lang.Object l)
                              throws EvaluationException
        Description copied from interface: FieldI
        Logical not.
        Specified by:
        not in interface FieldI
        Parameters:
        l - argument
        Returns:
        an object representing the result or null if it can not be evaluated.
        Throws:
        EvaluationException - on error
      • getOne

        public java.lang.Object getOne()
        Description copied from interface: FieldI
        Get the multiplicative identity for this field.
        Specified by:
        getOne in interface FieldI
        Returns:
        object representing one or null if undefined for this field
      • getZero

        public java.lang.Object getZero()
        Description copied from interface: FieldI
        Get the additive identity for this field
        Specified by:
        getZero in interface FieldI
        Returns:
        object representing zero or null if undefined for this field
      • convertToInt

        public java.lang.Integer convertToInt​(java.lang.Object l)
        Description copied from interface: IntegerConvertor
        Attempt to convert argument to an integer
        Specified by:
        convertToInt in interface IntegerConvertor
        Parameters:
        l - value to convert
        Returns:
        corresponding integer or null if it cannot be converted
      • convertFromInt

        public java.lang.Object convertFromInt​(java.lang.Integer l)
                                        throws EvaluationException
        Description copied from interface: IntegerConvertor
        Attempt to convert argument from an integer
        Specified by:
        convertFromInt in interface IntegerConvertor
        Parameters:
        l - value to convert
        Returns:
        corresponding value in this field or null if it cannot be converted
        Throws:
        EvaluationException - probably never