|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tapestry5.ioc.util.TimeInterval
public class TimeInterval
Used to represent a period of time, specifically as a configuration value. This is often used to specify timeouts.
TimePeriods are parsed from strings.
The string specifys a number of terms. The values of all the terms are summed together to form the total time period. Each term consists of a number followed by a unit. Units (from largest to smallest) are:
Example: "2 h 30 m". By convention, terms are specified largest to smallest. A term without a unit is assumed to be milliseconds. Units are case insensitive ("h" or "H" are treated the same).
Constructor Summary | |
---|---|
TimeInterval(long milliseconds)
|
|
TimeInterval(String input)
Creates a TimeInterval for a string. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
long |
milliseconds()
|
long |
seconds()
|
String |
toDescription()
Converts the milliseconds back into a string (compatible with TimeInterval(String) ). |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TimeInterval(String input)
input
- the string specifying the amount of time in the periodpublic TimeInterval(long milliseconds)
Method Detail |
---|
public long milliseconds()
public long seconds()
public String toDescription()
TimeInterval(String)
).
public String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |