com.timeindexing.basic
Class MidPointInterval

java.lang.Object
  extended bycom.timeindexing.basic.AbsoluteInterval
      extended bycom.timeindexing.basic.MidPointInterval
All Implemented Interfaces:
java.lang.Cloneable, Interval

public class MidPointInterval
extends AbsoluteInterval
implements Interval, java.lang.Cloneable

A mid-point interval is an interval where the arguments are a mid-point plus 2 offsets from that mid-point. The interval can be resolved into two positions into an Index. Neither of the specifiers can be adjusted. *


Field Summary
static int ABSOLUTETIMESTAMP_COUNT_COUNT
          A Timestamp to 2 Count specifiers.
static int ABSOLUTETIMESTAMP_RELATIVETIMESTAMP_RELATIVETIMESTAMP
          A Timestamp to 2 Timestamp specifiers.
static int POSITION_COUNT_COUNT
          A Position plus 2 Count specifiers.
static int POSITION_RELATIVETIMESTAMP_RELATIVETIMESTAMP
          A Position plus 2 Timestamp specifiers.
 
Constructor Summary
MidPointInterval(AbsoluteTimestamp t0, Count c1, Count c2)
          Construct an MidPointInterval from a Timestamp and 2 Counts.
MidPointInterval(AbsoluteTimestamp t0, RelativeTimestamp rt1, RelativeTimestamp rt2)
          Construct an MidPointInterval from a Timestamp and 2 RelativeTimestamps.
MidPointInterval(Position p0, Count c1, Count c2)
          Construct an MidPointInterval from a Position and 2 Counts.
MidPointInterval(Position p0, RelativeTimestamp rt1, RelativeTimestamp rt2)
          Construct an MidPointInterval from a Timestamp and 2 RelativeTimestamps.
 
Method Summary
protected  void checkNulls(Value v1, Value v2, Value v3)
          This used to check for nulls in the constructor.
 java.lang.Object clone()
          Clone me
 AbsoluteInterval resolve(Index index, IndexTimestampSelector selector, Lifetime lifetime)
          Resolve this interval w.r.t a specified index.
 java.lang.String toString()
          String version of interval.
 
Methods inherited from class com.timeindexing.basic.AbsoluteInterval
end, isResolved, start
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.timeindexing.basic.Interval
end, start
 

Field Detail

ABSOLUTETIMESTAMP_COUNT_COUNT

public static final int ABSOLUTETIMESTAMP_COUNT_COUNT
A Timestamp to 2 Count specifiers.

See Also:
Constant Field Values

ABSOLUTETIMESTAMP_RELATIVETIMESTAMP_RELATIVETIMESTAMP

public static final int ABSOLUTETIMESTAMP_RELATIVETIMESTAMP_RELATIVETIMESTAMP
A Timestamp to 2 Timestamp specifiers.

See Also:
Constant Field Values

POSITION_COUNT_COUNT

public static final int POSITION_COUNT_COUNT
A Position plus 2 Count specifiers.

See Also:
Constant Field Values

POSITION_RELATIVETIMESTAMP_RELATIVETIMESTAMP

public static final int POSITION_RELATIVETIMESTAMP_RELATIVETIMESTAMP
A Position plus 2 Timestamp specifiers.

See Also:
Constant Field Values
Constructor Detail

MidPointInterval

public MidPointInterval(AbsoluteTimestamp t0,
                        Count c1,
                        Count c2)
Construct an MidPointInterval from a Timestamp and 2 Counts.


MidPointInterval

public MidPointInterval(AbsoluteTimestamp t0,
                        RelativeTimestamp rt1,
                        RelativeTimestamp rt2)
Construct an MidPointInterval from a Timestamp and 2 RelativeTimestamps.


MidPointInterval

public MidPointInterval(Position p0,
                        Count c1,
                        Count c2)
Construct an MidPointInterval from a Position and 2 Counts.


MidPointInterval

public MidPointInterval(Position p0,
                        RelativeTimestamp rt1,
                        RelativeTimestamp rt2)
Construct an MidPointInterval from a Timestamp and 2 RelativeTimestamps.

Method Detail

checkNulls

protected void checkNulls(Value v1,
                          Value v2,
                          Value v3)
This used to check for nulls in the constructor. If no exception is thrown things are good.


resolve

public AbsoluteInterval resolve(Index index,
                                IndexTimestampSelector selector,
                                Lifetime lifetime)
Resolve this interval w.r.t a specified index. The IndexTimestampSelector determines whether to use Index timestamps or Data timestamps. The Lifetime determines whether timestamps are continuous or discrete. This only affects start points and midpoints. Returns a clone with resolved positions.

Specified by:
resolve in class AbsoluteInterval

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clone me

Throws:
java.lang.CloneNotSupportedException

toString

public java.lang.String toString()
String version of interval.