kalzium/libscience
#include <chemicaldataobject.h>
Public Member Functions | |
ChemicalDataObject () | |
ChemicalDataObject (const QVariant &v, BlueObelisk type, const QVariant &errorValue=QVariant(0)) | |
ChemicalDataObject (const ChemicalDataObject &other) | |
~ChemicalDataObject () | |
QVariant | errorValue () const |
bool | operator!= (const ChemicalDataObject &other) const |
ChemicalDataObject & | operator= (const ChemicalDataObject &other) |
bool | operator== (const int v) const |
bool | operator== (const double v) const |
bool | operator== (const bool v) const |
bool | operator== (const QString &v) const |
bool | operator== (const ChemicalDataObject &other) const |
void | setData (const QVariant &v) |
void | setErrorValue (const QVariant &v) |
void | setType (BlueObelisk type) |
void | setType (int type) |
void | setUnit (int unit) |
BlueObelisk | type () const |
int | unit () const |
QString | unitAsString () const |
QVariant | value () const |
QString | valueAsString () const |
Detailed Description
A ChemicalDataObject is an object which contains information about a chemical element.
This can for example be a boiling point. The information is stored in a QVariant. This class supports the CML-format defined by the BlueObelisk-Project.
Definition at line 38 of file chemicaldataobject.h.
Member Enumeration Documentation
The BlueObelisk-project defines in their XML file the dataset with the names of the enum plus "bo:".
So for symbol it is "bo:symbol". To avoid confusion I will choose the very same naming
Definition at line 47 of file chemicaldataobject.h.
Constructor & Destructor Documentation
ChemicalDataObject::ChemicalDataObject | ( | ) |
Constructor.
Definition at line 59 of file chemicaldataobject.cpp.
ChemicalDataObject::ChemicalDataObject | ( | const QVariant & | v, |
BlueObelisk | type, | ||
const QVariant & | errorValue = QVariant(0) |
||
) |
Constructor.
- Parameters
-
v the data of the object type the type of the data errorValue the error margin of the value v
- See also
- errorValue()
Definition at line 50 of file chemicaldataobject.cpp.
ChemicalDataObject::ChemicalDataObject | ( | const ChemicalDataObject & | other | ) |
Copy constructor.
Definition at line 66 of file chemicaldataobject.cpp.
ChemicalDataObject::~ChemicalDataObject | ( | ) |
Destructor.
Definition at line 71 of file chemicaldataobject.cpp.
Member Function Documentation
QVariant ChemicalDataObject::errorValue | ( | ) | const |
- Returns
- the error margin of the object
Definition at line 138 of file chemicaldataobject.cpp.
bool ChemicalDataObject::operator!= | ( | const ChemicalDataObject & | other | ) | const |
Definition at line 118 of file chemicaldataobject.cpp.
ChemicalDataObject & ChemicalDataObject::operator= | ( | const ChemicalDataObject & | other | ) |
Definition at line 75 of file chemicaldataobject.cpp.
bool ChemicalDataObject::operator== | ( | const int | v | ) | const |
Compare the value v
with the data of this object.
Definition at line 81 of file chemicaldataobject.cpp.
bool ChemicalDataObject::operator== | ( | const double | v | ) | const |
Compare the value v
with the data of this object.
Definition at line 97 of file chemicaldataobject.cpp.
bool ChemicalDataObject::operator== | ( | const bool | v | ) | const |
Compare the value v
with the data of this object.
Definition at line 89 of file chemicaldataobject.cpp.
bool ChemicalDataObject::operator== | ( | const QString & | v | ) | const |
Compare the value v
with the data of this object.
Definition at line 105 of file chemicaldataobject.cpp.
bool ChemicalDataObject::operator== | ( | const ChemicalDataObject & | other | ) | const |
Definition at line 113 of file chemicaldataobject.cpp.
void ChemicalDataObject::setData | ( | const QVariant & | v | ) |
Set the data of this object to v
.
- Parameters
-
v the value of the object
Definition at line 153 of file chemicaldataobject.cpp.
void ChemicalDataObject::setErrorValue | ( | const QVariant & | v | ) |
Set the error value of this object to v
.
The error has to have the same unit as the value.
- Parameters
-
v the value of the object
Definition at line 158 of file chemicaldataobject.cpp.
void ChemicalDataObject::setType | ( | BlueObelisk | type | ) |
- Parameters
-
type the type of this object
Definition at line 163 of file chemicaldataobject.cpp.
void ChemicalDataObject::setType | ( | int | type | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 168 of file chemicaldataobject.cpp.
void ChemicalDataObject::setUnit | ( | int | unit | ) |
set the unit of this object to unit
- Parameters
-
unit the BlueObeliskUnit for this object
Definition at line 143 of file chemicaldataobject.cpp.
ChemicalDataObject::BlueObelisk ChemicalDataObject::type | ( | ) | const |
- Returns
- the type of dataset of this object
Definition at line 128 of file chemicaldataobject.cpp.
int ChemicalDataObject::unit | ( | ) | const |
- Returns
- the unit of the object
Definition at line 148 of file chemicaldataobject.cpp.
QString ChemicalDataObject::unitAsString | ( | ) | const |
- Returns
- the unit of the object as a QString. For example kelvin will be returned as "bo:kelvin"
Definition at line 173 of file chemicaldataobject.cpp.
QVariant ChemicalDataObject::value | ( | ) | const |
Every ChemicalDataObject contains one data.
For example a integer value which represents the boiling point. This method returns the value as a QVariant.
- Returns
- the value as a QVariant
Definition at line 133 of file chemicaldataobject.cpp.
QString ChemicalDataObject::valueAsString | ( | ) | const |
Every ChemicalDataObject contains one data.
For example a integer value which represents the boiling point. This method returns the value as a QString.
For bool, the returned string will be "false" or "true" For a QString, the QString will be returned For a int or double, the value will be returned as a QString
- Returns
- the value as a QString
Definition at line 123 of file chemicaldataobject.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:11:56 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.