A unit of time for a TimeValue.
More...
|
| String | getCanonicalName () |
| | Returns the name that is preferred when displaying this unit.
|
| boolean | hasAlias (String name) |
| | Returns true if the given name is one of the aliases of this unit.
|
| | TimeUnit (String canonicalName, String siName, String... aliases) |
| | Construct a time unit.
|
| String | toString () |
|
| static TimeUnit | fromName (String name) |
| | Returns the constant corresponding to the given name.
|
| static boolean | isValidUnit (String name) |
| | Returns true if the parameter is null, or it is the alias of a valid time unit.
|
| static List< String > | list () |
| | Returns a list of all possible aliases for time values.
|
| static String | staticGetCanonicalName (TimeUnit unit) |
| | Returns the name that is preferred when displaying this unit.
|
|
| | DAY =("day", "d", "days") |
| | Day.
|
| | HOUR =("hour", "h", "hours") |
| | Hour.
|
| | MICRO =("usec", "us", "usecs") |
| | Microseconds.
|
| | MILLI =("msec", "ms", "msecs") |
| | Milliseconds.
|
| | MINUTE =("minute", "min", "mins", "minutes") |
| | Minute.
|
| | NANO =("nsec", "ns", "nsecs") |
| | Nanoseconds.
|
| | SECOND =("sec", "s", "secs", "second", "seconds") |
| | Seconds.
|
| | WEEK =("week", "wk", "weeks") |
A unit of time for a TimeValue.
- Author
- Marten Lohstroh
-
Clément Fournier, TU Dresden, INSA Rennes
◆ TimeUnit()
| org.lflang.TimeUnit.TimeUnit |
( |
String | canonicalName, |
|
|
String | siName, |
|
|
String... | aliases ) |
Construct a time unit.
- Parameters
-
| canonicalName | The name used in the generated code for the unit. |
| siName | The SI unit name, if there is one, and otherwise a short name. |
| aliases | Any number of alternative names for the unit. |
◆ fromName()
| TimeUnit org.lflang.TimeUnit.fromName |
( |
String | name | ) |
|
|
static |
Returns the constant corresponding to the given name.
The comparison is case-sensitive.
- Returns
- Null if the parameter is null, otherwise a non-null constant
- Exceptions
-
| IllegalArgumentException | If the name doesn't correspond to any constant |
◆ getCanonicalName()
| String org.lflang.TimeUnit.getCanonicalName |
( |
| ) |
|
Returns the name that is preferred when displaying this unit.
◆ hasAlias()
| boolean org.lflang.TimeUnit.hasAlias |
( |
String | name | ) |
|
Returns true if the given name is one of the aliases of this unit.
◆ isValidUnit()
| boolean org.lflang.TimeUnit.isValidUnit |
( |
String | name | ) |
|
|
static |
Returns true if the parameter is null, or it is the alias of a valid time unit.
◆ list()
| List< String > org.lflang.TimeUnit.list |
( |
| ) |
|
|
static |
Returns a list of all possible aliases for time values.
◆ staticGetCanonicalName()
| String org.lflang.TimeUnit.staticGetCanonicalName |
( |
TimeUnit | unit | ) |
|
|
static |
Returns the name that is preferred when displaying this unit.
◆ toString()
| String org.lflang.TimeUnit.toString |
( |
| ) |
|
◆ DAY
| org.lflang.TimeUnit.DAY =("day", "d", "days") |
◆ HOUR
| org.lflang.TimeUnit.HOUR =("hour", "h", "hours") |
◆ MICRO
| org.lflang.TimeUnit.MICRO =("usec", "us", "usecs") |
◆ MILLI
| org.lflang.TimeUnit.MILLI =("msec", "ms", "msecs") |
◆ MINUTE
| org.lflang.TimeUnit.MINUTE =("minute", "min", "mins", "minutes") |
◆ NANO
| org.lflang.TimeUnit.NANO =("nsec", "ns", "nsecs") |
◆ SECOND
| org.lflang.TimeUnit.SECOND =("sec", "s", "secs", "second", "seconds") |
◆ WEEK
| org.lflang.TimeUnit.WEEK =("week", "wk", "weeks") |
The documentation for this enum was generated from the following file:
- /Users/runner/work/lingua-franca/lingua-franca/core/src/main/java/org/lflang/TimeUnit.java