public class Numbers extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Numbers.BoundaryDirection |
| Constructor and Description |
|---|
Numbers() |
| Modifier and Type | Method and Description |
|---|---|
static int |
compare(Number n1,
Number n2) |
static Number |
getNearestIntegerInBound(Number bound,
Numbers.BoundaryDirection boundaryDirection,
boolean boundIsInclusive) |
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) |
public static boolean isValidNumber(Number n)
public static Number parseInteger(String string) throws NumberFormatException
string - stringNumberFormatException - if number is malformedpublic static Number parseDecimal(String string) throws NumberFormatException
string - stringNumberFormatException - if number is malformedpublic static Number parseRational(String string) throws NumberFormatException
string - stringNumberFormatException - if number is malformedpublic static Number getNearestIntegerInBound(Number bound, Numbers.BoundaryDirection boundaryDirection, boolean boundIsInclusive)
public static int subtractIntegerIntervalSizeFrom(Number lowerBoundInclusive, Number upperBoundInclusive, int argument)
Copyright © 2018. All rights reserved.