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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanclone()intbooleanstatic RelativeIso8601DateReturns a "lazy now" instance.intgetDate()Deprecated.intgetDay()Deprecated.intgetHours()Deprecated.intDeprecated.intgetMonth()Deprecated.intDeprecated.longgetTime()intDeprecated.intgetYear()Deprecated.inthashCode()voidsetDate(int date) Deprecated.voidsetHours(int hours) Deprecated.voidsetMinutes(int minutes) Deprecated.voidsetMonth(int month) Deprecated.voidsetSeconds(int seconds) Deprecated.voidsetTime(long time) Deprecated.voidsetYear(int year) Deprecated.toString()Returns aStringrepresentation 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 aStringrepresentation of this date.- Overrides:
toStringin classIso8601Date- Returns:
- An
Iso8601Date-formatted string, or the value ofLAZY_NOW_LABELif this is a "lazy now" instance.
-
getTime
public long getTime() -
after
-
before
-
clone
-
compareTo
- Specified by:
compareToin interfaceComparable<Date>- Overrides:
compareToin classDate
-
equals
-
getDate
Deprecated. -
getDay
Deprecated. -
getHours
Deprecated. -
getMinutes
Deprecated.- Overrides:
getMinutesin classDate
-
getMonth
Deprecated. -
getSeconds
Deprecated.- Overrides:
getSecondsin classDate
-
getTimezoneOffset
Deprecated.- Overrides:
getTimezoneOffsetin classDate
-
getYear
Deprecated. -
hashCode
public int hashCode() -
setDate
Deprecated. -
setHours
Deprecated. -
setMinutes
Deprecated.- Overrides:
setMinutesin classDate
-
setMonth
Deprecated. -
setSeconds
Deprecated.- Overrides:
setSecondsin classDate
-
setTime
Deprecated. -
setYear
Deprecated.
-