rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

List of all members | Public Member Functions
IlTimeUnit Class Referenceabstract

Base class representing a time unit (second, hour, year...). More...

#include <ilog/date.h>

Inheritance diagram for IlTimeUnit:
IlTimeUnitDay IlTimeUnitHour IlTimeUnitMilliSecond IlTimeUnitMinute IlTimeUnitMonth IlTimeUnitQuarter IlTimeUnitSecond IlTimeUnitWeek IlTimeUnitYear

Public Member Functions

 IlTimeUnit ()
 Constructor.
 
virtual void addTimeUnit (IlCalendar &date) const =0
 Increments the given IlCalendar date by the time unit. More...
 
virtual IlTimeUnitcopy () const =0
 Returns an IlTimeUnit of the same type as the current object.
 
virtual IlDouble getMillis () const =0
 Returns the duration of this time unit in milliseconds.
 
virtual void snapToPreviousTimeUnit (IlCalendar &cal) const =0
 Snaps the given IlCalendar date to the previous time unit. More...
 
virtual char * toString (IlDouble date) const =0
 Returns a string representing the date according to this unit. More...
 

Detailed Description

Base class representing a time unit (second, hour, year...).

Library: ilog

IlTimeUnit is the base class from which time unit classes are derived (seconds, minutes, days, weeks, and so on).

See Also
IlvTimeScaleStepsUpdater

Member Function Documentation

virtual void IlTimeUnit::addTimeUnit ( IlCalendar date) const
pure virtual

Increments the given IlCalendar date by the time unit.

For instance, if the unit is minutes, adds one minute to the date.

Implemented in IlTimeUnitYear, IlTimeUnitQuarter, IlTimeUnitMonth, IlTimeUnitWeek, IlTimeUnitDay, IlTimeUnitHour, IlTimeUnitMinute, IlTimeUnitSecond, and IlTimeUnitMilliSecond.

virtual void IlTimeUnit::snapToPreviousTimeUnit ( IlCalendar cal) const
pure virtual

Snaps the given IlCalendar date to the previous time unit.

For instance, if the unit is minutes, seconds and milliseconds will be set to 0.

Implemented in IlTimeUnitYear, IlTimeUnitQuarter, IlTimeUnitMonth, IlTimeUnitWeek, IlTimeUnitDay, IlTimeUnitHour, IlTimeUnitMinute, IlTimeUnitSecond, and IlTimeUnitMilliSecond.

virtual char* IlTimeUnit::toString ( IlDouble  date) const
pure virtual

Returns a string representing the date according to this unit.

Returns an allocated string, which should be deleted with delete[].

Parameters
date: the date to convert.

Implemented in IlTimeUnitYear, IlTimeUnitQuarter, IlTimeUnitMonth, IlTimeUnitWeek, IlTimeUnitDay, IlTimeUnitHour, IlTimeUnitMinute, IlTimeUnitSecond, and IlTimeUnitMilliSecond.


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