Class TimeInterval
-
- org.apache.tapestry5.commons.util.TimeInterval
-
public class TimeInterval extends
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:- y
- year
- d
- day
- h
- hour
- m
- minute
- s
- second
- ms
- millisecond
-
-
Constructor Summary
Constructors Constructor Description TimeInterval(long milliseconds)
input)
Creates a TimeInterval for a string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
obj)
long
milliseconds()
long
seconds()
toDescription()
Converts the milliseconds back into a string (compatible withTimeInterval(String)
).toString()
-
-
-
Constructor Detail
-
TimeInterval
public input)
Creates a TimeInterval for a string.- Parameters:
input
- the string specifying the amount of time in the period
-
TimeInterval
public TimeInterval(long milliseconds)
-
-
Method Detail
-
milliseconds
public long milliseconds()
-
seconds
public long seconds()
-
toDescription
public toDescription()
Converts the milliseconds back into a string (compatible withTimeInterval(String)
).- Since:
- 5.2.0
-
toString
public toString()
- Overrides:
in class
-
equals
public boolean obj)
- Overrides:
in class
-
-