public class DefaultRelativeInstant extends java.lang.Object implements RelativeInstant
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates a copy of the object.
|
int |
compareTo(Instant instant)
Compares this object with the specified object for ascending
millisecond instant order.
|
boolean |
equals(java.lang.Object obj) |
Chronology |
getChronology()
Gets the chronology of the instant.
|
int |
getDayOfMonth()
Get the day of month field value.
|
int |
getDayOfWeek() |
EditableRelativeInstant |
getEditableCopy()
Get an editable copy used to edit other instance of
a relative instant.
|
int |
getHourOfDay()
Get the hour of day field value.
|
int |
getMillisOfSecond()
Get the millis of second field value.
|
int |
getMinuteOfDay()
Get the minute of day field value.
|
int |
getMinuteOfHour()
Get the minute of hour field value.
|
int |
getMonthOfYear()
Get the month of year field value.
|
int |
getSecondOfDay()
Get the second of day field value.
|
int |
getSecondOfMinute()
Get the second of minute field value.
|
int |
getWeekOfWeekyear() |
int |
getYear()
Get the year field value.
|
boolean |
intersects(Time time)
Does this time intersects with the time passed.
|
boolean |
isAbsolute()
Checks if the time is an absolute temporal type, that is an object that doesn't
has a time zone.
|
boolean |
isAfter(Instant instant)
Is this instant after the instant passed in comparing solely by millisecond.
|
boolean |
isBefore(Instant instant)
Is this instant before the instant passed in comparing solely by millisecond.
|
boolean |
isEqual(Instant instant)
Is this instant equal to the instant passed in comparing solely by millisecond.
|
boolean |
isInstant()
Checks if the time is an instant, that is an object that represents
a position in a time scale.
|
boolean |
isInterval()
Checks if the time is an interval, that is an object that represents
a period of time between two instants.
|
boolean |
isRelative()
Checks if the time is a relative temporal type, that is an object that has
a Chronology that establish how a time object can be converted into other
object with date time fields.
|
java.util.Date |
toDate()
Get the date time as a
java.util.Date . |
long |
toMillis()
Gets the milliseconds of the datetime instant from the Java epoch
of 1970-01-01T00:00:00Z.
|
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.String pattern)
Output the instant using the specified format pattern.
|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
cloneQuietly, cloneQuietly
public int getHourOfDay()
RelativeInstant
getHourOfDay
in interface RelativeInstant
public int getMinuteOfHour()
RelativeInstant
getMinuteOfHour
in interface RelativeInstant
public int getSecondOfMinute()
RelativeInstant
getSecondOfMinute
in interface RelativeInstant
public int getMinuteOfDay()
RelativeInstant
getMinuteOfDay
in interface RelativeInstant
public int getSecondOfDay()
RelativeInstant
getSecondOfDay
in interface RelativeInstant
public EditableRelativeInstant getEditableCopy()
RelativeInstant
getEditableCopy
in interface RelativeInstant
public long toMillis()
RelativeInstant
toMillis
in interface RelativeInstant
public java.lang.String toString(java.lang.String pattern)
Instant
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Date toDate()
RelativeInstant
java.util.Date
.
The Date
object created has exactly the same millisecond
instant as this object.
toDate
in interface RelativeInstant
public boolean isEqual(Instant instant)
Instant
public boolean isAfter(Instant instant)
Instant
public boolean isBefore(Instant instant)
Instant
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int getMillisOfSecond()
RelativeInstant
getMillisOfSecond
in interface RelativeInstant
public Chronology getChronology()
Time
getChronology
in interface Time
public int getYear()
RelativeInstant
getYear
in interface RelativeInstant
public int getMonthOfYear()
RelativeInstant
getMonthOfYear
in interface RelativeInstant
public int getWeekOfWeekyear()
public int getDayOfWeek()
public int getDayOfMonth()
RelativeInstant
getDayOfMonth
in interface RelativeInstant
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Cloneable
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- if the instance of the object cannot
be cloned. As this is extending Cloneable
so its sure
it implements it, so this exception may be used for problems on specific
object instances.Object#clone()}.
public boolean intersects(Time time)
Time
intersects
in interface Time
time
- an instant to check against, null means nowtrue
if the time intersects with the time passed inpublic boolean isRelative()
Time
isRelative
in interface Time
true
public final boolean isAbsolute()
Time
isAbsolute
in interface Time
true
if the time object is absolutepublic final boolean isInterval()
Time
isInterval
in interface Time
true
if the time object is an intervalpublic boolean isInstant()
Time
public int compareTo(Instant instant)
RelativeInstant
compareTo
in interface RelativeInstant
instant
- a readable instant to check against