public final class PlayTime extends Object implements Comparable<PlayTime>
Constructor and Description |
---|
PlayTime()
Creates a PlayTime object
|
PlayTime(double milliseconds)
Creates a PlayTime object set to the specified milliseconds
|
PlayTime(int hour,
int minute,
int second,
int fract)
Creates a PlayTime object set to the specified time
|
PlayTime(String time)
Creates a PlayTime object set to the specified time.
|
Modifier and Type | Method and Description |
---|---|
PlayTime |
add(int milliseconds)
Adds
millseconds to the current play time |
int |
compareTo(PlayTime o) |
boolean |
equals(Object obj) |
int |
getFract()
Returns the hundredths of a second represented by this PlayTime object
|
int |
getHour()
Returns the hour represented by this PlayTime object
|
int |
getMinute()
Returns the minute represented by this PlayTime object
|
int |
getSecond()
Returns the seconds represented by this PlayTime object
|
double |
getTime()
Returns the current PlayTime in milliseconds
|
int |
hashCode() |
PlayTime |
reduce(int milliseconds)
Reduces the current play time by
millseconds |
void |
setFract(int fract)
Sets the hundredths of a second of this PlayTime object
|
void |
setHour(int hour)
Sets the hour of this PlayTime object
|
void |
setMinute(int minute)
Sets the minute of this PlayTime object
|
void |
setSecond(int second)
Sets the seconds of this PlayTime object
|
String |
toString()
Returns the string representation of this object in full-format
|
String |
toString(boolean fullFormat)
Returns the string representation of this object
|
public PlayTime()
public PlayTime(int hour, int minute, int second, int fract)
hour
- the hourminute
- the minutesecond
- the secondsfract
- the hundredths of a secondpublic PlayTime(double milliseconds)
milliseconds
- time in millisecondspublic PlayTime(String time)
time
should be in the format hour:min:sec.fract
. hour
and fract
may be omitted unless required.
time
- the timepublic PlayTime add(int milliseconds)
millseconds
to the current play timemilliseconds
- the milliseconds to addpublic PlayTime reduce(int milliseconds)
millseconds
milliseconds
- the milliseconds to reducepublic double getTime()
public int getHour()
public void setHour(int hour)
hour
- the hourpublic int getMinute()
public void setMinute(int minute)
minute
- the minutepublic int getSecond()
public void setSecond(int second)
second
- the secondspublic int getFract()
public void setFract(int fract)
fract
- the hundredths of a secondpublic String toString()
toString
in class Object
toString(boolean)
public String toString(boolean fullFormat)
The string representation is either in its full format (i.e. 00:00:00.000
) or in the
short form. The short form excludes the hour (if hour is less than 1) and hundredths parts.
fullFormat
- true
to represent this object in the full format, false
otherwisepublic int compareTo(PlayTime o)
compareTo
in interface Comparable<PlayTime>
Copyright © 2009-2013. All Rights Reserved.