Description:
This class represents a single time interval tagged with an integer ID value.
Embedded Classes:
TimeInterval::Exception
Data Fields | ||
public | private: double | _start |
public | double | _stop |
public | unsigned int | _id |
Constructors / Destructor | |
public | TimeInterval(double start, double stop, unsigned int id=0)Throws: TimeInterval::Exception |
public | TimeInterval(TimeInterval& interval)Copy constructor. |
Methods | |||
public | virtual | void | set(double start, double stop, unsigned int id=0)Throws: TimeInterval::Exception |
public | virtual | void | start(double start)Set the start time value. |
public | virtual | void | stop(double stop)Set the start time value. |
public | virtual | void | id(int id) |
public | virtual constant |
double | start() |
public | virtual constant |
double | stop() |
public | virtual constant |
unsigned int | id() |
public | virtual | bool | contains(double time)Returns true if the time interval contains the given time. |
public | virtual | bool | overlaps(TimeInterval* interval)Returns true if the time interval covers any of the same time as this one note that the endpoint is not included in the interval, so returns false if the intervals just touch each other. |
public | virtual | bool | touches(TimeInterval* interval)Returns true if the time interval covers any of the same time as this one. |
public | virtual | bool | canMergeWith(TimeInterval* interval)Returns true if two intervals overlap or if they have the same ID and are just touching one another. |
public | virtual | void | mergeWith(TimeInterval* interval)Add another time interval to this one throws an exception if the intervals to not have the same ID or if they do not overlap. |
public | virtual | string | toString() |
Operators | |||
public | bool | const TimeInterval& < const TimeInterval&Returns true if the time intervals do not overlap and the left interval preceeds the right one. | |
public | bool | const TimeInterval& < double | |
public | bool | double < const TimeInterval&Returns true if the given time time comes before the interval. | |
public | bool | TimeInterval& == TimeInterval&Returns true if two intervals have the same start and stop times and ID tag. | |
public | ostream& | ostream& << TimeInterval*Printing operator. |