rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvTimeInterval Class Reference

Holds a time interval. More...

#include <ilviews/graphics/timescale.h>

List of all members.

Public Member Functions

 IlvTimeInterval (IlDate startTime, IlvDuration duration)
 Constructor.
 IlvTimeInterval (IlDate startTime, IlDate endTime)
 Constructor.
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.
void setDuration (IlvDuration duration)
 Sets the duration between the interval start and end times.
void setEnd (IlDate end)
 Sets the interval end time.
void setInterval (IlDate start, IlDate end)
 Sets the interval start and end times.
void setIntervalDuration (IlDate start, IlvDuration duration)
 Sets the interval start time and duration.
void setStart (IlDate start)
 Sets the interval start time.

Protected Member Functions

void normalize ()
 Normalize the start and end times.

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

Parameters:
startTime The interval start time.
duration The 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:
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.

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

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

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

Parameters:
start The start time of the interval.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, 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.