|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jimmc.util.Duration
A Duration is an elapsed time measured in seconds.
Field Summary | |
protected java.math.BigDecimal |
duration
Our value. |
protected int |
fractionPrecision
The number of fractional digits to display. |
Constructor Summary | |
Duration(double duration)
Create a Duration from a double. |
|
Duration(int duration)
Create a Duration from an int. |
|
Duration(java.lang.Number num)
Create a Duration from any kind of Number. |
Method Summary | |
float |
floatValue()
Get the value of this duration as a float. |
double |
fractionalValue()
Get the fractional part of our duration. |
int |
getFractionPrecision()
Get the number of fractional digits to display. |
int |
intValue()
Get the value of this duration as an int. |
static double |
parseDoubleDuration(java.lang.String s)
Parse a string into a double-valued duration. |
protected static double |
parseFraction(java.lang.String s)
Parse a fractional number. |
static int |
parseIntDuration(java.lang.String s)
Parse a string into an integer-valued duration. |
void |
setFractionPrecision(int digits)
Set the number of fractional digits to display. |
java.lang.String |
toString()
Convert to a string. |
static java.lang.String |
toString(int seconds)
Convert seconds to a Duration string. |
protected static void |
toString(java.lang.StringBuffer sb,
int seconds)
Convert seconds to string in a buffer. |
static Duration |
valueOf(java.lang.String s)
Return a new Duration initialized to the value of the specified String. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.math.BigDecimal duration
protected int fractionPrecision
Constructor Detail |
public Duration(int duration)
public Duration(double duration)
public Duration(java.lang.Number num)
Method Detail |
public void setFractionPrecision(int digits)
public int getFractionPrecision()
public int intValue()
public float floatValue()
public double fractionalValue()
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String toString(int seconds)
protected static void toString(java.lang.StringBuffer sb, int seconds)
public static int parseIntDuration(java.lang.String s)
public static double parseDoubleDuration(java.lang.String s)
protected static double parseFraction(java.lang.String s)
s
- The fractional part, starting with the digit just after
the decimal point. Digits only.public static Duration valueOf(java.lang.String s)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |