public class DefaultRelativeInstant extends Object implements RelativeInstant
| Modifier and Type | Method and Description |
|---|---|
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(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.
|
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.
|
String |
toString() |
String |
toString(String pattern)
Output the instant using the specified format pattern.
|
public int getHourOfDay()
RelativeInstantgetHourOfDay in interface RelativeInstantpublic int getMinuteOfHour()
RelativeInstantgetMinuteOfHour in interface RelativeInstantpublic int getSecondOfMinute()
RelativeInstantgetSecondOfMinute in interface RelativeInstantpublic int getMinuteOfDay()
RelativeInstantgetMinuteOfDay in interface RelativeInstantpublic int getSecondOfDay()
RelativeInstantgetSecondOfDay in interface RelativeInstantpublic EditableRelativeInstant getEditableCopy()
RelativeInstantgetEditableCopy in interface RelativeInstantpublic long toMillis()
RelativeInstanttoMillis in interface RelativeInstantpublic String toString(String pattern)
RelativeInstanttoString in interface RelativeInstantpattern - the pattern specification, null means
use toStringpublic Date toDate()
RelativeInstantjava.util.Date.
The Date object created has exactly the same millisecond
instant as this object.
toDate in interface RelativeInstantpublic boolean isEqual(Instant instant)
Instantpublic boolean isAfter(Instant instant)
Instantpublic boolean isBefore(Instant instant)
Instantpublic int getMillisOfSecond()
RelativeInstantgetMillisOfSecond in interface RelativeInstantpublic Chronology getChronology()
TimegetChronology in interface Timepublic int getYear()
RelativeInstantgetYear in interface RelativeInstantpublic int getMonthOfYear()
RelativeInstantgetMonthOfYear in interface RelativeInstantpublic int getWeekOfWeekyear()
public int getDayOfWeek()
public int getDayOfMonth()
RelativeInstantgetDayOfMonth in interface RelativeInstantpublic Object clone() throws CloneNotSupportedException
Cloneableclone in class ObjectCloneNotSupportedException - 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)
Timeintersects in interface Timetime - an instant to check against, null means nowtrue if the time intersects with the time passed inpublic boolean isRelative()
TimeisRelative in interface Timetruepublic boolean isAbsolute()
TimeisAbsolute in interface Timetrue if the time object is absolutepublic boolean isInterval()
TimeisInterval in interface Timetrue if the time object is an intervalpublic boolean isInstant()
Timepublic int compareTo(Instant instant)
RelativeInstantcompareTo in interface RelativeInstantinstant - a readable instant to check against