public class Time extends Object
| Modifier and Type | Field | Description |
|---|---|---|
static int |
SECONDS_IN_MINUTE |
| Constructor | 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 | 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 © 2018. All rights reserved.