public class TimeInterval extends Object
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 and Description |
---|
TimeInterval(long milliseconds) |
TimeInterval(String input)
Creates a TimeInterval for a string.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
long |
milliseconds() |
long |
seconds() |
String |
toDescription()
Converts the milliseconds back into a string (compatible with
TimeInterval(String) ). |
String |
toString() |
public TimeInterval(String input)
input
- the string specifying the amount of time in the periodpublic TimeInterval(long milliseconds)
public long milliseconds()
public long seconds()
public String toDescription()
TimeInterval(String)
).${project.version} - Copyright © 2003-2014 The Apache Software Foundation.