|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.twelvemonkeys.util.Time
public class Time
Utility class for storing times in a simple way. The internal time is stored as an int, counting seconds.
| Field Summary | |
|---|---|
static int |
SECONDS_IN_MINUTE
|
| Constructor Summary | |
|---|---|
Time()
Creates a new time with 0 seconds, 0 minutes. |
|
Time(int pTime)
Creates a new time with the given time (in seconds). |
|
| Method Summary | |
|---|---|
int |
getMinutes()
Gets the minutes part of the time. |
int |
getSeconds()
Gets the seconds part of the time. |
int |
getTime()
Gets the full time in seconds. |
long |
getTimeInMillis()
Gets the full time in milliseconds, for use in creating dates or similar. |
static Time |
parseTime(String pStr)
Deprecated. |
void |
setMinutes(int pMinutes)
Sets the minutes part of the time. |
void |
setSeconds(int pSeconds)
Sets the seconds part of the time. |
void |
setTime(int pTime)
Sets the full time in seconds |
String |
toString()
Creates a string representation of the time object. |
String |
toString(String pFormatStr)
Deprecated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int SECONDS_IN_MINUTE
| Constructor Detail |
|---|
public Time()
public Time(int pTime)
| Method Detail |
|---|
public void setTime(int pTime)
public int getTime()
public long getTimeInMillis()
Date.setTime(long)public void setSeconds(int pSeconds)
pSeconds - an integer that should be between 0 and 59.public int getSeconds()
public void setMinutes(int pMinutes)
pMinutes - an integerpublic int getMinutes()
public String toString()
toString in class ObjecttoString(String)public String toString(String pFormatStr)
pFormatStr - the format where
NumberFormatExceptionTimeFormat.format(Time),
parseTime(String)public static Time parseTime(String pStr)
NumberFormatExceptionTimeFormat.parse(String),
toString(String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||