Package javax.time
Class TimeSource.OffsetSystemTimeSource
java.lang.Object
javax.time.TimeSource
javax.time.TimeSource.OffsetSystemTimeSource
- All Implemented Interfaces:
Serializable
- Enclosing class:
TimeSource
Implementation of a time-source that returns the latest time from
System.currentTimeMillis()
plus an offset.-
Nested Class Summary
Nested classes/interfaces inherited from class javax.time.TimeSource
TimeSource.FixedTimeSource, TimeSource.OffsetSystemTimeSource, TimeSource.SystemTimeSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Duration
The fixed offset to add.private static final long
A serialization identifier for this class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
OffsetSystemTimeSource
(Duration offset) Restricted constructor. -
Method Summary
Methods inherited from class javax.time.TimeSource
fixed, millis, offsetSystem, system, taiInstant, utcInstant
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDA serialization identifier for this class.- See Also:
-
offset
The fixed offset to add.
-
-
Constructor Details
-
OffsetSystemTimeSource
Restricted constructor.
-
-
Method Details
-
instant
Gets the currentInstant
.The instant returned by this method will vary according to the implementation. For example, the time-source returned by
TimeSource.system()
will return an instant based onSystem.currentTimeMillis()
.Normally, this method will not throw an exception. However, one possible implementation would be to obtain the time from a central time server across the network. Obviously, in this case the lookup could fail, and so the method is permitted to throw an exception.
- Specified by:
instant
in classTimeSource
- Returns:
- the current
Instant
from this time-source, never null
-
equals
-
hashCode
public int hashCode() -
toString
-