org.semanticweb.HermiT.datatypes.owlreal
Class Numbers

java.lang.Object
  extended by org.semanticweb.HermiT.datatypes.owlreal.Numbers

public class Numbers
extends Object


Nested Class Summary
static class Numbers.BoundaryDirection
           
 
Constructor Summary
Numbers()
           
 
Method Summary
static int compare(Number n1, Number n2)
           
static Number getNearestIntegerInBound(Number bound, Numbers.BoundaryDirection boundaryDirection, boolean boundIsInclusive)
           
protected static int getNumberType(Number n)
           
static boolean isValidNumber(Number n)
           
static Number nextInteger(Number integer)
           
static Number parseDecimal(String string)
          Parses the given string into a Java Number object representing an decimal.
static Number parseInteger(String string)
          Parses the given string into a Java Number object representing an integer.
static Number parseRational(String string)
          Parses the given string into a Java Number object representing a rational.
static int subtractIntegerIntervalSizeFrom(Number lowerBoundInclusive, Number upperBoundInclusive, int argument)
           
protected static BigDecimal toBigDecimal(Number n, int nType)
           
protected static BigInteger toBigInteger(Number n, int nType)
           
protected static BigRational toBigRational(Number n, int nType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Numbers

public Numbers()
Method Detail

isValidNumber

public static boolean isValidNumber(Number n)

parseInteger

public static Number parseInteger(String string)
                           throws NumberFormatException
Parses the given string into a Java Number object representing an integer. The Java object is chosen such that .equals() works correctly across all Number-derived objects.

Throws:
NumberFormatException

parseDecimal

public static Number parseDecimal(String string)
                           throws NumberFormatException
Parses the given string into a Java Number object representing an decimal. The Java object is chosen such that .equals() works correctly across all Number-derived objects.

Throws:
NumberFormatException

parseRational

public static Number parseRational(String string)
                            throws NumberFormatException
Parses the given string into a Java Number object representing a rational. The Java object is chosen such that .equals() works correctly across all Number-derived objects.

Throws:
NumberFormatException

compare

public static int compare(Number n1,
                          Number n2)

getNumberType

protected static int getNumberType(Number n)

toBigInteger

protected static BigInteger toBigInteger(Number n,
                                         int nType)

toBigDecimal

protected static BigDecimal toBigDecimal(Number n,
                                         int nType)

toBigRational

protected static BigRational toBigRational(Number n,
                                           int nType)

getNearestIntegerInBound

public static Number getNearestIntegerInBound(Number bound,
                                              Numbers.BoundaryDirection boundaryDirection,
                                              boolean boundIsInclusive)

subtractIntegerIntervalSizeFrom

public static int subtractIntegerIntervalSizeFrom(Number lowerBoundInclusive,
                                                  Number upperBoundInclusive,
                                                  int argument)

nextInteger

public static Number nextInteger(Number integer)


Copyright © 2012. All Rights Reserved.