NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
|
Abstract table column, which allows using it to compose the data table in each Memory instance. More...
#include <tablecolumn.hpp>
Public Types | |
enum | ColumnType { TYPE_NONE , VALUELIKE , TYPE_VALUE , TYPE_DATETIME , TYPE_LOGICAL , TYPE_CATEGORICAL , STRINGLIKE , TYPE_STRING , TYPE_MIXED } |
Public Member Functions | |
TableColumn () | |
virtual | ~TableColumn () |
std::vector< std::string > | getValueAsString (const VectorIndex &idx) const |
Return the table column's contents as a vector of strings. More... | |
std::vector< std::string > | getValueAsInternalString (const VectorIndex &idx) const |
Returns the table column's contents as a vector containing internal strings. More... | |
std::vector< mu::value_type > | getValue (const VectorIndex &idx) const |
Return the table column's contents as a vector of numerical types. More... | |
virtual std::string | getValueAsString (size_t elem) const =0 |
virtual std::string | getValueAsInternalString (size_t elem) const =0 |
virtual std::string | getValueAsParserString (size_t elem) const =0 |
virtual std::string | getValueAsStringLiteral (size_t elem) const =0 |
virtual mu::value_type | getValue (size_t elem) const =0 |
void | setValue (const VectorIndex &idx, const std::vector< std::string > &vValue) |
Sets a string vector at the specified indices. More... | |
void | setValue (const VectorIndex &idx, const std::vector< mu::value_type > &vValue) |
Sets a numerical vector at the specified indices. More... | |
void | setValue (const VectorIndex &idx, mu::value_type *_dData, unsigned int _nNum) |
Sets a plain numerical array at the specified indices. More... | |
virtual void | setValue (size_t elem, const std::string &sValue)=0 |
virtual void | setValue (size_t elem, const mu::value_type &vValue)=0 |
TableColumn * | copy () const |
Simplification wrapper around the indiced copy method to copy the whole column. More... | |
virtual TableColumn * | copy (const VectorIndex &idx) const =0 |
virtual void | assign (const TableColumn *column)=0 |
virtual void | insert (const VectorIndex &idx, const TableColumn *column)=0 |
virtual void | deleteElements (const VectorIndex &idx)=0 |
void | shrink () |
Shrink the column by removing all invalid elements from the end. More... | |
virtual void | insertElements (size_t pos, size_t elem)=0 |
virtual void | appendElements (size_t elem)=0 |
virtual void | removeElements (size_t pos, size_t elem)=0 |
virtual void | resize (size_t elem)=0 |
virtual int | compare (int i, int j, bool flag) const =0 |
virtual bool | isValid (int elem) const =0 |
virtual bool | asBool (int elem) const =0 |
virtual size_t | size () const =0 |
virtual size_t | getBytes () const =0 |
size_t | getNumFilledElements () const |
Return the number of actual filled elements in this column, which can be different from the actual size of the column. More... | |
virtual TableColumn * | convert (ColumnType type=TableColumn::TYPE_NONE)=0 |
Static Public Member Functions | |
static std::string | getDefaultColumnHead (size_t colNo) |
Creates a default column headline for a column, which can be used without an instance of this class. More... | |
static std::string | typeToString (ColumnType type) |
Converts the passed ColumnType value to a string representation. More... | |
static ColumnType | stringToType (const std::string &sType) |
Converts the passed string representation to a ColumnType value. More... | |
static std::vector< std::string > | getTypesAsString () |
Returns a list of all available column types as strings. More... | |
Public Attributes | |
std::string | m_sHeadLine |
ColumnType | m_type |
Abstract table column, which allows using it to compose the data table in each Memory instance.
Definition at line 33 of file tablecolumn.hpp.
Enumerator | |
---|---|
TYPE_NONE | |
VALUELIKE | |
TYPE_VALUE | |
TYPE_DATETIME | |
TYPE_LOGICAL | |
TYPE_CATEGORICAL | |
STRINGLIKE | |
TYPE_STRING | |
TYPE_MIXED |
Definition at line 35 of file tablecolumn.hpp.
|
inline |
Definition at line 51 of file tablecolumn.hpp.
|
inlinevirtual |
Definition at line 52 of file tablecolumn.hpp.
|
pure virtual |
Implemented in StringColumn, CategoricalColumn, ValueColumn, DateTimeColumn, and LogicalColumn.
|
pure virtual |
Implemented in ValueColumn, DateTimeColumn, LogicalColumn, StringColumn, and CategoricalColumn.
|
pure virtual |
Implemented in ValueColumn, DateTimeColumn, LogicalColumn, StringColumn, and CategoricalColumn.
|
pure virtual |
Implemented in StringColumn, CategoricalColumn, ValueColumn, DateTimeColumn, and LogicalColumn.
|
pure virtual |
Implemented in ValueColumn, DateTimeColumn, LogicalColumn, StringColumn, and CategoricalColumn.
Referenced by convert_if_needed().
TableColumn * TableColumn::copy | ( | ) | const |
Simplification wrapper around the indiced copy method to copy the whole column.
Definition at line 163 of file tablecolumn.cpp.
References copy(), and VectorIndex::OPEN_END.
Referenced by copy().
|
pure virtual |
Implemented in ValueColumn, DateTimeColumn, LogicalColumn, StringColumn, and CategoricalColumn.
|
pure virtual |
Implemented in ValueColumn, DateTimeColumn, LogicalColumn, StringColumn, and CategoricalColumn.
|
pure virtual |
Implemented in ValueColumn, DateTimeColumn, LogicalColumn, StringColumn, and CategoricalColumn.
|
static |
Creates a default column headline for a column, which can be used without an instance of this class.
colNo | size_t |
Definition at line 222 of file tablecolumn.cpp.
References _lang, Language::get(), and toString().
Referenced by NumeRe::TextDataFile::calculateColumnWidths(), convert_for_overwrite(), convert_if_empty(), Memory::createTableHeaders(), NumeRe::Table::getCleanHead(), NumeRe::Table::getCleanHeadPart(), NumeRe::Table::getHead(), Memory::getHeadLineElement(), and NumeRe::GenericFile::getLineFromHead().
size_t TableColumn::getNumFilledElements | ( | ) | const |
Return the number of actual filled elements in this column, which can be different from the actual size of the column.
Definition at line 201 of file tablecolumn.cpp.
References isValid(), and size().
|
static |
Returns a list of all available column types as strings.
Definition at line 292 of file tablecolumn.cpp.
Referenced by TableViewer::changeColType().
std::vector< mu::value_type > TableColumn::getValue | ( | const VectorIndex & | idx | ) | const |
Return the table column's contents as a vector of numerical types.
idx | const VectorIndex& |
Definition at line 78 of file tablecolumn.cpp.
References getValue(), VectorIndex::setOpenEndIndex(), VectorIndex::size(), and size().
Referenced by getValue(), DateTimeColumn::insert(), and LogicalColumn::insert().
|
pure virtual |
Implemented in ValueColumn, DateTimeColumn, LogicalColumn, StringColumn, and CategoricalColumn.
std::vector< std::string > TableColumn::getValueAsInternalString | ( | const VectorIndex & | idx | ) | const |
Returns the table column's contents as a vector containing internal strings.
idx | const VectorIndex& |
Definition at line 56 of file tablecolumn.cpp.
References getValueAsInternalString(), VectorIndex::setOpenEndIndex(), VectorIndex::size(), and size().
Referenced by CategoricalColumn::convert(), Memory::getRank(), getValueAsInternalString(), and CategoricalColumn::insert().
|
pure virtual |
Implemented in ValueColumn, DateTimeColumn, LogicalColumn, StringColumn, and CategoricalColumn.
|
pure virtual |
Implemented in ValueColumn, DateTimeColumn, LogicalColumn, StringColumn, and CategoricalColumn.
std::vector< std::string > TableColumn::getValueAsString | ( | const VectorIndex & | idx | ) | const |
Return the table column's contents as a vector of strings.
idx | const VectorIndex& |
Definition at line 34 of file tablecolumn.cpp.
References getValueAsString(), VectorIndex::setOpenEndIndex(), VectorIndex::size(), and size().
Referenced by getValueAsString().
|
pure virtual |
Implemented in ValueColumn, DateTimeColumn, LogicalColumn, StringColumn, and CategoricalColumn.
|
pure virtual |
Implemented in ValueColumn, DateTimeColumn, LogicalColumn, StringColumn, and CategoricalColumn.
|
pure virtual |
Implemented in ValueColumn, DateTimeColumn, LogicalColumn, StringColumn, and CategoricalColumn.
|
pure virtual |
Implemented in StringColumn, CategoricalColumn, ValueColumn, DateTimeColumn, and LogicalColumn.
|
pure virtual |
Implemented in ValueColumn, DateTimeColumn, LogicalColumn, StringColumn, and CategoricalColumn.
Referenced by GridNumeReTable::CanGetValueAs(), getNumFilledElements(), and shrink().
|
pure virtual |
Implemented in StringColumn, CategoricalColumn, ValueColumn, DateTimeColumn, and LogicalColumn.
|
pure virtual |
Implemented in ValueColumn, DateTimeColumn, LogicalColumn, StringColumn, and CategoricalColumn.
Referenced by shrink().
void TableColumn::setValue | ( | const VectorIndex & | idx, |
const std::vector< mu::value_type > & | vValue | ||
) |
Sets a numerical vector at the specified indices.
idx | const VectorIndex& |
vValue | const std::vector<mu::value_type>& |
Definition at line 122 of file tablecolumn.cpp.
References setValue(), and VectorIndex::size().
void TableColumn::setValue | ( | const VectorIndex & | idx, |
const std::vector< std::string > & | vValue | ||
) |
Sets a string vector at the specified indices.
idx | const VectorIndex& |
vValue | const std::vector<std::string>& |
Definition at line 101 of file tablecolumn.cpp.
References setValue(), and VectorIndex::size().
Referenced by ValueColumn::convert(), DateTimeColumn::convert(), LogicalColumn::convert(), StringColumn::convert(), CategoricalColumn::convert(), ValueColumn::insert(), DateTimeColumn::insert(), LogicalColumn::insert(), StringColumn::insert(), CategoricalColumn::insert(), and setValue().
void TableColumn::setValue | ( | const VectorIndex & | idx, |
mu::value_type * | _dData, | ||
unsigned int | _nNum | ||
) |
Sets a plain numerical array at the specified indices.
idx | const VectorIndex& |
_dData | mu::value_type* |
_nNum | unsigned int |
Definition at line 144 of file tablecolumn.cpp.
References setValue(), and VectorIndex::size().
|
pure virtual |
Implemented in ValueColumn, DateTimeColumn, LogicalColumn, StringColumn, and CategoricalColumn.
|
pure virtual |
Implemented in ValueColumn, DateTimeColumn, LogicalColumn, StringColumn, and CategoricalColumn.
void TableColumn::shrink | ( | ) |
Shrink the column by removing all invalid elements from the end.
Definition at line 176 of file tablecolumn.cpp.
References isValid(), resize(), and size().
Referenced by ValueColumn::deleteElements(), DateTimeColumn::deleteElements(), LogicalColumn::deleteElements(), StringColumn::deleteElements(), and CategoricalColumn::deleteElements().
|
pure virtual |
Implemented in ValueColumn, DateTimeColumn, LogicalColumn, StringColumn, and CategoricalColumn.
Referenced by getNumFilledElements(), getValue(), getValueAsInternalString(), getValueAsString(), and shrink().
|
static |
Converts the passed string representation to a ColumnType value.
sType | const std::string& |
Definition at line 268 of file tablecolumn.cpp.
References TYPE_CATEGORICAL, TYPE_DATETIME, TYPE_LOGICAL, TYPE_NONE, TYPE_STRING, and TYPE_VALUE.
Referenced by TableViewer::changeColType(), and Memory::convertColumns().
|
static |
Converts the passed ColumnType value to a string representation.
type | TableColumn::ColumnType |
Definition at line 236 of file tablecolumn.cpp.
References TYPE_CATEGORICAL, TYPE_DATETIME, TYPE_LOGICAL, TYPE_NONE, TYPE_STRING, and TYPE_VALUE.
Referenced by ValueColumn::assign(), DateTimeColumn::assign(), LogicalColumn::assign(), StringColumn::assign(), CategoricalColumn::assign(), ValueColumn::insert(), DateTimeColumn::insert(), LogicalColumn::insert(), StringColumn::insert(), CategoricalColumn::insert(), and tableMethod_typeof().
std::string TableColumn::m_sHeadLine |
Definition at line 48 of file tablecolumn.hpp.
Referenced by ValueColumn::assign(), DateTimeColumn::assign(), LogicalColumn::assign(), StringColumn::assign(), CategoricalColumn::assign(), ValueColumn::convert(), DateTimeColumn::convert(), LogicalColumn::convert(), StringColumn::convert(), CategoricalColumn::convert(), ValueColumn::copy(), DateTimeColumn::copy(), LogicalColumn::copy(), StringColumn::copy(), CategoricalColumn::copy(), ValueColumn::getBytes(), DateTimeColumn::getBytes(), LogicalColumn::getBytes(), StringColumn::getBytes(), CategoricalColumn::getBytes(), Memory::importTable(), ValueColumn::insert(), DateTimeColumn::insert(), LogicalColumn::insert(), StringColumn::insert(), and CategoricalColumn::insert().
ColumnType TableColumn::m_type |
Definition at line 49 of file tablecolumn.hpp.
Referenced by ValueColumn::assign(), DateTimeColumn::assign(), LogicalColumn::assign(), StringColumn::assign(), CategoricalColumn::assign(), CategoricalColumn::CategoricalColumn(), DateTimeColumn::DateTimeColumn(), Memory::importTable(), ValueColumn::insert(), DateTimeColumn::insert(), LogicalColumn::insert(), StringColumn::insert(), CategoricalColumn::insert(), LogicalColumn::LogicalColumn(), StringColumn::StringColumn(), and ValueColumn::ValueColumn().