Represents an amount of time (a duration).
More...
Inherits Comparable< TimeValue >.
|
| final long | time |
| | Primitive numerical representation of this time value, to be interpreted in terms the associated time unit.
|
| final TimeUnit | unit |
| | Units associated with this time value.
|
Represents an amount of time (a duration).
- Author
- Marten Lohstroh
-
Clément Fournier - TU Dresden, INSA Rennes
◆ TimeValue() [1/2]
| org.lflang.TimeValue.TimeValue |
( |
long | time, |
|
|
TimeUnit | unit ) |
Create a new time value.
- Parameters
-
| time | The time value. |
| unit | The unit of the time value. |
- Exceptions
-
| IllegalArgumentException | If time is non-zero and the unit is null. |
◆ TimeValue() [2/2]
| org.lflang.TimeValue.TimeValue |
( |
Time | time | ) |
|
Create a new time value.
- Parameters
-
- Exceptions
-
| IllegalArgumentException | If time is non-zero and the unit is null. |
◆ add()
Return the sum of this duration and the one represented by b.
The unit of the returned TimeValue will be the minimum of the units of both operands except if only one of the units is TimeUnit.NONE. In that case, the unit of the other input is used.
- Parameters
-
- Returns
- A new TimeValue (the current value will not be affected)
◆ compare()
◆ compareTo()
| int org.lflang.TimeValue.compareTo |
( |
TimeValue | o | ) |
|
◆ equals()
| boolean org.lflang.TimeValue.equals |
( |
Object | t1 | ) |
|
◆ fromNanoSeconds()
| TimeValue org.lflang.TimeValue.fromNanoSeconds |
( |
long | ns | ) |
|
|
static |
Return a TimeValue based on a nanosecond value.
◆ getMagnitude()
| long org.lflang.TimeValue.getMagnitude |
( |
| ) |
|
Return the magnitude of this value, as expressed in the unit of this value.
◆ getUnit()
| TimeUnit org.lflang.TimeValue.getUnit |
( |
| ) |
|
Units associated with this time value.
May be null, but only if the magnitude is zero.
◆ hashCode()
| int org.lflang.TimeValue.hashCode |
( |
| ) |
|
◆ isEarlierThan()
| boolean org.lflang.TimeValue.isEarlierThan |
( |
TimeValue | other | ) |
|
Returns whether this time value is earlier than another.
◆ max()
Return the latest of both values.
◆ min()
Return the earliest of both values.
◆ subtract()
Return this time value minus the specified time value but no less than 0.
The unit of the returned TimeValue will be the minimum of the units of both operands except if only one of the units is TimeUnit.NONE. In that case, the unit of the other input is used.
- Parameters
-
- Returns
- A new TimeValue (the current value will not be affected)
◆ toNanoSeconds()
| long org.lflang.TimeValue.toNanoSeconds |
( |
| ) |
|
Get this time value in number of nanoseconds.
◆ toString()
| String org.lflang.TimeValue.toString |
( |
| ) |
|
Return a string representation of this time value.
◆ FOREVER
A time value representing FOREVER which is greater than any other time value.
◆ MAX_LONG_DEADLINE
| final long org.lflang.TimeValue.MAX_LONG_DEADLINE = Long.decode("0x7FFFFFFFFFFF") |
|
static |
Maximum size of a deadline in primitive representation.
NOTE: if we were to use an unsigned data type this would be 0xFFFFFFFFFFFF
◆ MAX_VALUE
The maximum value of this type.
This is approximately equal to 292 years.
◆ MIN_VALUE
The minimum value of this type.
◆ NEVER
A time value representing NEVER, which is less than any other time value.
◆ time
| final long org.lflang.TimeValue.time |
Primitive numerical representation of this time value, to be interpreted in terms the associated time unit.
◆ unit
| final TimeUnit org.lflang.TimeValue.unit |
Units associated with this time value.
May be null.
◆ ZERO
A time value equal to zero.
The documentation for this class was generated from the following file:
- /Users/runner/work/lingua-franca/lingua-franca/core/src/main/java/org/lflang/TimeValue.java