Package htsjdk.samtools.util
Class RelativeIso8601Date
java.lang.Object
java.util.Date
htsjdk.samtools.util.Iso8601Date
htsjdk.samtools.util.RelativeIso8601Date
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<Date>
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:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
clone()
int
boolean
static RelativeIso8601Date
Returns a "lazy now" instance.int
getDate()
Deprecated.int
getDay()
Deprecated.int
getHours()
Deprecated.int
Deprecated.int
getMonth()
Deprecated.int
Deprecated.long
getTime()
int
Deprecated.int
getYear()
Deprecated.int
hashCode()
void
setDate
(int date) Deprecated.void
setHours
(int hours) Deprecated.void
setMinutes
(int minutes) Deprecated.void
setMonth
(int month) Deprecated.void
setSeconds
(int seconds) Deprecated.void
setTime
(long time) Deprecated.void
setYear
(int year) Deprecated.toString()
Returns aString
representation of this date.Methods inherited from class java.util.Date
from, parse, toGMTString, toInstant, toLocaleString, UTC
-
Field Details
-
LAZY_NOW_LABEL
- See Also:
-
-
Constructor Details
-
RelativeIso8601Date
-
RelativeIso8601Date
-
-
Method Details
-
generateLazyNowInstance
Returns a "lazy now" instance. -
toString
Returns aString
representation of this date.- Overrides:
toString
in classIso8601Date
- Returns:
- An
Iso8601Date
-formatted string, or the value ofLAZY_NOW_LABEL
if this is a "lazy now" instance.
-
getTime
public long getTime() -
after
-
before
-
clone
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Date>
- Overrides:
compareTo
in classDate
-
equals
-
getDate
Deprecated. -
getDay
Deprecated. -
getHours
Deprecated. -
getMinutes
Deprecated.- Overrides:
getMinutes
in classDate
-
getMonth
Deprecated. -
getSeconds
Deprecated.- Overrides:
getSeconds
in classDate
-
getTimezoneOffset
Deprecated.- Overrides:
getTimezoneOffset
in classDate
-
getYear
Deprecated. -
hashCode
public int hashCode() -
setDate
Deprecated. -
setHours
Deprecated. -
setMinutes
Deprecated.- Overrides:
setMinutes
in classDate
-
setMonth
Deprecated. -
setSeconds
Deprecated.- Overrides:
setSeconds
in classDate
-
setTime
Deprecated. -
setYear
Deprecated.
-