|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Number
org.jcoderz.commons.types.samples.TestFixPoint
public final class TestFixPoint
Fix point numeric to represent TestFixPoint.
Permitted values range from -9999999.999 to 9999999.999. It the number of decimal digits supported is 3 and the total number of digits is 10
Instances of this class are immutable.
| Field Summary | |
|---|---|
static long |
DECIMAL_SCALE
The scale (1000). |
static int |
FRACTION_DIGITS
The number of fraction digits (3). |
static Integer |
FRACTION_DIGITS_AS_INTEGER
The number of fraction digits as integer (3). |
static TestFixPoint |
MAX_VALUE
The maximal value of TestFixPoint (9999999.999). |
static long |
MAX_VALUE_SCALED
The maximal scaled value of TestFixPoint (9999999L). |
static long |
MAX_VALUE_UNSCALED
The maximal value of TestFixPoint (9999999999L). |
static TestFixPoint |
MIN_VALUE
The minimal value of TestFixPoint (-9999999.999). |
static long |
MIN_VALUE_SCALED
The minimal scaled value of TestFixPoint (-9999999L). |
static long |
MIN_VALUE_UNSCALED
The minimal unscaled value of TestFixPoint (-9999999999L). |
static String |
PREFERED_DATABASE_TYPE
The preffered database representation of this type. |
static int |
SCALE
The number of fraction digits (3). |
static int |
TOTAL_DIGITS
The maximum number of digits (10). |
static Integer |
TOTAL_DIGITS_AS_INTEGER
The maximum number of digits as Integer (10). |
static String |
TYPE_NAME
TestFixPoint - the name of this type as String constant. |
| Method Summary | |
|---|---|
int |
compareTo(Object o)
|
double |
doubleValue()
|
boolean |
equals(Object obj)
|
float |
floatValue()
|
static TestFixPoint |
fromString(String str)
Creates a TestFixPoint object from the String representation. |
int |
hashCode()
|
int |
intValue()
|
long |
longValue()
|
BigDecimal |
toBigDecimal()
Returns the BigDecimal representation of this TestFixPoint. |
String |
toString()
Returns the String representation of this TestFixPoint. |
long |
unscaledLongValue()
Returns the unscaled long value of this TestFixPoint. |
static TestFixPoint |
valueOf(BigDecimal bd)
Translates a BigDecimal value into a TestFixPoint. |
static TestFixPoint |
valueOf(long val)
Translates a long value into a TestFixPoint. |
static TestFixPoint |
valueOf(long unscaledVal,
int scale)
Translates a long with the given scale into a TestFixPoint. |
| Methods inherited from class java.lang.Number |
|---|
byteValue, shortValue |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String TYPE_NAME
public static final String PREFERED_DATABASE_TYPE
public static final long MIN_VALUE_UNSCALED
public static final long MAX_VALUE_UNSCALED
public static final int FRACTION_DIGITS
public static final int SCALE
public static final long DECIMAL_SCALE
public static final long MIN_VALUE_SCALED
public static final long MAX_VALUE_SCALED
public static final Integer FRACTION_DIGITS_AS_INTEGER
public static final int TOTAL_DIGITS
public static final Integer TOTAL_DIGITS_AS_INTEGER
public static final TestFixPoint MIN_VALUE
public static final TestFixPoint MAX_VALUE
| Method Detail |
|---|
public static TestFixPoint fromString(String str)
throws ArgumentMalformedException
str - The str representation of the TestFixPoint
to be returned.
ArgumentMalformedException - If the given
String violates the restriction
of the TestFixPoint type.public static TestFixPoint valueOf(BigDecimal bd)
bd - the BigDecimal.
ArgumentMalformedException - If the given
BigDecimal violates the restriction
of the TestFixPoint type.public static TestFixPoint valueOf(long val)
val - the long.
ArgumentMalformedException - If the given
long violates the restriction
of the TestFixPoint type.BigDecimal.valueOf(long)
public static TestFixPoint valueOf(long unscaledVal,
int scale)
unscaledVal - the unscaled value.scale - the scale to be applied.
ArgumentMalformedException - If the given
long and scale violates the restriction
of the TestFixPoint type.BigDecimal.valueOf(long, int)public long unscaledLongValue()
unscaledLongValue in interface FixPointNumberpublic String toString()
toString in class ObjectBigDecimal.toString()public BigDecimal toBigDecimal()
toBigDecimal in interface FixPointNumberpublic boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic double doubleValue()
doubleValue in class Numberpublic float floatValue()
floatValue in class Numberpublic int intValue()
intValue in class Numberpublic long longValue()
longValue in class Numberpublic int compareTo(Object o)
compareTo in interface Comparable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||