Rogue Wave Views
Foundation Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions | Protected Member Functions
IlvTimeInterval Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

IlvTimeInterval::IlvTimeInterval ( IlDate  startTime,
IlDate  endTime 
)

Constructor.

Initializes a new IlvTimeInterval with the specified start and end times.

Parameters
startTimeThe interval start time.
endTimeThe interval end time.
IlvTimeInterval::IlvTimeInterval ( IlDate  startTime,
IlvDuration  duration 
)

Constructor.

Initializes a new IlvTimeInterval with the specified start time and duration.

Parameters
startTimeThe interval start time.
durationThe interval duration.

Member Function Documentation

IlDate IlvTimeInterval::getStart ( )

Returns the interval start time.

Returns
the IlDate at which the interval starts.
void IlvTimeInterval::normalize ( )
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.

Parameters
durationThe 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.

Parameters
endThe 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.

Parameters
startThe start time of the interval.
endThe 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.

Parameters
startThe start time of the interval.
durationThe 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.

Parameters
startThe 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.