|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pivot.util.Time
public final class Time
Class representing a time of day, independent of any particular time zone.
Nested Class Summary | |
---|---|
static class |
Time.Range
Represents a range of times. |
Field Summary | |
---|---|
int |
hour
The hour value, in 24-hour format. |
int |
millisecond
The millisecond value. |
static int |
MILLISECONDS_PER_DAY
|
static int |
MILLISECONDS_PER_HOUR
|
static int |
MILLISECONDS_PER_MINUTE
|
static int |
MILLISECONDS_PER_SECOND
|
int |
minute
The minute value. |
int |
second
The second value. |
Constructor Summary | |
---|---|
Time()
|
|
Time(Calendar calendar)
|
|
Time(int milliseconds)
|
|
Time(int hour,
int minute,
int second)
|
|
Time(int hour,
int minute,
int second,
int millisecond)
|
Method Summary | |
---|---|
Time |
add(int milliseconds)
Adds the specified milliseconds of days to this time and returns the resulting time. |
int |
compareTo(Time time)
|
static Time |
decode(String value)
Creates a new time representing the specified time string. |
boolean |
equals(Object o)
|
int |
hashCode()
|
int |
subtract(Time time)
Gets the number of milliseconds in between this time and the specified time. |
int |
toMilliseconds()
Returns the number of milliseconds since midnight represented by this time. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final int hour
public final int minute
public final int second
public final int millisecond
public static final int MILLISECONDS_PER_SECOND
public static final int MILLISECONDS_PER_MINUTE
public static final int MILLISECONDS_PER_HOUR
public static final int MILLISECONDS_PER_DAY
Constructor Detail |
---|
public Time()
public Time(Calendar calendar)
public Time(int hour, int minute, int second)
public Time(int hour, int minute, int second, int millisecond)
public Time(int milliseconds)
Method Detail |
---|
public Time add(int milliseconds)
milliseconds
- The number of milliseconds to add to this time.
public int subtract(Time time)
time
- The time to subtract from this time.
public int toMilliseconds()
public int compareTo(Time time)
compareTo
in interface Comparable<Time>
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public static Time decode(String value)
value
- A string in the form of [hh]:[mm]:[ss] or
[hh]:[mm]:[ss].[nnn] (e.g. 17:19:20 or 17:19:20.412).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |