• Prev Type
  • Next Type

io.sarl.lang.core.scoping.extensions.time
Class TimeExtensions
@com.google.common.annotations.GwtCompatible
final class TimeExtensions
extends java.lang.Object
Static methods to convert different time units to milliseconds.
Maven Group Identifier:
io.sarl.lang
Maven Artifact Identifier:
core
Field Summary
Modifier and type Field and description
public static val long MILLIS_IN_DAY
Number of millis in a day.
public static val long MILLIS_IN_HOUR
Number of millis in an hour.
public static val double MILLIS_IN_MICROSECOND
Number of millis in a microsecond.
public static val long MILLIS_IN_MINUTE
Number of millis in a minute.
public static val double MILLIS_IN_NANOSECOND
Number of millis in a nanosecond.
public static val long MILLIS_IN_SECOND
Number of millis in a second.
public static val long MILLIS_IN_WEEK
Number of millis in a week.
Action Summary
Modifier and type Action and description
static double convertFromTo(double,TimeUnit,TimeUnit)
Convert the gien amount of time in the given source unit, to the given target unit.
static long days(byte)
Convert days to milliseconds.
static long days(short)
Convert days to milliseconds.
static long days(int)
Convert days to milliseconds.
static long days(long)
Convert days to milliseconds.
static long days(float)
Convert days to milliseconds.
static long days(double)
Convert days to milliseconds.
static long days(Number)
Convert days to milliseconds.
static long hours(byte)
Convert hours to milliseconds.
static long hours(short)
Convert hours to milliseconds.
static long hours(int)
Convert hours to milliseconds.
static long hours(long)
Convert hours to milliseconds.
static long hours(float)
Convert hours to milliseconds.
static long hours(double)
Convert hours to milliseconds.
static long hours(Number)
Convert hours to milliseconds.
static long milliseconds(byte)
Convert milliseconds to milliseconds.
static long milliseconds(short)
Convert milliseconds to milliseconds.
static long milliseconds(int)
Convert milliseconds to milliseconds.
static long milliseconds(long)
Convert milliseconds to milliseconds.
static long milliseconds(float)
Convert milliseconds to milliseconds.
static long milliseconds(double)
Convert milliseconds to milliseconds.
static long milliseconds(Number)
Convert milliseconds to milliseconds.
static long minutes(byte)
Convert minutes to milliseconds.
static long minutes(short)
Convert minutes to milliseconds.
static long minutes(int)
Convert minutes to milliseconds.
static long minutes(long)
Convert minutes to milliseconds.
static long minutes(float)
Convert minutes to milliseconds.
static long minutes(double)
Convert minutes to milliseconds.
static long minutes(Number)
Convert minutes to milliseconds.
static long seconds(byte)
Convert seconds to milliseconds.
static long seconds(short)
Convert seconds to milliseconds.
static long seconds(int)
Convert seconds to milliseconds.
static long seconds(long)
Convert seconds to milliseconds.
static long seconds(float)
Convert seconds to milliseconds.
static long seconds(double)
Convert seconds to milliseconds.
static long seconds(Number)
Convert seconds to milliseconds.
static long weeks(byte)
Convert weeks to milliseconds.
static long weeks(short)
Convert weeks to milliseconds.
static long weeks(int)
Convert weeks to milliseconds.
static long weeks(long)
Convert weeks to milliseconds.
static long weeks(float)
Convert weeks to milliseconds.
static long weeks(double)
Convert weeks to milliseconds.
static long weeks(Number)
Convert weeks to milliseconds.
Field Details
MILLIS_IN_DAY
public static val MILLIS_IN_DAY : long = 86400000
Number of millis in a day.
MILLIS_IN_HOUR
public static val MILLIS_IN_HOUR : long = 3600000
Number of millis in an hour.
MILLIS_IN_MICROSECOND
public static val MILLIS_IN_MICROSECOND : double = 1.0E-5
Number of millis in a microsecond.
MILLIS_IN_MINUTE
public static val MILLIS_IN_MINUTE : long = 60000
Number of millis in a minute.
MILLIS_IN_NANOSECOND
public static val MILLIS_IN_NANOSECOND : double = 1.0E-8
Number of millis in a nanosecond.
MILLIS_IN_SECOND
public static val MILLIS_IN_SECOND : long = 1000
Number of millis in a second.
MILLIS_IN_WEEK
public static val MILLIS_IN_WEEK : long = 604800000
Number of millis in a week.
Action Details
convertFromTo(double,TimeUnit,TimeUnit)
def convertFromTo(double,TimeUnit,TimeUnit) : double
Convert the gien amount of time in the given source unit, to the given target unit. In opposite to convert(long, TimeUnit), this function works on double floating-point values.
Parameters:
time - the amount of time.
source - the source unit. Never null.
target - the target unit. Never null.
Returns:
the amount of time in the target unit.
days(byte)
def days(byte) : long
Convert days to milliseconds.
Parameters:
days - number of days to convert.
Returns:
the number of days in days
days(short)
def days(short) : long
Convert days to milliseconds.
Parameters:
days - number of days to convert.
Returns:
the number of days in days
days(int)
def days(int) : long
Convert days to milliseconds.
Parameters:
days - number of days to convert.
Returns:
the number of days in days
days(long)
def days(long) : long
Convert days to milliseconds.
Parameters:
days - number of days to convert.
Returns:
the number of days in days
days(float)
def days(float) : long
Convert days to milliseconds.
Parameters:
days - number of days to convert.
Returns:
the number of days in days
days(double)
def days(double) : long
Convert days to milliseconds.
Parameters:
days - number of days to convert.
Returns:
the number of days in days
days(Number)
def days(Number) : long
Convert days to milliseconds.
Parameters:
days - number of days to convert.
Returns:
the number of days in days
hours(byte)
def hours(byte) : long
Convert hours to milliseconds.
Parameters:
hours - number of hours to convert.
Returns:
the number of milliseconds in hours
hours(short)
def hours(short) : long
Convert hours to milliseconds.
Parameters:
hours - number of hours to convert.
Returns:
the number of milliseconds in hours
hours(int)
def hours(int) : long
Convert hours to milliseconds.
Parameters:
hours - number of hours to convert.
Returns:
the number of milliseconds in hours
hours(long)
def hours(long) : long
Convert hours to milliseconds.
Parameters:
hours - number of hours to convert.
Returns:
the number of milliseconds in hours
hours(float)
def hours(float) : long
Convert hours to milliseconds.
Parameters:
hours - number of hours to convert.
Returns:
the number of milliseconds in hours
hours(double)
def hours(double) : long
Convert hours to milliseconds.
Parameters:
hours - number of hours to convert.
Returns:
the number of milliseconds in hours
hours(Number)
def hours(Number) : long
Convert hours to milliseconds.
Parameters:
hours - number of hours to convert.
Returns:
the number of milliseconds in hours
milliseconds(byte)
def milliseconds(byte) : long
Convert milliseconds to milliseconds.
Parameters:
milis - number of milliseconds to convert.
Returns:
the number of milliseconds in milis .
milliseconds(short)
def milliseconds(short) : long
Convert milliseconds to milliseconds.
Parameters:
milis - number of milliseconds to convert.
Returns:
the number of milliseconds in milis .
milliseconds(int)
def milliseconds(int) : long
Convert milliseconds to milliseconds.
Parameters:
milis - number of milliseconds to convert.
Returns:
the number of milliseconds in milis .
milliseconds(long)
def milliseconds(long) : long
Convert milliseconds to milliseconds.
Parameters:
milis - number of milliseconds to convert.
Returns:
the number of milliseconds in milis .
milliseconds(float)
def milliseconds(float) : long
Convert milliseconds to milliseconds.
Parameters:
milis - number of milliseconds to convert.
Returns:
the number of milliseconds in milis .
milliseconds(double)
def milliseconds(double) : long
Convert milliseconds to milliseconds.
Parameters:
milis - number of milliseconds to convert.
Returns:
the number of milliseconds in milis .
milliseconds(Number)
def milliseconds(Number) : long
Convert milliseconds to milliseconds.
Parameters:
milis - number of milliseconds to convert.
Returns:
the number of milliseconds in milis .
minutes(byte)
def minutes(byte) : long
Convert minutes to milliseconds.
Parameters:
mins - number of minutes to convert.
Returns:
the number of milliseconds in mins
minutes(short)
def minutes(short) : long
Convert minutes to milliseconds.
Parameters:
mins - number of minutes to convert.
Returns:
the number of milliseconds in mins
minutes(int)
def minutes(int) : long
Convert minutes to milliseconds.
Parameters:
mins - number of minutes to convert.
Returns:
the number of milliseconds in mins
minutes(long)
def minutes(long) : long
Convert minutes to milliseconds.
Parameters:
mins - number of minutes to convert.
Returns:
the number of milliseconds in mins
minutes(float)
def minutes(float) : long
Convert minutes to milliseconds.
Parameters:
mins - number of minutes to convert.
Returns:
the number of milliseconds in mins
minutes(double)
def minutes(double) : long
Convert minutes to milliseconds.
Parameters:
mins - number of minutes to convert.
Returns:
the number of milliseconds in mins
minutes(Number)
def minutes(Number) : long
Convert minutes to milliseconds.
Parameters:
mins - number of minutes to convert.
Returns:
the number of milliseconds in mins
seconds(byte)
def seconds(byte) : long
Convert seconds to milliseconds.
Parameters:
secs - number of seconds to convert.
Returns:
the number of milliseconds in seconds.
seconds(short)
def seconds(short) : long
Convert seconds to milliseconds.
Parameters:
secs - number of seconds to convert.
Returns:
the number of milliseconds in seconds.
seconds(int)
def seconds(int) : long
Convert seconds to milliseconds.
Parameters:
secs - number of seconds to convert.
Returns:
the number of milliseconds in seconds.
seconds(long)
def seconds(long) : long
Convert seconds to milliseconds.
Parameters:
secs - number of seconds to convert.
Returns:
the number of milliseconds in seconds.
seconds(float)
def seconds(float) : long
Convert seconds to milliseconds.
Parameters:
secs - number of seconds to convert.
Returns:
the number of milliseconds in seconds.
seconds(double)
def seconds(double) : long
Convert seconds to milliseconds.
Parameters:
secs - number of seconds to convert.
Returns:
the number of milliseconds in seconds.
seconds(Number)
def seconds(Number) : long
Convert seconds to milliseconds.
Parameters:
secs - number of seconds to convert.
Returns:
the number of milliseconds in seconds.
weeks(byte)
def weeks(byte) : long
Convert weeks to milliseconds.
Parameters:
weeks - number of weeks to convert.
Returns:
the number of milliseconds in weeks
weeks(short)
def weeks(short) : long
Convert weeks to milliseconds.
Parameters:
weeks - number of weeks to convert.
Returns:
the number of milliseconds in weeks
weeks(int)
def weeks(int) : long
Convert weeks to milliseconds.
Parameters:
weeks - number of weeks to convert.
Returns:
the number of milliseconds in weeks
weeks(long)
def weeks(long) : long
Convert weeks to milliseconds.
Parameters:
weeks - number of weeks to convert.
Returns:
the number of milliseconds in weeks
weeks(float)
def weeks(float) : long
Convert weeks to milliseconds.
Parameters:
weeks - number of weeks to convert.
Returns:
the number of milliseconds in weeks
weeks(double)
def weeks(double) : long
Convert weeks to milliseconds.
Parameters:
weeks - number of weeks to convert.
Returns:
the number of milliseconds in weeks
weeks(Number)
def weeks(Number) : long
Convert weeks to milliseconds.
Parameters:
weeks - number of weeks to convert.
Returns:
the number of milliseconds in weeks