public class DefaultRelativeInterval extends Object implements RelativeInterval
| Modifier and Type | Method and Description |
|---|---|
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(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.
|
String |
toString() |
public long toDurationMillis()
RelativeIntervaltoDurationMillis in interface RelativeIntervalpublic boolean contains(RelativeInstant instant)
RelativeIntervalcontains in interface RelativeIntervalinstant - the instant, null means nowtrue if this time interval contains the instantpublic boolean isAfter(RelativeInstant instant)
RelativeIntervalisAfter in interface RelativeIntervalinstant - the instant to compare to, null means nowtrue if this time interval is after the instantpublic boolean isAfter(RelativeInterval interval)
RelativeIntervalisAfter in interface RelativeIntervalinterval - the interval to compare to, null means nowtrue if this time interval is after the interval specifiedpublic boolean isBefore(RelativeInstant instant)
RelativeIntervalisBefore in interface RelativeIntervalinstant - the instant to compare to, null means nowtrue if this time interval is before the instantpublic boolean isBefore(RelativeInterval interval)
RelativeIntervalisBefore in interface RelativeIntervalinterval - the interval to compare to, null means nowtrue if this time interval is before the interval specifiedpublic Duration toDuration()
RelativeIntervaltoDuration in interface RelativeIntervalpublic boolean contains(RelativeInterval interval)
RelativeIntervalcontains in interface RelativeIntervaltrue if this time interval contains the intervalpublic boolean overlaps(RelativeInterval interval)
RelativeIntervaloverlaps in interface RelativeIntervalinterval - the time interval to compare to, null means a zero
length interval nowtrue if the time intervals overlappublic Chronology getChronology()
TimegetChronology in interface Timepublic 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 RelativeInstant getStart()
RelativeIntervalgetStart in interface IntervalgetStart in interface RelativeIntervalpublic RelativeInstant getEnd()
RelativeIntervalgetEnd in interface IntervalgetEnd in interface RelativeIntervalpublic 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 boolean contains(Instant instant)
Intervalpublic 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 intersects(RelativeInterval relativeInterval)
public Duration toStandardDuration()
IntervaltoStandardDuration in interface Interval