Representation of a controlled vocabulary. More...
#include <OpenMS/FORMAT/ControlledVocabulary.h>
Classes | |
| struct | CVTerm |
| Representation of a CV term. More... | |
Public Member Functions | |
| ControlledVocabulary () | |
| Constructor. | |
| virtual | ~ControlledVocabulary () |
| Destructor. | |
| const String & | name () const |
| Returns the CV name (set in the load method). | |
| void | loadFromOBO (const String &name, const String &filename) |
| Loads the CV from an OBO file. | |
| bool | exists (const String &id) const |
| Returns true if the term is in the CV. Returns false otherwise. | |
| bool | hasTermWithName (const String &name) const |
| Returns true if a term with the given name is in the CV. Returns false otherwise. | |
| const CVTerm & | getTerm (const String &id) const |
| Returns a term specified by ID. | |
| const CVTerm & | getTermByName (const String &name, const String &desc="") const |
| Returns a term specified by name. | |
| const Map< String, CVTerm > & | getTerms () const |
| returns all the terms stored in the CV | |
| void | getAllChildTerms (std::set< String > &terms, const String &parent) const |
| Writes all child terms recursively into terms. | |
| bool | isChildOf (const String &child, const String &parent) const |
Returns if child is a child of parent. | |
Protected Member Functions | |
| bool | checkName_ (const String &id, const String &name, bool ignore_case=true) |
| checks if a name corresponds to an id | |
Protected Attributes | |
| Map< String, CVTerm > | terms_ |
| Map from ID to CVTerm. | |
| Map< String, String > | namesToIds_ |
| Map from name to id. | |
| String | name_ |
| Name set in the load method. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const ControlledVocabulary &cv) |
| Print the contents to a stream. | |
Representation of a controlled vocabulary.
This representation only contains the information used for parsing and validation. All other lines are stored in the unparsed member of the the CVTerm struct.
Constructor.
| virtual ~ControlledVocabulary | ( | ) | [virtual] |
Destructor.
checks if a name corresponds to an id
If the term is not known, 'true' is returned!
| bool exists | ( | const String & | id | ) | const |
Returns true if the term is in the CV. Returns false otherwise.
Referenced by MzMLHandler< MapType >::handleCVParam_().
Writes all child terms recursively into terms.
If parent has child this method writes them recursively into the term object
| Exception::InvalidValue | is thrown if the term is not present |
Referenced by MzMLHandler< MapType >::getChildWithName_().
Returns a term specified by ID.
| Exception::InvalidValue | is thrown if the term is not present |
Referenced by MzMLHandler< MapType >::getChildWithName_(), MzMLHandler< MapType >::handleCVParam_(), and MzMLHandler< MapType >::writeCV_().
Returns a term specified by name.
| Exception::InvalidValue | is thrown if the term is not present |
Referenced by MzMLHandler< MapType >::writeUserParam_().
| bool hasTermWithName | ( | const String & | name | ) | const |
Returns true if a term with the given name is in the CV. Returns false otherwise.
Referenced by MzMLHandler< MapType >::writeUserParam_().
Returns if child is a child of parent.
| Exception::InvalidValue | is thrown if one of the terms is not present |
Referenced by MzMLHandler< MapType >::handleCVParam_().
Loads the CV from an OBO file.
| Exception::FileNotFound | is thrown if the file could not be opened | |
| Exception::ParseError | is thrown if an error occurs during parsing |
Referenced by MzMLHandler< MapType >::MzMLHandler().
| const String& name | ( | ) | const |
Returns the CV name (set in the load method).
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const ControlledVocabulary & | cv | |||
| ) | [friend] |
Print the contents to a stream.
Map<String, String> namesToIds_ [protected] |
Map from name to id.
| OpenMS / TOPP release 1.10.0 | Documentation generated on Thu Mar 7 2013 09:42:53 using doxygen 1.7.1 |