Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
|
Tree structure represented as linear sequece as result of preorder traversal. The representation is so called ranked, therefore it consists of ranked symbols. The rank of the ranked symbol needs to be compatible with unsigned integer. More...
#include <PrefixRankedTree.h>
Public Member Functions | |
PrefixRankedTree (ext::set< common::ranked_symbol< SymbolType > > alphabet, ext::vector< common::ranked_symbol< SymbolType > > data) | |
Creates a new instance of the tree with concrete alphabet and content. More... | |
PrefixRankedTree (ext::vector< common::ranked_symbol< SymbolType > > data) | |
Creates a new instance of the tree based on the content, the alphabet is implicitly created from the content. More... | |
PrefixRankedTree (const RankedTree< SymbolType > &tree) | |
Creates a new instance of the tree based on the RankedTree. The linear representation is constructed by preorder traversal on the tree parameter. More... | |
PrefixRankedTree (const PostfixRankedTree< SymbolType > &other) | |
Creates a new instance of the tree based on the PostfixRankedTree. The linear representation is constructed by transforming postfix notation to prefix notation. More... | |
const ext::set< common::ranked_symbol< SymbolType > > & | getAlphabet () const & |
ext::set< common::ranked_symbol< SymbolType > > && | getAlphabet () && |
void | extendAlphabet (const ext::set< common::ranked_symbol< SymbolType > > &symbols) |
const ext::vector< common::ranked_symbol< SymbolType > > & | getContent () const & |
ext::vector< common::ranked_symbol< SymbolType > > && | getContent () && |
void | setContent (ext::vector< common::ranked_symbol< SymbolType > > data) |
bool | isEmpty () const |
auto | operator<=> (const PrefixRankedTree &other) const |
bool | operator== (const PrefixRankedTree &other) const |
operator string::LinearString< common::ranked_symbol< SymbolType > > () const | |
Creates a new instance of the string from a linear representation of a tree. More... | |
![]() | |
void | accessComponent () |
Friends | |
ext::ostream & | operator<< (ext::ostream &out, const PrefixRankedTree &instance) |
Additional Inherited Members | |
![]() | |
static void | registerComponent () |
static void | unregisterComponent () |
Tree structure represented as linear sequece as result of preorder traversal. The representation is so called ranked, therefore it consists of ranked symbols. The rank of the ranked symbol needs to be compatible with unsigned integer.
T = (A, C), A (Alphabet) = finite set of ranked symbols, C (Content) = linear representation of the tree content
SymbolType | used for the symbol part of the ranked symbol |
|
explicit |
Creates a new instance of the tree with concrete alphabet and content.
alphabet | the initial alphabet of the tree |
data | the initial tree in linear representation |
|
explicit |
Creates a new instance of the tree based on the content, the alphabet is implicitly created from the content.
data | the initial tree in linear representation |
|
explicit |
Creates a new instance of the tree based on the RankedTree. The linear representation is constructed by preorder traversal on the tree parameter.
tree | RankedTree representation of a tree. |
|
explicit |
Creates a new instance of the tree based on the PostfixRankedTree. The linear representation is constructed by transforming postfix notation to prefix notation.
tree | RankedTree representation of a tree. |
|
inline |
Adder of an alphabet symbols.
symbols | the new symbols to be added to the alphabet |
|
inline |
Getter of the alphabet.
|
inline |
Getter of the alphabet.
ext::vector< common::ranked_symbol< SymbolType > > && tree::PrefixRankedTree< SymbolType >::getContent | ( | ) | && |
Getter of the tree representation.
const ext::vector< common::ranked_symbol< SymbolType > > & tree::PrefixRankedTree< SymbolType >::getContent | ( | ) | const & |
Getter of the tree representation.
bool tree::PrefixRankedTree< SymbolType >::isEmpty |
|
inlineexplicit |
Creates a new instance of the string from a linear representation of a tree.
|
inline |
The three way comparison implementation
other | the other instance |
other
.
|
inline |
The equality comparison implementation.
other | the other object to compare with. |
void tree::PrefixRankedTree< SymbolType >::setContent | ( | ext::vector< common::ranked_symbol< SymbolType > > | data | ) |
Setter of the representation of the tree.
TreeException | when new tree representation is not valid or when symbol of the representation are not present in the alphabet |
data | new List of symbols forming the representation of the tree. |
|
friend |
Print this object as raw representation to ostream.
out | ostream where to print |
instance | object to print |