public class Time
extends java.lang.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(java.lang.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
|
java.lang.String |
toString()
Creates a string representation of the time object.
|
java.lang.String |
toString(java.lang.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 java.lang.String toString()
toString in class java.lang.ObjecttoString(String)public java.lang.String toString(java.lang.String pFormatStr)
pFormatStr - the format wherejava.lang.NumberFormatExceptionTimeFormat.format(Time),
parseTime(String)public static Time parseTime(java.lang.String pStr)
java.lang.NumberFormatExceptionTimeFormat.parse(String),
toString(String)Copyright © 2018. All Rights Reserved.