Clock (Java SE 26 & JDK 26)
- All Implemented Interfaces:
InstantSource
-
Constructor Summary
Constructors
-
Method Summary
booleanChecks if this clock is equal to another clock.
Obtains a clock that always returns the same instant.
getZone()Gets the time-zone being used to create dates and times.
inthashCode()A hash code for this clock.
instant()Gets the current instant of the clock.
longmillis()Gets the current millisecond instant of the clock.
Obtains a clock that returns instants from the specified clock with the specified duration added.
Obtains a clock that returns the current instant using the best available system clock.
Obtains a clock that returns the current instant using the best available system clock, converting to date and time using the default time-zone.
Obtains a clock that returns the current instant using the best available system clock, converting to date and time using the UTC time-zone.
Obtains a clock that returns instants from the specified clock truncated to the nearest occurrence of the specified duration.
Obtains a clock that returns the current instant ticking in whole milliseconds using the best available system clock.
Obtains a clock that returns the current instant ticking in whole minutes using the best available system clock.
Obtains a clock that returns the current instant ticking in whole seconds using the best available system clock.
Returns a copy of this clock with a different time-zone.
Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitCreates and returns a copy of this object.
protected voidDeprecated, for removal: This API element is subject to removal in a future version.
Returns the runtime class of this
Object.final voidWakes up a single thread that is waiting on this object's monitor.
final voidWakes up all threads that are waiting on this object's monitor.
Returns a string representation of the object.
final voidCauses the current thread to wait until it is awakened, typically by being notified or interrupted.
final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Constructor Details
-
Clock
-
-
Method Details
-
systemUTC
-
systemDefaultZone
-
system
-
tickMillis
-
tickSeconds
-
tickMinutes
-
tick
-
fixed
-
offset
-
getZone
-
withZone
-
millis
-
instant
-
equals
-
hashCode
-