| Modifier and Type | Field and Description |
|---|---|
| private final long | |
| private final long | |
| private final TimeUnit |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: `true` if this Timeout value is equal to the given Timeout value, `false` otherwise.the reference object with which to compare. obj)Overrides java. |
| public TimeUnit | Returns: TimeUnit The unit of precision used by the clock in this Timeout.Get the unit of precision for the underlying clock, that is used by
|
| public long | Returns: A numerical value that represents the deadline from "now" until this timeout has passed.
Deprecated
for removal. This method is deprecated because it encourages code that is
susceptible to overflow bugs.
Calculate a deadline, as an instant in the future, in terms of the
base unit.
|
| public long | Returns: The amount of time, in terms of thebase unit, that is left until the deadline. If
this value is negative, then the deadline has transpired.The reference deadline from deadline)getDeadline().
Deprecated
for removal. This method is deprecated because it encourages code that is
susceptible to overflow bugs.
Calculate the amount of time that is left until the deadline, in terms
of the base unit.
|
| public long | Returns: A numerical value of the timeout. Possibly zero or negative.Get the timeout value in terms of the |
| public long | Returns: A numerical value of the timeout. Possibly zero or negative.Get the timeout value in terms of the |
| public TimeUnit | Returns: TheTimeUnit of the timeout value. Never `null`.Get the unit for the |
| public int |
| timeout | back to summary |
|---|---|
| private final long timeout | |
| timeoutBase | back to summary |
|---|---|
| private final long timeoutBase | |
| unit | back to summary |
|---|---|
| private final TimeUnit unit | |
| Timeout | back to summary |
|---|---|
| public Timeout(long timeout, TimeUnit unit) Construct a new timeout with the given value and unit. The unit cannot be `null`, but the timeout value is unrestricted. The meaning of a negative timeout value is specific to the implementation of the use site, but typically means that no amount of blocking or waiting is tolerated.
| |
| Timeout | back to summary |
|---|---|
| public Timeout(Duration duration) Construct a new timeout with the given duration. An exception will be thrown if the duration cannot be converted to a nanosecond quantity. The duration also cannot be `null`. Apart from these two, there are no restrictions on the duration.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Timeouts of equivalent duration are equal, even if they were constructed with different units.
| |
| getBaseUnit | back to summary |
|---|---|
| public TimeUnit getBaseUnit() Get the unit of precision for the underlying clock, that is used by
| |
| getDeadline | back to summary |
|---|---|
| public long getDeadline()
Deprecated for removal. This method is deprecated because it encourages code that is susceptible to overflow bugs. Calculate a deadline, as an instant in the future, in terms of the
| |
| getTimeLeft | back to summary |
|---|---|
| public long getTimeLeft(long deadline)
Deprecated for removal. This method is deprecated because it encourages code that is susceptible to overflow bugs. Calculate the amount of time that is left until the deadline, in terms
of the
| |
| getTimeout | back to summary |
|---|---|
| public long getTimeout() Get the timeout value in terms of the
| |
| getTimeoutInBaseUnit | back to summary |
|---|---|
| public long getTimeoutInBaseUnit() Get the timeout value in terms of the
| |
| getUnit | back to summary |
|---|---|
| public TimeUnit getUnit() Get the unit for the | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |