com.clarkparsia.pellet.datatypes
Class IEEEFloatType

java.lang.Object
  extended by com.clarkparsia.pellet.datatypes.IEEEFloatType
All Implemented Interfaces:
FloatingPointType<java.lang.Float>

public class IEEEFloatType
extends java.lang.Object
implements FloatingPointType<java.lang.Float>

Title: IEEE Float Type

Description: Implementation of FloatingPointType to support xsd:float

Copyright: Copyright (c) 2009

Company: Clark & Parsia, LLC.

Author:
Mike Smith

Method Summary
 java.lang.Float cast(java.lang.Object o)
          Casts an object to the class described by this FloatingPointType object.
 java.lang.Float decrement(java.lang.Float n)
          Return the next floating point value in the direction of -Inf.
static IEEEFloatType getInstance()
           
 java.lang.Float getNaN()
          Gets the Not-a-Number constant for the type.
 java.lang.Float getNegativeInfinity()
          Gets the negative infinity constant for the type.
 java.lang.Float getPositiveInfinity()
          Gets the positive infinity constant for the type.
 java.lang.Float increment(java.lang.Float n)
          Return the next floating point value in the direction of +Inf.
 java.lang.Number intervalSize(java.lang.Float lower, java.lang.Float 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.Float 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 IEEEFloatType getInstance()

cast

public java.lang.Float 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.Float>
Parameters:
o - the object to cast
Returns:
o in the appropriate type

decrement

public java.lang.Float decrement(java.lang.Float 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.Float>
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.Float getNaN()
Description copied from interface: FloatingPointType
Gets the Not-a-Number constant for the type.

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

getNegativeInfinity

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

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

getPositiveInfinity

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

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

increment

public java.lang.Float increment(java.lang.Float 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.Float>
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.Float lower,
                                     java.lang.Float 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.Float>
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.Float>
Parameters:
o - the object to check
Returns:
true if o is an instance of T, false else.

isNaN

public boolean isNaN(java.lang.Float 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.Float>
Parameters:
f - the value to be tested
Returns:
true if the argument is NaN, else false


Copyright © 2004 Evren Sirin. All Rights Reserved.