public abstract class BaseInterval extends AbstractInterval implements ReadableInterval, Serializable
long
millisecond fields.
This class should generally not be used directly by API users.
The ReadableInterval
interface should be used when different
kinds of interval objects are to be referenced.
BaseInterval subclasses may be mutable and not thread-safe.
Modifier | Constructor and Description |
---|---|
protected |
BaseInterval(long startInstant,
long endInstant,
Chronology chrono)
Constructs an interval from a start and end instant.
|
protected |
BaseInterval(Object interval,
Chronology chrono)
Constructs a time interval converting or copying from another object
that describes an interval.
|
protected |
BaseInterval(ReadableDuration duration,
ReadableInstant end)
Constructs an interval from a millisecond duration and an end instant.
|
protected |
BaseInterval(ReadableInstant start,
ReadableDuration duration)
Constructs an interval from a start instant and a duration.
|
protected |
BaseInterval(ReadableInstant start,
ReadableInstant end)
Constructs an interval from a start and end instant.
|
protected |
BaseInterval(ReadableInstant start,
ReadablePeriod period)
Constructs an interval from a start instant and a time period.
|
protected |
BaseInterval(ReadablePeriod period,
ReadableInstant end)
Constructs an interval from a time period and an end instant.
|
Modifier and Type | Method and Description |
---|---|
Chronology |
getChronology()
Gets the chronology of this interval.
|
long |
getEndMillis()
Gets the end of this time interval which is exclusive.
|
long |
getStartMillis()
Gets the start of this time interval which is inclusive.
|
protected void |
setInterval(long startInstant,
long endInstant,
Chronology chrono)
Sets this interval from two millisecond instants and a chronology.
|
checkInterval, contains, contains, contains, containsNow, equals, getEnd, getStart, hashCode, isAfter, isAfter, isAfter, isAfterNow, isBefore, isBefore, isBefore, isBeforeNow, overlaps, toDuration, toDurationMillis, toInterval, toMutableInterval, toPeriod, toPeriod, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
contains, contains, equals, getEnd, getStart, hashCode, isAfter, isAfter, isBefore, isBefore, overlaps, toDuration, toDurationMillis, toInterval, toMutableInterval, toPeriod, toPeriod, toString
protected BaseInterval(long startInstant, long endInstant, Chronology chrono)
startInstant
- start of this interval, as milliseconds from 1970-01-01T00:00:00Z.endInstant
- end of this interval, as milliseconds from 1970-01-01T00:00:00Z.chrono
- the chronology to use, null is ISO defaultIllegalArgumentException
- if the end is before the startprotected BaseInterval(ReadableInstant start, ReadableInstant end)
start
- start of this interval, null means nowend
- end of this interval, null means nowIllegalArgumentException
- if the end is before the startprotected BaseInterval(ReadableInstant start, ReadableDuration duration)
start
- start of this interval, null means nowduration
- the duration of this interval, null means zero lengthIllegalArgumentException
- if the end is before the startArithmeticException
- if the end instant exceeds the capacity of a longprotected BaseInterval(ReadableDuration duration, ReadableInstant end)
duration
- the duration of this interval, null means zero lengthend
- end of this interval, null means nowIllegalArgumentException
- if the end is before the startArithmeticException
- if the start instant exceeds the capacity of a longprotected BaseInterval(ReadableInstant start, ReadablePeriod period)
When forming the interval, the chronology from the instant is used if present, otherwise the chronology of the period is used.
start
- start of this interval, null means nowperiod
- the period of this interval, null means zero lengthIllegalArgumentException
- if the end is before the startArithmeticException
- if the end instant exceeds the capacity of a longprotected BaseInterval(ReadablePeriod period, ReadableInstant end)
When forming the interval, the chronology from the instant is used if present, otherwise the chronology of the period is used.
period
- the period of this interval, null means zero lengthend
- end of this interval, null means nowIllegalArgumentException
- if the end is before the startArithmeticException
- if the start instant exceeds the capacity of a longprotected BaseInterval(Object interval, Chronology chrono)
interval
- the time interval to copychrono
- the chronology to use, null means let converter decideIllegalArgumentException
- if the interval is invalidpublic Chronology getChronology()
getChronology
in interface ReadableInterval
public long getStartMillis()
getStartMillis
in interface ReadableInterval
public long getEndMillis()
getEndMillis
in interface ReadableInterval
protected void setInterval(long startInstant, long endInstant, Chronology chrono)
startInstant
- the start of the time intervalendInstant
- the start of the time intervalchrono
- the chronology, not nullIllegalArgumentException
- if the end is before the startCopyright © 2012 JBoss by Red Hat. All Rights Reserved.