casa
$Rev:20696$
|
Implementation of TBData for date data. More...
#include <TBData.h>
Public Member Functions | |
TBDataDate (String value, int decimals=TBConstants::DEFAULT_DATE_DECIMALS) | |
Constructor that parses a date from the given String and then stores the human-readable value with the given number of decimals. | |
TBDataDate (double value, int decimals=TBConstants::DEFAULT_DATE_DECIMALS) | |
Constructor that stores the date from the given double and then stores the human-readable value with the given number of decimals. | |
TBDataDate (TBData &data) | |
Constructor that calls setValue(). | |
virtual | ~TBDataDate () |
String | asString () |
Returns the human-readable value. | |
double | asDouble () |
Returns the value. | |
float | asFloat () |
Invalid operations. | |
int | asInt () |
asInt() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as an int. | |
unsigned int | asUInt () |
asUInt() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as an unsigned int. | |
bool | asBool () |
asBool() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a boolean. | |
char | asChar () |
asChar() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a char. | |
unsigned char | asUChar () |
asUChar() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as an unsigned character. | |
short int | asShort () |
asShort() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a short. | |
pair< float, float > | asComplex () |
asComplex() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a complex. | |
pair< double, double > | asDComplex () |
asDComplex() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a double complex. | |
Record * | asRecord () |
asRecord() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a record. | |
void | setValue (TBData &value) |
If the given TBData is a String, parses a date from the String value. | |
String | getType () |
Returns the date type. | |
bool | equals (TBData *data) |
Returns true if the given data is a date type and their values are equal, false otherwise. | |
Private Attributes | |
double | value |
Value. | |
String | valueStr |
Human-readable representation of value. |
Implementation of TBData for date data.
A date is somewhat special in that the data is stored as a double that represents Modified Julian Seconds, but when we view the data we want it in a human-readable form. For this reason, a TBDataDate stores two values: the double representation and the String representation.
casa::TBDataDate::TBDataDate | ( | String | value, |
int | decimals = TBConstants::DEFAULT_DATE_DECIMALS |
||
) |
Constructor that parses a date from the given String and then stores the human-readable value with the given number of decimals.
casa::TBDataDate::TBDataDate | ( | double | value, |
int | decimals = TBConstants::DEFAULT_DATE_DECIMALS |
||
) |
Constructor that stores the date from the given double and then stores the human-readable value with the given number of decimals.
casa::TBDataDate::TBDataDate | ( | TBData & | data | ) |
Constructor that calls setValue().
virtual casa::TBDataDate::~TBDataDate | ( | ) | [virtual] |
bool casa::TBDataDate::asBool | ( | ) | [inline, virtual] |
asBool() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a boolean.
Implements casa::TBData.
char casa::TBDataDate::asChar | ( | ) | [inline, virtual] |
asChar() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a char.
Implements casa::TBData.
pair<float, float> casa::TBDataDate::asComplex | ( | ) | [inline, virtual] |
asComplex() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a complex.
Implements casa::TBData.
pair<double, double> casa::TBDataDate::asDComplex | ( | ) | [inline, virtual] |
asDComplex() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a double complex.
Implements casa::TBData.
double casa::TBDataDate::asDouble | ( | ) | [virtual] |
Returns the value.
Implements casa::TBData.
float casa::TBDataDate::asFloat | ( | ) | [inline, virtual] |
int casa::TBDataDate::asInt | ( | ) | [inline, virtual] |
asInt() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as an int.
Implements casa::TBData.
Record* casa::TBDataDate::asRecord | ( | ) | [inline, virtual] |
asRecord() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a record.
Implements casa::TBData.
short int casa::TBDataDate::asShort | ( | ) | [inline, virtual] |
asShort() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as a short.
Implements casa::TBData.
String casa::TBDataDate::asString | ( | ) | [virtual] |
Returns the human-readable value.
Implements casa::TBData.
unsigned char casa::TBDataDate::asUChar | ( | ) | [inline, virtual] |
asUChar() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as an unsigned character.
Implements casa::TBData.
unsigned int casa::TBDataDate::asUInt | ( | ) | [inline, virtual] |
asUInt() must be implemented by any subclass, although the returned value does not have to be valid for classes for which the value cannot be represented as an unsigned int.
Implements casa::TBData.
bool casa::TBDataDate::equals | ( | TBData * | data | ) | [virtual] |
Returns true if the given data is a date type and their values are equal, false otherwise.
Implements casa::TBData.
String casa::TBDataDate::getType | ( | ) | [inline, virtual] |
void casa::TBDataDate::setValue | ( | TBData & | value | ) | [virtual] |
If the given TBData is a String, parses a date from the String value.
Otherwise, if the given TBData is a double or date, sets the date value.
Implements casa::TBData.
double casa::TBDataDate::value [private] |
String casa::TBDataDate::valueStr [private] |