|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bramosystems.oss.player.core.client.PlayTime
public final class PlayTime
Utility class with methods to manipulate playback time.
Constructor Summary | |
---|---|
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(java.lang.String time)
Creates a PlayTime object set to the specified time. |
Method Summary | |
---|---|
PlayTime |
add(int milliseconds)
Adds millseconds to the current play time |
int |
compareTo(PlayTime o)
|
boolean |
equals(java.lang.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 |
java.lang.String |
toString()
Returns the string representation of this object in full-format |
java.lang.String |
toString(boolean fullFormat)
Returns the string representation of this object |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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(java.lang.String time)
time
should be in the format hour:min:sec.fract
. hour
and fract
may be omitted unless required.
time
- the timeMethod Detail |
---|
public PlayTime add(int milliseconds)
millseconds
to the current play time
milliseconds
- the milliseconds to add
public PlayTime reduce(int milliseconds)
millseconds
milliseconds
- the milliseconds to reduce
public 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 java.lang.String toString()
toString
in class java.lang.Object
toString(boolean)
public java.lang.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
otherwise
public int compareTo(PlayTime o)
compareTo
in interface java.lang.Comparable<PlayTime>
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |