Class IEEEDoubleType
- java.lang.Object
-
- openllet.core.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 supportxsd:double
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.Double
cast(java.lang.Object o)
Casts an object to the class described by thisFloatingPointType
object.java.lang.Double
decrement(java.lang.Double n)
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)
java.lang.Number
intervalSize(java.lang.Double lower, java.lang.Double 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.Double f)
Returnstrue
if this floating point value is a Not-a-Number (NaN) value,false
otherwise.
-
-
-
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 thisFloatingPointType
object.- Specified by:
cast
in interfaceFloatingPointType<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)
- Specified by:
decrement
in interfaceFloatingPointType<java.lang.Double>
- 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.Double getNaN()
Description copied from interface:FloatingPointType
Gets the Not-a-Number constant for the type.- Specified by:
getNaN
in interfaceFloatingPointType<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 interfaceFloatingPointType<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 interfaceFloatingPointType<java.lang.Double>
- Returns:
T.POSITIVE_INFINITY
-
increment
public java.lang.Double increment(java.lang.Double n)
- Specified by:
increment
in interfaceFloatingPointType<java.lang.Double>
- 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.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 interfaceFloatingPointType<java.lang.Double>
- 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.Double>
- Parameters:
o
- the object to check- Returns:
true
ifo
is an instance ofT
,false
else.
-
isNaN
public boolean isNaN(java.lang.Double 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.Double>
- Parameters:
f
- the value to be tested- Returns:
true
if the argument is NaN, elsefalse
-
-