| java.lang.Object org.joda.time.base.AbstractInterval org.joda.time.base.BaseInterval
All known Subclasses: org.joda.time.Interval, org.joda.time.MutableInterval,
BaseInterval | abstract public class BaseInterval extends AbstractInterval implements ReadableInterval,Serializable(Code) | | BaseInterval is an abstract implementation of ReadableInterval that stores
data in two 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.
author: Brian S O'Neill author: Sean Geoghegan author: Stephen Colebourne since: 1.0 |
Method Summary | |
public Chronology | getChronology() Gets the chronology of this interval. | public long | getEndMillis() Gets the end of this time interval which is exclusive. | public 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. |
BaseInterval | protected BaseInterval(long startInstant, long endInstant, Chronology chrono)(Code) | | Constructs an interval from a start and end instant.
Parameters: startInstant - start of this interval, as milliseconds from 1970-01-01T00:00:00Z. Parameters: endInstant - end of this interval, as milliseconds from 1970-01-01T00:00:00Z. Parameters: chrono - the chronology to use, null is ISO default throws: IllegalArgumentException - if the end is before the start |
BaseInterval | protected BaseInterval(ReadableInstant start, ReadableInstant end)(Code) | | Constructs an interval from a start and end instant.
Parameters: start - start of this interval, null means now Parameters: end - end of this interval, null means now throws: IllegalArgumentException - if the end is before the start |
BaseInterval | protected BaseInterval(ReadableInstant start, ReadableDuration duration)(Code) | | Constructs an interval from a start instant and a duration.
Parameters: start - start of this interval, null means now Parameters: duration - the duration of this interval, null means zero length throws: IllegalArgumentException - if the end is before the start throws: ArithmeticException - if the end instant exceeds the capacity of a long |
BaseInterval | protected BaseInterval(ReadableDuration duration, ReadableInstant end)(Code) | | Constructs an interval from a millisecond duration and an end instant.
Parameters: duration - the duration of this interval, null means zero length Parameters: end - end of this interval, null means now throws: IllegalArgumentException - if the end is before the start throws: ArithmeticException - if the start instant exceeds the capacity of a long |
BaseInterval | protected BaseInterval(ReadableInstant start, ReadablePeriod period)(Code) | | Constructs an interval from a start instant and a time period.
When forming the interval, the chronology from the instant is used
if present, otherwise the chronology of the period is used.
Parameters: start - start of this interval, null means now Parameters: period - the period of this interval, null means zero length throws: IllegalArgumentException - if the end is before the start throws: ArithmeticException - if the end instant exceeds the capacity of a long |
BaseInterval | protected BaseInterval(ReadablePeriod period, ReadableInstant end)(Code) | | Constructs an interval from a time period and an end instant.
When forming the interval, the chronology from the instant is used
if present, otherwise the chronology of the period is used.
Parameters: period - the period of this interval, null means zero length Parameters: end - end of this interval, null means now throws: IllegalArgumentException - if the end is before the start throws: ArithmeticException - if the start instant exceeds the capacity of a long |
BaseInterval | protected BaseInterval(Object interval, Chronology chrono)(Code) | | Constructs a time interval converting or copying from another object
that describes an interval.
Parameters: interval - the time interval to copy Parameters: chrono - the chronology to use, null means let converter decide throws: IllegalArgumentException - if the interval is invalid |
getChronology | public Chronology getChronology()(Code) | | Gets the chronology of this interval.
the chronology |
getEndMillis | public long getEndMillis()(Code) | | Gets the end of this time interval which is exclusive.
the end of the time interval,millisecond instant from 1970-01-01T00:00:00Z |
getStartMillis | public long getStartMillis()(Code) | | Gets the start of this time interval which is inclusive.
the start of the time interval,millisecond instant from 1970-01-01T00:00:00Z |
setInterval | protected void setInterval(long startInstant, long endInstant, Chronology chrono)(Code) | | Sets this interval from two millisecond instants and a chronology.
Parameters: startInstant - the start of the time interval Parameters: endInstant - the start of the time interval Parameters: chrono - the chronology, not null throws: IllegalArgumentException - if the end is before the start |
|
|