public class Time extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
SECONDS_IN_MINUTE |
| Constructor and Description |
|---|
Time()
Creates a new time with 0 seconds, 0 minutes.
|
Time(int pTime)
Creates a new time with the given time (in seconds).
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
public static final int SECONDS_IN_MINUTE
public Time()
public Time(int pTime)
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 whereNumberFormatExceptionTimeFormat.format(Time),
parseTime(String)public static Time parseTime(String pStr)
NumberFormatExceptionTimeFormat.parse(String),
toString(String)Copyright © 2015. All Rights Reserved.