|
||||||||||
| 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.SampleFixPoint
public final class SampleFixPoint
Fix point numeric to represent SampleFixPoint.
Permitted values range from -100.50 to 999.99. It the number of decimal digits supported is 2 and the total number of digits is 5
Instances of this class are immutable.
| Field Summary | |
|---|---|
static SampleFixPoint |
CONSTANT_VALUE
Additional Constant defined in the XML document. |
static long |
DECIMAL_SCALE
The scale (100). |
static int |
FRACTION_DIGITS
The number of fraction digits (2). |
static Integer |
FRACTION_DIGITS_AS_INTEGER
The number of fraction digits as integer (2). |
static SampleFixPoint |
MAX_VALUE
The maximal value of SampleFixPoint (999.99). |
static long |
MAX_VALUE_SCALED
The maximal scaled value of SampleFixPoint (999L). |
static long |
MAX_VALUE_UNSCALED
The maximal value of SampleFixPoint (99999L). |
static SampleFixPoint |
MIN_VALUE
The minimal value of SampleFixPoint (-100.50). |
static long |
MIN_VALUE_SCALED
The minimal scaled value of SampleFixPoint (-100L). |
static long |
MIN_VALUE_UNSCALED
The minimal unscaled value of SampleFixPoint (-10050L). |
static String |
PREFERED_DATABASE_TYPE
The preffered database representation of this type. |
static int |
SCALE
The number of fraction digits (2). |
static int |
TOTAL_DIGITS
The maximum number of digits (5). |
static Integer |
TOTAL_DIGITS_AS_INTEGER
The maximum number of digits as Integer (5). |
static String |
TYPE_NAME
SampleFixPoint - the name of this type as String constant. |
static SampleFixPoint |
ZERO
The ZERO instance. |
| Method Summary | |
|---|---|
int |
compareTo(Object o)
|
double |
doubleValue()
|
boolean |
equals(Object obj)
|
float |
floatValue()
|
static SampleFixPoint |
fromString(String str)
Creates a SampleFixPoint object from the String representation. |
int |
hashCode()
|
int |
intValue()
|
long |
longValue()
|
BigDecimal |
toBigDecimal()
Returns the BigDecimal representation of this SampleFixPoint. |
String |
toString()
Returns the String representation of this SampleFixPoint. |
long |
unscaledLongValue()
Returns the unscaled long value of this SampleFixPoint. |
static SampleFixPoint |
valueOf(BigDecimal bd)
Translates a BigDecimal value into a SampleFixPoint. |
static SampleFixPoint |
valueOf(long val)
Translates a long value into a SampleFixPoint. |
static SampleFixPoint |
valueOf(long unscaledVal,
int scale)
Translates a long with the given scale into a SampleFixPoint. |
| 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 SampleFixPoint MIN_VALUE
public static final SampleFixPoint MAX_VALUE
public static final SampleFixPoint ZERO
public static final SampleFixPoint CONSTANT_VALUE
| Method Detail |
|---|
public static SampleFixPoint fromString(String str)
throws ArgumentMalformedException
str - The str representation of the SampleFixPoint
to be returned.
ArgumentMalformedException - If the given
String violates the restriction
of the SampleFixPoint type.public static SampleFixPoint valueOf(BigDecimal bd)
bd - the BigDecimal.
ArgumentMalformedException - If the given
BigDecimal violates the restriction
of the SampleFixPoint type.public static SampleFixPoint valueOf(long val)
val - the long.
ArgumentMalformedException - If the given
long violates the restriction
of the SampleFixPoint type.BigDecimal.valueOf(long)
public static SampleFixPoint 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 SampleFixPoint 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 | |||||||||