public class DefaultRelativeInterval extends java.lang.Object implements RelativeInterval
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates a copy of the object.
|
boolean |
contains(Instant instant)
Does this time interval contain the specified time instant.
|
boolean |
contains(RelativeInstant instant)
Does this time interval contain the specified instant
|
boolean |
contains(RelativeInterval interval)
Does this time interval contain the specified interval
|
boolean |
equals(java.lang.Object obj) |
Chronology |
getChronology()
Gets the chronology of the instant.
|
RelativeInstant |
getEnd()
Gets the end of this time interval, which is exclusive, as an Instant.
|
RelativeInstant |
getStart()
Gets the start of this time interval, which is inclusive, as an Instant.
|
boolean |
intersects(RelativeInterval relativeInterval) |
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(RelativeInstant instant)
Is this time interval after the specified instant.
|
boolean |
isAfter(RelativeInterval interval)
Is this time interval entirely after the specified interval.
|
boolean |
isBefore(RelativeInstant instant)
Is this time interval before the specified instant.
|
boolean |
isBefore(RelativeInterval interval)
Is this time interval entirely before the specified interval.
|
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.
|
boolean |
overlaps(RelativeInterval interval)
Does this time interval overlap the specified time interval.
|
Duration |
toDuration()
Gets the duration of this time interval.
|
long |
toDurationMillis()
Gets the duration of this time interval in milliseconds.
|
Duration |
toStandardDuration()
Gets the duration of the interval.
|
java.lang.String |
toString() |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
cloneQuietly, cloneQuietly
public long toDurationMillis()
RelativeInterval
toDurationMillis
in interface RelativeInterval
public boolean contains(RelativeInstant instant)
RelativeInterval
contains
in interface RelativeInterval
instant
- the instant, null means nowtrue
if this time interval contains the instantpublic boolean isAfter(RelativeInstant instant)
RelativeInterval
isAfter
in interface RelativeInterval
instant
- the instant to compare to, null means nowtrue
if this time interval is after the instantpublic boolean isAfter(RelativeInterval interval)
RelativeInterval
isAfter
in interface RelativeInterval
interval
- the interval to compare to, null means nowtrue
if this time interval is after the interval specifiedpublic boolean isBefore(RelativeInstant instant)
RelativeInterval
isBefore
in interface RelativeInterval
instant
- the instant to compare to, null means nowtrue
if this time interval is before the instantpublic boolean isBefore(RelativeInterval interval)
RelativeInterval
isBefore
in interface RelativeInterval
interval
- the interval to compare to, null means nowtrue
if this time interval is before the interval specifiedpublic Duration toDuration()
RelativeInterval
toDuration
in interface RelativeInterval
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public boolean contains(RelativeInterval interval)
RelativeInterval
contains
in interface RelativeInterval
true
if this time interval contains the intervalpublic boolean overlaps(RelativeInterval interval)
RelativeInterval
overlaps
in interface RelativeInterval
interval
- the time interval to compare to, null means a zero
length interval nowtrue
if the time intervals overlappublic Chronology getChronology()
Time
getChronology
in interface Time
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 RelativeInstant getStart()
RelativeInterval
getStart
in interface Interval
getStart
in interface RelativeInterval
public RelativeInstant getEnd()
RelativeInterval
getEnd
in interface Interval
getEnd
in interface RelativeInterval
public boolean isRelative()
Time
isRelative
in interface Time
true
public final boolean isAbsolute()
Time
isAbsolute
in interface Time
true
if the time object is absolutepublic boolean isInterval()
Time
isInterval
in interface Time
true
if the time object is an intervalpublic final boolean isInstant()
Time
public boolean contains(Instant instant)
Interval
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 intersects(RelativeInterval relativeInterval)
public Duration toStandardDuration()
Interval
toStandardDuration
in interface Interval