lingua-franca 0.10.1
Lingua Franca code generator
Loading...
Searching...
No Matches
org.lflang.TimeUnit Enum Reference

A unit of time for a TimeValue. More...

Public Member Functions

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 Public Member Functions

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.

Public Attributes

 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")

Detailed Description

A unit of time for a TimeValue.

Author
Marten Lohstroh
Clément Fournier, TU Dresden, INSA Rennes

Constructor & Destructor Documentation

◆ TimeUnit()

org.lflang.TimeUnit.TimeUnit ( String canonicalName,
String siName,
String... aliases )

Construct a time unit.

Parameters
canonicalNameThe name used in the generated code for the unit.
siNameThe SI unit name, if there is one, and otherwise a short name.
aliasesAny number of alternative names for the unit.

Member Function Documentation

◆ 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
IllegalArgumentExceptionIf 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 ( )

Member Data Documentation

◆ DAY

org.lflang.TimeUnit.DAY =("day", "d", "days")

Day.

◆ HOUR

org.lflang.TimeUnit.HOUR =("hour", "h", "hours")

Hour.

◆ MICRO

org.lflang.TimeUnit.MICRO =("usec", "us", "usecs")

Microseconds.

◆ MILLI

org.lflang.TimeUnit.MILLI =("msec", "ms", "msecs")

Milliseconds.

◆ MINUTE

org.lflang.TimeUnit.MINUTE =("minute", "min", "mins", "minutes")

Minute.

◆ NANO

org.lflang.TimeUnit.NANO =("nsec", "ns", "nsecs")

Nanoseconds.

◆ SECOND

org.lflang.TimeUnit.SECOND =("sec", "s", "secs", "second", "seconds")

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