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 better interval is an interval where the arguments are a mid-point plus 2 values from that mid-point. Neither of the specifiers can be adjusted.

where the values are:


Constructor Summary
MidPointInterval(AbsolutePosition p0, Value v1, Value v2)
          Construct an MidPointInterval from a Position and 2 Values
MidPointInterval(AbsoluteTimestamp t0, Value v1, Value v2)
          Construct an MidPointInterval from a Timestamp and 2 Values
 
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.
protected  Position resolveValue(Index index, TimestampMapping posMid, Value value, IndexTimestampSelector selector, Lifetime lifetime)
          Resolve a Value w.r.t a Position.
 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
 

Constructor Detail

MidPointInterval

public MidPointInterval(AbsoluteTimestamp t0,
                        Value v1,
                        Value v2)
Construct an MidPointInterval from a Timestamp and 2 Values


MidPointInterval

public MidPointInterval(AbsolutePosition p0,
                        Value v1,
                        Value v2)
Construct an MidPointInterval from a Position and 2 Values

Method Detail

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

resolveValue

protected Position resolveValue(Index index,
                                TimestampMapping posMid,
                                Value value,
                                IndexTimestampSelector selector,
                                Lifetime lifetime)
Resolve a Value w.r.t a Position.


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.


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.