Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::FieldValue Class Reference

#include <SimpleDB.h>

Collaboration diagram for PLearn::FieldValue:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FieldValue ()
 Default construction and copy construction.

 FieldValue (const FieldValue &fv)
 ~FieldValue ()
 FieldValue (const char *)
 Constructors from concrete values.

 FieldValue (unsigned char)
 FieldValue (signed char)
 FieldValue (short)
 FieldValue (int)
 FieldValue (float)
 FieldValue (double)
 FieldValue (const PDate &)
bool isMissing () const
 Missing value handling.

void setMissing ()
string toString () const
 Conversion to strings and doubles.

double toDouble () const
PDate toDate () const
 operator double () const
 operator float () const
 operator int () const
 operator string () const
 operator PDate () const
FieldValueoperator= (FieldValue)
 --- Pseudo-polymorphic operations Assignment

bool operator== (const FieldValue &) const
 Relational (relational operations don't always make sense).

bool operator< (const FieldValue &) const
bool operator!= (const FieldValue &rhs) const
bool operator<= (const FieldValue &rhs) const
bool operator> (const FieldValue &rhs) const
bool operator>= (const FieldValue &rhs) const
FieldValue operator+ (const FieldValue &) const
 Arithmetic (again, these don't always make sense).

FieldValue operator- (const FieldValue &) const
FieldValue operator * (const FieldValue &) const
FieldValue operator/ (const FieldValue &) const
void swap (FieldValue &)
 Swap the guts of this with someone else.

bool isString () const
 Some useful type-checking predicates.

bool isIntegral () const
bool isFloating () const
bool isDate () const

Private Attributes

FieldType field_type_
int precision_

Detailed Description

A FieldValue is intended to encapsulate all polyphormic operations (copy, comparison, conversion to/from string, double, etc.) on the values of a SimpleDB field.

Definition at line 236 of file SimpleDB.h.


Constructor & Destructor Documentation

PLearn::FieldValue::FieldValue  ) 
 

Default construction and copy construction.

Definition at line 101 of file SimpleDB.cc.

References PLearn::Unknown.

Referenced by operator *(), operator+(), operator-(), and operator/().

PLearn::FieldValue::FieldValue const FieldValue fv  ) 
 

Definition at line 105 of file SimpleDB.cc.

References PLearn::CharacterType, date_val_, PLearn::DateType, double_val_, PLearn::DoubleType, field_type_, PLearn::FloatType, PLearn::IntType, long_val_, PLERROR, precision_, PLearn::ShortType, PLearn::SignedCharType, string_val_, PLearn::StringType, PLearn::strlen(), and PLearn::Unknown.

PLearn::FieldValue::~FieldValue  ) 
 

Definition at line 140 of file SimpleDB.cc.

References PLearn::CharacterType, PLearn::DateType, PLearn::DoubleType, field_type_, PLearn::FloatType, PLearn::IntType, PLearn::ShortType, PLearn::SignedCharType, string_val_, PLearn::StringType, and PLearn::Unknown.

PLearn::FieldValue::FieldValue const char *   )  [explicit]
 

Constructors from concrete values.

Definition at line 158 of file SimpleDB.cc.

References precision_, string_val_, and PLearn::StringType.

PLearn::FieldValue::FieldValue unsigned  char  )  [explicit]
 

Definition at line 165 of file SimpleDB.cc.

References PLearn::CharacterType, and x.

PLearn::FieldValue::FieldValue signed  char  )  [explicit]
 

Definition at line 171 of file SimpleDB.cc.

References PLearn::SignedCharType, and x.

PLearn::FieldValue::FieldValue short   )  [explicit]
 

Definition at line 177 of file SimpleDB.cc.

References PLearn::ShortType, and x.

PLearn::FieldValue::FieldValue int   )  [explicit]
 

Definition at line 183 of file SimpleDB.cc.

References PLearn::IntType, and x.

PLearn::FieldValue::FieldValue float   )  [explicit]
 

Definition at line 189 of file SimpleDB.cc.

References PLearn::FloatType, and x.

PLearn::FieldValue::FieldValue double   )  [explicit]
 

Definition at line 195 of file SimpleDB.cc.

References PLearn::DoubleType, and x.

PLearn::FieldValue::FieldValue const PDate  )  [explicit]
 

Definition at line 201 of file SimpleDB.cc.

References date_val_, PLearn::DateType, PLearn::FieldValue::DateVal_t::day, PLearn::FieldValue::DateVal_t::month, x, and PLearn::FieldValue::DateVal_t::year.


Member Function Documentation

bool PLearn::FieldValue::isDate  )  const [inline]
 

Definition at line 320 of file SimpleDB.h.

References PLearn::DateType, and field_type_.

Referenced by PLearn::SDBVMFieldDateDiff::convertField(), and PLearn::FieldRowRef::operator=().

bool PLearn::FieldValue::isFloating  )  const [inline]
 

Definition at line 316 of file SimpleDB.h.

References PLearn::DoubleType, field_type_, and PLearn::FloatType.

Referenced by operator *(), operator+(), operator-(), operator/(), operator<(), PLearn::FieldRowRef::operator=(), and operator==().

bool PLearn::FieldValue::isIntegral  )  const [inline]
 

Definition at line 310 of file SimpleDB.h.

References PLearn::CharacterType, field_type_, PLearn::IntType, PLearn::ShortType, and PLearn::SignedCharType.

Referenced by PLearn::SDBVMFieldDateDiff::convertField(), operator *(), operator+(), operator-(), operator/(), operator<(), PLearn::FieldRowRef::operator=(), and operator==().

bool PLearn::FieldValue::isMissing  )  const
 

Missing value handling.

Definition at line 210 of file SimpleDB.cc.

References PLearn::CharacterType, date_val_, PLearn::DateType, PLearn::PDate::day, PLearn::FieldValue::DateVal_t::day, double_val_, PLearn::DoubleType, field_type_, PLearn::FloatType, PLearn::IntType, long_val_, PLearn::MissingCharacter, PLearn::MissingDate, PLearn::MissingInt, PLearn::MissingShort, PLearn::MissingSignedChar, PLearn::MissingString, PLearn::PDate::month, PLearn::FieldValue::DateVal_t::month, PLearn::ShortType, PLearn::SignedCharType, string_val_, PLearn::StringType, PLearn::Unknown, PLearn::PDate::year, and PLearn::FieldValue::DateVal_t::year.

Referenced by PLearn::SDBVMFieldDateDiff::convertField(), PLearn::SDBVMFieldRemapIntervals::getDiscreteValue(), PLearn::SDBVMFieldRemapStrings::getDiscreteValue(), PLearn::SDBVMFieldRemapReals::getDiscreteValue(), PLearn::SDBVMFieldCodeAsIs::getDiscreteValue(), PLearn::SDBVMFieldDateGreater::getDiscreteValue(), toDouble(), and toString().

bool PLearn::FieldValue::isString  )  const [inline]
 

Some useful type-checking predicates.

Definition at line 306 of file SimpleDB.h.

References field_type_, and PLearn::StringType.

FieldValue PLearn::FieldValue::operator * const FieldValue  )  const
 

Definition at line 468 of file SimpleDB.cc.

References PLearn::CharacterType, PLearn::DateType, double_val_, field_type_, PLearn::FieldType, FieldValue(), isFloating(), isIntegral(), long_val_, PLERROR, and PLearn::StringType.

PLearn::FieldValue::operator double  )  const [inline]
 

Definition at line 265 of file SimpleDB.h.

References toDouble().

PLearn::FieldValue::operator float  )  const [inline]
 

Definition at line 266 of file SimpleDB.h.

References toDouble().

PLearn::FieldValue::operator int  )  const [inline]
 

Definition at line 267 of file SimpleDB.h.

References toDouble().

PLearn::FieldValue::operator PDate  )  const [inline]
 

Definition at line 269 of file SimpleDB.h.

References toDate().

PLearn::FieldValue::operator string  )  const [inline]
 

Definition at line 268 of file SimpleDB.h.

References toString().

bool PLearn::FieldValue::operator!= const FieldValue rhs  )  const [inline]
 

Definition at line 280 of file SimpleDB.h.

FieldValue PLearn::FieldValue::operator+ const FieldValue  )  const
 

Arithmetic (again, these don't always make sense).

Definition at line 396 of file SimpleDB.cc.

References PLearn::CharacterType, PLearn::DateType, double_val_, field_type_, PLearn::FieldType, FieldValue(), isFloating(), isIntegral(), long_val_, PLERROR, and PLearn::StringType.

FieldValue PLearn::FieldValue::operator- const FieldValue  )  const
 

Definition at line 429 of file SimpleDB.cc.

References PLearn::CharacterType, date_val_, PLearn::DateType, PLearn::FieldValue::DateVal_t::day, double_val_, field_type_, PLearn::FieldType, FieldValue(), isFloating(), isIntegral(), long_val_, PLearn::FieldValue::DateVal_t::month, PLERROR, PLearn::StringType, and PLearn::FieldValue::DateVal_t::year.

FieldValue PLearn::FieldValue::operator/ const FieldValue  )  const
 

Definition at line 501 of file SimpleDB.cc.

References PLearn::CharacterType, PLearn::DateType, double_val_, field_type_, PLearn::FieldType, FieldValue(), isFloating(), isIntegral(), long_val_, PLERROR, and PLearn::StringType.

bool PLearn::FieldValue::operator< const FieldValue  )  const
 

Definition at line 355 of file SimpleDB.cc.

References date_val_, PLearn::DateType, PLearn::FieldValue::DateVal_t::day, double_val_, field_type_, PLearn::FieldType, isFloating(), isIntegral(), long_val_, PLearn::FieldValue::DateVal_t::month, PLERROR, string_val_, PLearn::StringType, and PLearn::FieldValue::DateVal_t::year.

bool PLearn::FieldValue::operator<= const FieldValue rhs  )  const [inline]
 

Definition at line 284 of file SimpleDB.h.

FieldValue & PLearn::FieldValue::operator= FieldValue   ) 
 

--- Pseudo-polymorphic operations Assignment

Definition at line 308 of file SimpleDB.cc.

References PLearn::swap().

bool PLearn::FieldValue::operator== const FieldValue  )  const
 

Relational (relational operations don't always make sense).

Definition at line 314 of file SimpleDB.cc.

References date_val_, PLearn::DateType, PLearn::FieldValue::DateVal_t::day, double_val_, field_type_, PLearn::FieldType, isFloating(), isIntegral(), long_val_, PLearn::FieldValue::DateVal_t::month, PLERROR, string_val_, PLearn::StringType, and PLearn::FieldValue::DateVal_t::year.

bool PLearn::FieldValue::operator> const FieldValue rhs  )  const [inline]
 

Definition at line 288 of file SimpleDB.h.

bool PLearn::FieldValue::operator>= const FieldValue rhs  )  const [inline]
 

Definition at line 292 of file SimpleDB.h.

void PLearn::FieldValue::setMissing  ) 
 

Definition at line 229 of file SimpleDB.cc.

References PLearn::CharacterType, date_val_, PLearn::DateType, PLearn::PDate::day, PLearn::FieldValue::DateVal_t::day, double_val_, PLearn::DoubleType, field_type_, PLearn::FloatType, PLearn::IntType, long_val_, PLearn::MissingCharacter, PLearn::MissingDate, PLearn::MissingDouble, PLearn::MissingInt, PLearn::MissingShort, PLearn::MissingSignedChar, PLearn::MissingString, PLearn::PDate::month, PLearn::FieldValue::DateVal_t::month, PLearn::ShortType, PLearn::SignedCharType, string_val_, PLearn::StringType, PLearn::Unknown, PLearn::PDate::year, and PLearn::FieldValue::DateVal_t::year.

Referenced by PLearn::SDBVMFieldDateDiff::convertField().

void PLearn::FieldValue::swap FieldValue  ) 
 

Swap the guts of this with someone else.

Definition at line 534 of file SimpleDB.cc.

References PLearn::CharacterType, date_val_, PLearn::DateType, double_val_, PLearn::DoubleType, field_type_, PLearn::FloatType, PLearn::IntType, long_val_, precision_, PLearn::ShortType, PLearn::SignedCharType, string_val_, PLearn::StringType, and PLearn::Unknown.

PDate PLearn::FieldValue::toDate  )  const
 

Definition at line 296 of file SimpleDB.cc.

References date_val_, PLearn::DateType, PLearn::FieldValue::DateVal_t::day, field_type_, PLearn::FieldValue::DateVal_t::month, PLERROR, and PLearn::FieldValue::DateVal_t::year.

Referenced by PLearn::SDBVMFieldICBCTargets::convertField(), PLearn::SDBVMFieldDateDiff::convertField(), PLearn::SDBVMFieldDateGreater::getDiscreteValue(), and operator PDate().

double PLearn::FieldValue::toDouble  )  const
 

Definition at line 267 of file SimpleDB.cc.

References PLearn::CharacterType, PLearn::date_to_float(), date_val_, PLearn::DateType, PLearn::FieldValue::DateVal_t::day, double_val_, PLearn::DoubleType, field_type_, PLearn::FloatType, PLearn::IntType, isMissing(), long_val_, MISSING_VALUE, PLearn::FieldValue::DateVal_t::month, PLERROR, PLearn::ShortType, PLearn::SignedCharType, PLearn::StringType, PLearn::Unknown, and PLearn::FieldValue::DateVal_t::year.

Referenced by operator double(), operator float(), and operator int().

string PLearn::FieldValue::toString  )  const
 

Conversion to strings and doubles.

Definition at line 248 of file SimpleDB.cc.

References PLearn::CharacterType, date_val_, PLearn::DateType, PLearn::FieldValue::DateVal_t::day, double_val_, PLearn::DoubleType, field_type_, PLearn::FloatType, PLearn::IntType, isMissing(), long_val_, PLearn::FieldValue::DateVal_t::month, PLearn::ShortType, PLearn::SignedCharType, PLearn::space_to_underscore(), string_val_, PLearn::StringType, PLearn::tostring(), PLearn::Unknown, and PLearn::FieldValue::DateVal_t::year.

Referenced by operator string(), PLearn::operator<<(), and PLearn::FieldRowRef::operator=().


Member Data Documentation

struct DateVal_t PLearn::FieldValue::date_val_ [private]
 

Definition at line 335 of file SimpleDB.h.

Referenced by FieldValue(), isMissing(), operator-(), operator<(), PLearn::FieldRowRef::operator=(), operator==(), setMissing(), swap(), toDate(), toDouble(), and toString().

double PLearn::FieldValue::double_val_ [private]
 

Definition at line 334 of file SimpleDB.h.

Referenced by FieldValue(), isMissing(), operator *(), operator+(), operator-(), operator/(), operator<(), PLearn::FieldRowRef::operator=(), operator==(), setMissing(), swap(), toDouble(), and toString().

FieldType PLearn::FieldValue::field_type_ [private]
 

Definition at line 325 of file SimpleDB.h.

Referenced by FieldValue(), isDate(), isFloating(), isIntegral(), isMissing(), isString(), operator *(), operator+(), operator-(), operator/(), operator<(), operator==(), setMissing(), swap(), toDate(), toDouble(), toString(), and ~FieldValue().

long PLearn::FieldValue::long_val_ [private]
 

Definition at line 333 of file SimpleDB.h.

Referenced by FieldValue(), isMissing(), operator *(), operator+(), operator-(), operator/(), operator<(), PLearn::FieldRowRef::operator=(), operator==(), setMissing(), swap(), toDouble(), and toString().

int PLearn::FieldValue::precision_ [private]
 

Definition at line 326 of file SimpleDB.h.

Referenced by FieldValue(), and swap().

char* PLearn::FieldValue::string_val_ [private]
 

Definition at line 332 of file SimpleDB.h.

Referenced by FieldValue(), isMissing(), operator<(), operator==(), setMissing(), swap(), toString(), and ~FieldValue().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:23:03 2004 for PLearn by doxygen 1.3.7