java.lang.Object
com.aoapps.lang.time.Instant
- All Implemented Interfaces:
Serializable
,Comparable<Instant>
Deprecated.
Please use standard Java 8 classes.
Wraps the number of seconds from the Epoch as well as positive nanoseconds into an
immutable value type.
This will be deprecated once Java 8 is ubiquitous and only serves as an extremely simplified stop-gap.
- Author:
- AO Industries, Inc.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Deprecated.boolean
Deprecated.boolean
Deprecated.long
Deprecated.int
getNano()
Deprecated.The nanoseconds, to simplify this is always in the positive direction.int
hashCode()
Deprecated.plusNanos
(long nanosToAdd) Deprecated.protected Object
Deprecated.toString()
Deprecated.static Instant
Deprecated.Parses an Instant's string representation.
-
Field Details
-
EPOCH
Deprecated.
-
-
Constructor Details
-
Instant
public Instant(long epochSecond, int nano) Deprecated.
-
-
Method Details
-
valueOf
Deprecated.Parses an Instant's string representation.- Returns:
- Instant the instant or null when toString is null
- Throws:
IllegalArgumentException
- when unable to parse
-
readResolve
Deprecated. -
toString
Deprecated. -
equals
Deprecated. -
equals
Deprecated. -
hashCode
public int hashCode()Deprecated. -
compareTo
Deprecated.- Specified by:
compareTo
in interfaceComparable<Instant>
-
getEpochSecond
public long getEpochSecond()Deprecated. -
getNano
public int getNano()Deprecated.The nanoseconds, to simplify this is always in the positive direction. For negative instants, this means the nanos goes up from zero to 1 billion, then the seconds go up one (toward zero). This may be counterintuitive if one things of nanoseconds as a fractional part of seconds, but this definition leads to a very clean implementation.Counting up by nanoseconds:
- -1.999999998
- -1.999999999
- 0.000000000
- 0.000000001
- 0.000000002
-
plusNanos
Deprecated.
-