Package openllet.core.datatypes
Class IEEEFloatType
- java.lang.Object
-
- openllet.core.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 supportxsd:float
Copyright: Copyright (c) 2009
Company: Clark & Parsia, LLC.
- Author:
- Mike Smith
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Float
cast(java.lang.Object o)
Casts an object to the class described by thisFloatingPointType
object.java.lang.Float
decrement(java.lang.Float n)
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)
java.lang.Number
intervalSize(java.lang.Float lower, java.lang.Float upper)
Count the number of floating point values in an inclusive intervalboolean
isInstance(java.lang.Object o)
Determine if the specifiedObject
is assignment compatible with the object represented by thisFloatingPointType
.boolean
isNaN(java.lang.Float f)
Returnstrue
if this floating point value is a Not-a-Number (NaN) value,false
otherwise.
-
-
-
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 thisFloatingPointType
object.- Specified by:
cast
in interfaceFloatingPointType<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)
- Specified by:
decrement
in interfaceFloatingPointType<java.lang.Float>
- Parameters:
n
- The value to decrement Return the next floating point value in the direction of-Inf
.
- 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 interfaceFloatingPointType<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 interfaceFloatingPointType<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 interfaceFloatingPointType<java.lang.Float>
- Returns:
T.POSITIVE_INFINITY
-
increment
public java.lang.Float increment(java.lang.Float n)
- Specified by:
increment
in interfaceFloatingPointType<java.lang.Float>
- Parameters:
n
- The value to increment Return the next floating point value in the direction of+Inf
.
- 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 interfaceFloatingPointType<java.lang.Float>
- Parameters:
lower
- The lower bound of the intervalupper
- The upper bound of the interval- Returns:
- If
lower.equals(upper)
,1
. Else, the number of floating point values betweenlower
andupper
plus2
-
isInstance
public boolean isInstance(java.lang.Object o)
Description copied from interface:FloatingPointType
Determine if the specifiedObject
is assignment compatible with the object represented by thisFloatingPointType
. Typically implemented as a wrapper forT.class.isInstance(Object)
.- Specified by:
isInstance
in interfaceFloatingPointType<java.lang.Float>
- Parameters:
o
- the object to check- Returns:
true
ifo
is an instance ofT
,false
else.
-
isNaN
public boolean isNaN(java.lang.Float f)
Description copied from interface:FloatingPointType
Returnstrue
if this floating point value is a Not-a-Number (NaN) value,false
otherwise.- Specified by:
isNaN
in interfaceFloatingPointType<java.lang.Float>
- Parameters:
f
- the value to be tested- Returns:
true
if the argument is NaN, elsefalse
-
-