Package ai.dat.core.configuration.time
Class Time
java.lang.Object
ai.dat.core.configuration.time.Time
- All Implemented Interfaces:
Serializable
The definition of a time interval. Similar to a simpler version of
Duration.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic Timedays(long days) Creates a newTimethat represents the given number of days.booleanstatic TimefromDuration(Duration duration) Creates a newTimethat represents the number of milliseconds in the given duration.inthashCode()static Timehours(long hours) Creates a newTimethat represents the given number of hours.static Timemilliseconds(long milliseconds) Creates a newTimethat represents the given number of milliseconds.static Timeminutes(long minutes) Creates a newTimethat represents the given number of minutes.static Timestatic Timeseconds(long seconds) Creates a newTimethat represents the given number of seconds.longConverts the time interval to milliseconds.toString()
-
Method Details
-
toMilliseconds
public long toMilliseconds()Converts the time interval to milliseconds.- Returns:
- The time interval in milliseconds.
-
toString
-
equals
-
hashCode
public int hashCode() -
of
- Parameters:
size- The duration of time.unit- The unit of time of the duration, for exampleTimeUnit.SECONDS.- Returns:
- The time policy.
-
milliseconds
Creates a newTimethat represents the given number of milliseconds. -
seconds
Creates a newTimethat represents the given number of seconds. -
minutes
Creates a newTimethat represents the given number of minutes. -
hours
Creates a newTimethat represents the given number of hours. -
days
Creates a newTimethat represents the given number of days. -
fromDuration
Creates a newTimethat represents the number of milliseconds in the given duration.
-