Rogue Wave Views Foundation Package API Reference Guide |
Rogue Wave Views Documentation Home |
Holds a time interval. More...
#include <ilviews/graphics/timescale.h>
Public Member Functions | |
IlvTimeInterval (IlDate startTime, IlDate endTime) | |
Constructor. More... | |
IlvTimeInterval (IlDate startTime, IlvDuration duration) | |
Constructor. More... | |
IlvDuration | getDuration () |
Returns the duration between the interval start and end times. | |
IlDate | getEnd () |
Returns the interval end time. | |
IlDate | getStart () |
Returns the interval start time. More... | |
void | setDuration (IlvDuration duration) |
Sets the duration between the interval start and end times. More... | |
void | setEnd (IlDate end) |
Sets the interval end time. More... | |
void | setInterval (IlDate start, IlDate end) |
Sets the interval start and end times. More... | |
void | setIntervalDuration (IlDate start, IlvDuration duration) |
Sets the interval start time and duration. More... | |
void | setStart (IlDate start) |
Sets the interval start time. More... | |
Protected Member Functions | |
void | normalize () |
Normalize the start and end times. More... | |
Holds a time interval.
Library: views
Instances of this class represent a specific time span, with millisecond precision. The time interval is defined by a start time and an end time. IlvTimeInterval
maintains the invariant that its start time is always before or equal to its end time. This invariant is maintained quietly, swapping its start and end time values as needed.
IlvTimeInterval::IlvTimeInterval | ( | IlDate | startTime, |
IlDate | endTime | ||
) |
Constructor.
Initializes a new IlvTimeInterval
with the specified start and end times.
startTime | The interval start time. |
endTime | The interval end time. |
IlvTimeInterval::IlvTimeInterval | ( | IlDate | startTime, |
IlvDuration | duration | ||
) |
Constructor.
Initializes a new IlvTimeInterval
with the specified start time and duration.
startTime | The interval start time. |
duration | The interval duration. |
IlDate IlvTimeInterval::getStart | ( | ) |
Returns the interval start time.
IlDate
at which the interval starts.
|
protected |
Normalize the start and end times.
Enforces the invariant that the interval start time must fall before or equal to its end time. The interval start and end time values are swapped if necessary.
void IlvTimeInterval::setDuration | ( | IlvDuration | duration | ) |
Sets the duration between the interval start and end times.
The invariant is maintained that the interval start time must always be before or equal to its end time. Therefore, if duration < 0
then the interval's current start time will silently become its end time.
duration | The duration of the interval. |
void IlvTimeInterval::setEnd | ( | IlDate | end | ) |
Sets the interval end time.
The invariant is maintained that the interval start time must always be before or equal to its end time. Therefore, if t < getStart()
then t
will actually become the interval's new start time and its previous start time will become its new end time.
end | The end time of the interval. |
void IlvTimeInterval::setInterval | ( | IlDate | start, |
IlDate | end | ||
) |
Sets the interval start and end times.
The invariant is maintained that the interval start time must always be before or equal to its end time. Therefore, if end < start
then the values will be silently swapped and start
will actually become the interval's new end time and end
will become the interval's new start time.
start | The start time of the interval. |
end | The end time of the interval. |
void IlvTimeInterval::setIntervalDuration | ( | IlDate | start, |
IlvDuration | duration | ||
) |
Sets the interval start time and duration.
The invariant is maintained that the interval start time must always be before or equal to its end time. Therefore, if duration < 0
then start
will silently become the interval's new end time.
start | The start time of the interval. |
duration | The duration of the interval. |
void IlvTimeInterval::setStart | ( | IlDate | start | ) |
Sets the interval start time.
The invariant is maintained that the interval start time must always be before or equal to its end time. Therefore, if t > getEnd()
then t
will actually become the interval's new end time and its previous end time will become its new start time.
start | The start time of the interval. |
© Copyright 2016, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.