(*value-of name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
name - the name of the enum constant to be returned. - java.lang.String
returns: the enum constant with the specified name - java.util.concurrent.TimeUnit
throws: java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.) name - the name of the enum constant to be returned. - `java.lang.String` returns: the enum constant with the specified name - `java.util.concurrent.TimeUnit` throws: java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
(*values)
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (TimeUnit c : TimeUnit.values()) System.out.println(c);
returns: an array containing the constants of this enum type, in the order they are declared - java.util.concurrent.TimeUnit[]
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows: for (TimeUnit c : TimeUnit.values()) System.out.println(c); returns: an array containing the constants of this enum type, in the order they are declared - `java.util.concurrent.TimeUnit[]`
(convert this source-duration source-unit)
Converts the given time duration in the given unit to this unit. Conversions from finer to coarser granularities truncate, so lose precision. For example, converting 999 milliseconds to seconds results in 0. Conversions from coarser to finer granularities with arguments that would numerically overflow saturate to Long.MIN_VALUE if negative or Long.MAX_VALUE if positive.
For example, to convert 10 minutes to milliseconds, use: TimeUnit.MILLISECONDS.convert(10L, TimeUnit.MINUTES)
source-duration - the time duration in the given sourceUnit - long
source-unit - the unit of the sourceDuration argument - java.util.concurrent.TimeUnit
returns: the converted duration in this unit,
or Long.MIN_VALUE if conversion would negatively
overflow, or Long.MAX_VALUE if it would positively overflow. - long
Converts the given time duration in the given unit to this unit. Conversions from finer to coarser granularities truncate, so lose precision. For example, converting 999 milliseconds to seconds results in 0. Conversions from coarser to finer granularities with arguments that would numerically overflow saturate to Long.MIN_VALUE if negative or Long.MAX_VALUE if positive. For example, to convert 10 minutes to milliseconds, use: TimeUnit.MILLISECONDS.convert(10L, TimeUnit.MINUTES) source-duration - the time duration in the given sourceUnit - `long` source-unit - the unit of the sourceDuration argument - `java.util.concurrent.TimeUnit` returns: the converted duration in this unit, or Long.MIN_VALUE if conversion would negatively overflow, or Long.MAX_VALUE if it would positively overflow. - `long`
Enum Constant.
Time unit representing twenty four hours
type: java.util.concurrent.TimeUnit
Enum Constant. Time unit representing twenty four hours type: java.util.concurrent.TimeUnit
Enum Constant.
Time unit representing sixty minutes
type: java.util.concurrent.TimeUnit
Enum Constant. Time unit representing sixty minutes type: java.util.concurrent.TimeUnit
Enum Constant.
Time unit representing one thousandth of a millisecond
type: java.util.concurrent.TimeUnit
Enum Constant. Time unit representing one thousandth of a millisecond type: java.util.concurrent.TimeUnit
Enum Constant.
Time unit representing one thousandth of a second
type: java.util.concurrent.TimeUnit
Enum Constant. Time unit representing one thousandth of a second type: java.util.concurrent.TimeUnit
Enum Constant.
Time unit representing sixty seconds
type: java.util.concurrent.TimeUnit
Enum Constant. Time unit representing sixty seconds type: java.util.concurrent.TimeUnit
Enum Constant.
Time unit representing one thousandth of a microsecond
type: java.util.concurrent.TimeUnit
Enum Constant. Time unit representing one thousandth of a microsecond type: java.util.concurrent.TimeUnit
Enum Constant.
Time unit representing one second
type: java.util.concurrent.TimeUnit
Enum Constant. Time unit representing one second type: java.util.concurrent.TimeUnit
(sleep this timeout)
Performs a Thread.sleep using this time unit. This is a convenience method that converts time arguments into the form required by the Thread.sleep method.
timeout - the minimum time to sleep. If less than or equal to zero, do not sleep at all. - long
throws: java.lang.InterruptedException - if interrupted while sleeping
Performs a Thread.sleep using this time unit. This is a convenience method that converts time arguments into the form required by the Thread.sleep method. timeout - the minimum time to sleep. If less than or equal to zero, do not sleep at all. - `long` throws: java.lang.InterruptedException - if interrupted while sleeping
(timed-join this thread timeout)
Performs a timed Thread.join using this time unit. This is a convenience method that converts time arguments into the form required by the Thread.join method.
thread - the thread to wait for - java.lang.Thread
timeout - the maximum time to wait. If less than or equal to zero, do not wait at all. - long
throws: java.lang.InterruptedException - if interrupted while waiting
Performs a timed Thread.join using this time unit. This is a convenience method that converts time arguments into the form required by the Thread.join method. thread - the thread to wait for - `java.lang.Thread` timeout - the maximum time to wait. If less than or equal to zero, do not wait at all. - `long` throws: java.lang.InterruptedException - if interrupted while waiting
(timed-wait this obj timeout)
Performs a timed Object.wait using this time unit. This is a convenience method that converts timeout arguments into the form required by the Object.wait method.
For example, you could implement a blocking poll method (see BlockingQueue.poll) using:
public synchronized Object poll(long timeout, TimeUnit unit) throws InterruptedException { while (empty) { unit.timedWait(this, timeout); ... } }
obj - the object to wait on - java.lang.Object
timeout - the maximum time to wait. If less than or equal to zero, do not wait at all. - long
throws: java.lang.InterruptedException - if interrupted while waiting
Performs a timed Object.wait using this time unit. This is a convenience method that converts timeout arguments into the form required by the Object.wait method. For example, you could implement a blocking poll method (see BlockingQueue.poll) using: public synchronized Object poll(long timeout, TimeUnit unit) throws InterruptedException { while (empty) { unit.timedWait(this, timeout); ... } } obj - the object to wait on - `java.lang.Object` timeout - the maximum time to wait. If less than or equal to zero, do not wait at all. - `long` throws: java.lang.InterruptedException - if interrupted while waiting
(to-days this duration)
Equivalent to DAYS.convert(duration, this).
duration - the duration - long
returns: the converted duration - long
Equivalent to DAYS.convert(duration, this). duration - the duration - `long` returns: the converted duration - `long`
(to-hours this duration)
Equivalent to HOURS.convert(duration, this).
duration - the duration - long
returns: the converted duration,
or Long.MIN_VALUE if conversion would negatively
overflow, or Long.MAX_VALUE if it would positively overflow. - long
Equivalent to HOURS.convert(duration, this). duration - the duration - `long` returns: the converted duration, or Long.MIN_VALUE if conversion would negatively overflow, or Long.MAX_VALUE if it would positively overflow. - `long`
(to-micros this duration)
Equivalent to MICROSECONDS.convert(duration, this).
duration - the duration - long
returns: the converted duration,
or Long.MIN_VALUE if conversion would negatively
overflow, or Long.MAX_VALUE if it would positively overflow. - long
Equivalent to MICROSECONDS.convert(duration, this). duration - the duration - `long` returns: the converted duration, or Long.MIN_VALUE if conversion would negatively overflow, or Long.MAX_VALUE if it would positively overflow. - `long`
(to-millis this duration)
Equivalent to MILLISECONDS.convert(duration, this).
duration - the duration - long
returns: the converted duration,
or Long.MIN_VALUE if conversion would negatively
overflow, or Long.MAX_VALUE if it would positively overflow. - long
Equivalent to MILLISECONDS.convert(duration, this). duration - the duration - `long` returns: the converted duration, or Long.MIN_VALUE if conversion would negatively overflow, or Long.MAX_VALUE if it would positively overflow. - `long`
(to-minutes this duration)
Equivalent to MINUTES.convert(duration, this).
duration - the duration - long
returns: the converted duration,
or Long.MIN_VALUE if conversion would negatively
overflow, or Long.MAX_VALUE if it would positively overflow. - long
Equivalent to MINUTES.convert(duration, this). duration - the duration - `long` returns: the converted duration, or Long.MIN_VALUE if conversion would negatively overflow, or Long.MAX_VALUE if it would positively overflow. - `long`
(to-nanos this duration)
Equivalent to NANOSECONDS.convert(duration, this).
duration - the duration - long
returns: the converted duration,
or Long.MIN_VALUE if conversion would negatively
overflow, or Long.MAX_VALUE if it would positively overflow. - long
Equivalent to NANOSECONDS.convert(duration, this). duration - the duration - `long` returns: the converted duration, or Long.MIN_VALUE if conversion would negatively overflow, or Long.MAX_VALUE if it would positively overflow. - `long`
(to-seconds this duration)
Equivalent to SECONDS.convert(duration, this).
duration - the duration - long
returns: the converted duration,
or Long.MIN_VALUE if conversion would negatively
overflow, or Long.MAX_VALUE if it would positively overflow. - long
Equivalent to SECONDS.convert(duration, this). duration - the duration - `long` returns: the converted duration, or Long.MIN_VALUE if conversion would negatively overflow, or Long.MAX_VALUE if it would positively overflow. - `long`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close