Class RelativeIso8601Date

java.lang.Object
java.util.Date
htsjdk.samtools.util.Iso8601Date
htsjdk.samtools.util.RelativeIso8601Date
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Date>

public class RelativeIso8601Date extends Iso8601Date
Like Iso8601Date, but also comes in a "lazy now" flavor.

When "lazy now" mode is enabled, this instance's date value is undefined until the first time it is queried, at which time it is set to System.currentTimeMillis(). This value is returned on subsequent queries, so it is consistent.

The "lazy state" is conveyed via toString(). A "lazy now" instance will answer toString() with LAZY_NOW_LABEL if the time has not yet been queried/set, or a Iso8601Date-formatted date of the query time if it has been queried. This characteristic is useful for serialization and persistence purposes.

Consumers can create "lazy now" instances via the generateLazyNowInstance() factory method or by passing LAZY_NOW_LABEL to RelativeIso8601Date(String).

See Also: