Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
|
Tree structure represented as linear sequece as result of preorder traversal with additional bar symbols. The representation is so called unranked, therefore it consists of unranked symbols bars are unranked as well. More...
#include <PrefixBarTree.h>
Public Member Functions | |
PrefixBarTree (SymbolType bar, ext::set< SymbolType > alphabet, ext::vector< SymbolType > data) | |
Creates a new instance of the tree with concrete alphabet, bar, and content. More... | |
PrefixBarTree (SymbolType bar, ext::vector< SymbolType > data) | |
Creates a new instance of the tree based on the content and bar, the alphabet is implicitly created from the content. More... | |
PrefixBarTree (SymbolType bar, const UnrankedTree< SymbolType > &tree) | |
Creates a new instance of the tree based on the UnrankedTree. The linear representation is constructed (including bars) by preorder traversal on the tree parameter. Bar symbol is provided as a parameter. More... | |
PrefixBarTree (const UnrankedTree< SymbolType > &tree) | |
Creates a new instance of the tree based on the UnrankedTree. The linear representation is constructed (including bars) by preorder traversal on the tree parameter. Bar symbol is created using some default value. More... | |
const ext::set< SymbolType > & | getAlphabet () const & |
ext::set< SymbolType > && | getAlphabet () && |
void | extendAlphabet (const ext::set< SymbolType > &symbols) |
const SymbolType & | getBar () const & |
SymbolType && | getBar () && |
const ext::vector< SymbolType > & | getContent () const & |
ext::vector< SymbolType > && | getContent () && |
void | setContent (ext::vector< SymbolType > data) |
bool | isEmpty () const |
auto | operator<=> (const PrefixBarTree &other) const |
bool | operator== (const PrefixBarTree &other) const |
operator string::LinearString< 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 PrefixBarTree &instance) |
Additional Inherited Members | |
![]() | |
static void | registerComponent () |
static void | unregisterComponent () |
Tree structure represented as linear sequece as result of preorder traversal with additional bar symbols. The representation is so called unranked, therefore it consists of unranked symbols bars are unranked as well.
The bars represent end mark of all subtrees in the notation.
T = ( A, B \in A, C ), A (Alphabet) = finite set of unranked symbols, B (Bar) = unranked symbol representing bar, C (Content) = linear representation of the tree content
SymbolType | used for the symbol of the alphabet |
|
explicit |
Creates a new instance of the tree with concrete alphabet, bar, and content.
bars | the bar symbol |
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 and bar, the alphabet is implicitly created from the content.
bar | the bar symbol |
data | the initial tree in linear representation |
|
explicit |
Creates a new instance of the tree based on the UnrankedTree. The linear representation is constructed (including bars) by preorder traversal on the tree parameter. Bar symbol is provided as a parameter.
bar | the bar symbol |
tree | RankedTree representation of a tree. |
|
explicit |
Creates a new instance of the tree based on the UnrankedTree. The linear representation is constructed (including bars) by preorder traversal on the tree parameter. Bar symbol is created using some default value.
tree | UnrankedTree 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.
|
inline |
Getter of the bar symbol.
|
inline |
Getter of the bar symbol.
ext::vector< SymbolType > && tree::PrefixBarTree< SymbolType >::getContent | ( | ) | && |
Getter of the tree representation.
const ext::vector< SymbolType > & tree::PrefixBarTree< SymbolType >::getContent | ( | ) | const & |
Getter of the tree representation.
bool tree::PrefixBarTree< 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::PrefixBarTree< SymbolType >::setContent | ( | ext::vector< 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 |