QTimeSeries Homepage

Main Page   Alphabetical List   Compound List   File List   Compound Members  

QTS_Record Class Reference

Represents a record in the time series table. More...

#include <qts_record.h>

List of all members.

Public Methods

 QTS_Record ()
 QTS_Record (const QDateTime &per)
 Constructor for a null record with only a given period. More...

 QTS_Record (const QString &periodStr, double open, double high, double low, double close)
 Constructor for a complete record. More...

 ~QTS_Record ()
 Destructor.

bool parse (const QString &str)
 Parses a record from a string. More...

QString getPeriodString (const QString &format)
 Returns the period of this record as a string in the given format.

QString getPeriodString ()
 Returns the period of this record as a string in the format yyyyMMdd.

QString getPeriodStringEnglish ()
 Returns the period of this record as a string in the format DD-MMM-YY. More...

long getPeriodInt ()
 Returns the period of this record as an int in the format yyyyMMdd.

QString toString ()
 Converts this record into a string.

void updateLines ()
 Updates the graphic representations linked with this record with the record data.

bool isHoliday ()
 Checks if the record is a holiday (contains only null values).


Static Public Methods

QDateTime periodFromString (const QString &periodStr)
 Converts a string into a QDateTime period.

int stringToMonth (const QString &monthStr)
 Gets the month number from a month name. More...

const char * monthToString (int m)
 Gets the three English letter months string for a month.


Public Attributes

QDateTime period
 Period for this record.

double open
 Opening value at beginning of period.

double high
 Max value for the period.

double low
 Min value for the period.

double close
 Closing value at the end of period.

RS_Line * lbar
 Pointer to the line in the graphic representing this records bar.

RS_Line * lopen
 Pointer to the line in the graphic representing this records opening value.

RS_Line * lclose
 Pointer to the line in the graphic representing this records closing value.


Detailed Description

Represents a record in the time series table.

Author:
Andrew Mustun


Constructor & Destructor Documentation

QTS_Record::QTS_Record const QDateTime &    per
 

Constructor for a null record with only a given period.

Parameters:
per  Period of this record.

QTS_Record::QTS_Record const QString &    periodStr,
double    open,
double    high,
double    low,
double    close
 

Constructor for a complete record.

Parameters:
periodStr  Period as a string in the format yyyy-MM-dd
open  Opening value
high  Period's high
low  Period's low
close  Closing value


Member Function Documentation

QString QTS_Record::getPeriodStringEnglish  
 

Returns the period of this record as a string in the format DD-MMM-YY.

e.g. 21-Dec-02. The month is always in English.

bool QTS_Record::parse const QString &    str
 

Parses a record from a string.

Parameters:
str  String in the format <period>,<open>,<high>,<low>,<close>[,<ignored>]
Returns:
true if the string was successfully parsed into a record false otherwise TODO: More sophisticated error handling

int QTS_Record::stringToMonth const QString &    monthStr [static]
 

Gets the month number from a month name.

Parameters:
monthStr  Month in the format 'Jan', 'Feb', ...
Returns:
Month number (1...12)


The documentation for this class was generated from the following files:
Copyright © 2002, Andrew Mustun <andrew@mustun.com>. All rights reserved.
System documentation was generated using doxygen.