com.clarkparsia.pellet.datatypes.types.floating
Class IEEEDoubleType

java.lang.Object
  extended by com.clarkparsia.pellet.datatypes.types.floating.IEEEDoubleType
All Implemented Interfaces:
FloatingPointType<java.lang.Double>

public class IEEEDoubleType
extends java.lang.Object
implements FloatingPointType<java.lang.Double>

Title: IEEE Double Type

Description: Implementation of FloatingPointType to support xsd:double

Copyright: Copyright (c) 2009

Company: Clark & Parsia, LLC.

Author:
Mike Smith

Method Summary
 java.lang.Double cast(java.lang.Object o)
          Casts an object to the class described by this FloatingPointType object.
 java.lang.Double decrement(java.lang.Double n)
          Return the next floating point value in the direction of -Inf.
static IEEEDoubleType getInstance()
           
 java.lang.Double getNaN()
          Gets the Not-a-Number constant for the type.
 java.lang.Double getNegativeInfinity()
          Gets the negative infinity constant for the type.
 java.lang.Double getPositiveInfinity()
          Gets the positive infinity constant for the type.
 java.lang.Double increment(java.lang.Double n)
          Return the next floating point value in the direction of +Inf.
 java.lang.Number intervalSize(java.lang.Double lower, java.lang.Double upper)
          Count the number of floating point values in an inclusive interval
 boolean isInstance(java.lang.Object o)
          Determine if the specified Object is assignment compatible with the object represented by this FloatingPointType.
 boolean isNaN(java.lang.Double f)
          Returns true if this floating point value is a Not-a-Number (NaN) value, false otherwise.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static IEEEDoubleType getInstance()

cast

public java.lang.Double cast(java.lang.Object o)
Description copied from interface: FloatingPointType
Casts an object to the class described by this FloatingPointType object.

Specified by:
cast in interface FloatingPointType<java.lang.Double>
Parameters:
o - the object to cast
Returns:
o in the appropriate type

decrement

public java.lang.Double decrement(java.lang.Double n)
Description copied from interface: FloatingPointType
Return the next floating point value in the direction of -Inf.

Specified by:
decrement in interface FloatingPointType<java.lang.Double>
Parameters:
n - The value to decrement
Returns:
If n > -Inf, the next floating point value in the direction of -Inf. If n == -Inf, -Inf.

getNaN

public java.lang.Double getNaN()
Description copied from interface: FloatingPointType
Gets the Not-a-Number constant for the type.

Specified by:
getNaN in interface FloatingPointType<java.lang.Double>
Returns:
T.NaN

getNegativeInfinity

public java.lang.Double getNegativeInfinity()
Description copied from interface: FloatingPointType
Gets the negative infinity constant for the type.

Specified by:
getNegativeInfinity in interface FloatingPointType<java.lang.Double>
Returns:
T.NEGATIVE_INFINITY

getPositiveInfinity

public java.lang.Double getPositiveInfinity()
Description copied from interface: FloatingPointType
Gets the positive infinity constant for the type.

Specified by:
getPositiveInfinity in interface FloatingPointType<java.lang.Double>
Returns:
T.POSITIVE_INFINITY

increment

public java.lang.Double increment(java.lang.Double n)
Description copied from interface: FloatingPointType
Return the next floating point value in the direction of +Inf.

Specified by:
increment in interface FloatingPointType<java.lang.Double>
Parameters:
n - The value to increment
Returns:
If n < +Inf, the next floating point value in the direction of +Inf. If n == +Inf, +Inf.

intervalSize

public java.lang.Number intervalSize(java.lang.Double lower,
                                     java.lang.Double upper)
Description copied from interface: FloatingPointType
Count the number of floating point values in an inclusive interval

Specified by:
intervalSize in interface FloatingPointType<java.lang.Double>
Parameters:
lower - The lower bound of the interval
upper - The upper bound of the interval
Returns:
If lower.equals(upper), 1. Else, the number of floating point values between lower and upper plus 2

isInstance

public boolean isInstance(java.lang.Object o)
Description copied from interface: FloatingPointType
Determine if the specified Object is assignment compatible with the object represented by this FloatingPointType. Typically implemented as a wrapper for T.class.isInstance(Object).

Specified by:
isInstance in interface FloatingPointType<java.lang.Double>
Parameters:
o - the object to check
Returns:
true if o is an instance of T, false else.

isNaN

public boolean isNaN(java.lang.Double f)
Description copied from interface: FloatingPointType
Returns true if this floating point value is a Not-a-Number (NaN) value, false otherwise.

Specified by:
isNaN in interface FloatingPointType<java.lang.Double>
Parameters:
f - the value to be tested
Returns:
true if the argument is NaN, else false


Copyright © 2004 Evren Sirin. All Rights Reserved.