public class FullTime
extends java.lang.Object
| Constructor and Description |
|---|
FullTime(double fullHour)
Class constructor, given the time in decimal hours
|
FullTime(FullTime time)
Class copy constructor
|
FullTime(int hour,
int min,
double sec)
Class constructor, given the hour, the minute and the seconds
|
FullTime(java.lang.String time,
java.lang.String unitDelimiter)
Class constructor, given a string representation of the time.
|
| Modifier and Type | Method and Description |
|---|---|
int |
addHours(int hours)
Advances the time by a specific amount of hours and informs whether it has completed the 24 hours.
|
int |
addMinutes(int min)
Advances the time by a specific amount of minutes and informs whether it has completed the 24 hours.
|
int |
addSeconds(double sec)
Advances the time by a specific amount of seconds and informs whether it has completed the 24 hours.
|
FullTime |
clone()
Returns a copy of this object
|
int |
CompareTimes(FullTime t)
Compares this time object to another query time object (supposed they are on the same day).
|
double |
ConvertToSeconds()
Returns the total amount of seconds
|
int |
roundToMinutes()
Rounds the FullTime to the closest minute (zero seconds).
|
int |
subtractHours(int hours)
Recedes the time by a specific amount of hours and informs whether it has gone smaller than 0 hours.
|
int |
subtractMinutes(int min)
Recedes the time by a specific amount of minutes and informs whether it has gone smaller than 0 hours.
|
int |
subtractSeconds(double sec)
Recedes the time by a specific amount of seconds and informs whether it has gone smaller than 0 hours.
|
int |
timeDifference(FullTime t)
Returns the difference of this time object to another query time object in milliseconds (may be positive or negative)
|
java.lang.String |
toString()
Returns a string representation of this object, in HH:MM:SS.SSS format (24h display)
|
java.lang.String |
toString12()
Returns a string representation of this object, in HH:MM:SS {AM/PM} format (12h display)
|
java.lang.String |
toStringCompact()
Returns a string representation of this object, omitting the seconds
|
java.lang.String |
toStringCompactPlain()
Returns a string representation of this object, in HHMM format.
|
java.lang.String |
toStringPlain()
Returns a string representation of this object, in HHMMSS format.
|
public FullTime(int hour,
int min,
double sec)
throws java.lang.IllegalArgumentException
hour - min - sec - java.lang.IllegalArgumentException - in case the combination provided is not a valid timepublic FullTime(double fullHour)
throws java.lang.IllegalArgumentException
fullHour - java.lang.IllegalArgumentException - in case the time provided is not a valid timepublic FullTime(FullTime time)
time - public FullTime(java.lang.String time,
java.lang.String unitDelimiter)
throws java.lang.IllegalArgumentException,
java.lang.NumberFormatException
time - the string representation of the time. Acceptable formats are HH%MM%SS.SS.... or HH%MM, where % is a delimiter character. In special cases, these also may be followed by a blank space and the "AM" or "PM" identifier.unitDelimiter - the delimiter characterjava.lang.IllegalArgumentException - in case the combination provided is not a valid timejava.lang.NumberFormatException - in case one of the numerical values cannot be parsedpublic FullTime clone()
clone in class java.lang.Objectpublic int addSeconds(double sec)
sec - the amount of secondspublic int addMinutes(int min)
min - the amount of minutespublic int addHours(int hours)
min - the amount of hourspublic int subtractSeconds(double sec)
sec - the amount of secondspublic int subtractMinutes(int min)
sec - the amount of minutespublic int subtractHours(int hours)
sec - the amount of hourspublic int timeDifference(FullTime t)
t - the query objectpublic double ConvertToSeconds()
public int CompareTimes(FullTime t)
t - the query objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString12()
public java.lang.String toStringCompact()
public java.lang.String toStringPlain()
public java.lang.String toStringCompactPlain()
public int roundToMinutes()