![]() |
Bridges-C++
3.1.1
Bridges(C++API)
|
#include <BSTElement.h>
This class can be used to create binary search tree elements, derived from BinTreeElement.
This class extends the BinTreeElement class by adding a "key" property to allow for use in a binary search tree implementation.
Generic Parameters: K that is the search key type, E the application data type
Public Member Functions | |
| BSTElement (const K &k, BSTElement *l, BSTElement *r, const E &val=E(), const string &lab=string()) | |
| BSTElement (const K &k, const E &val=E(), const string &lab=string()) | |
| virtual const string | getDStype () const override |
| K | getKey () const |
| void | setKey (const K &k) |
| virtual BSTElement * | getLeft () override |
| virtual const BSTElement * | getLeft () const override |
| void | setLeft (BSTElement *l) |
| virtual BSTElement * | getRight () override |
| virtual const BSTElement * | getRight () const override |
| void | setRight (BSTElement *r) |
Public Member Functions inherited from bridges::datastructure::BinTreeElement< E > | |
| BinTreeElement (BinTreeElement *l, BinTreeElement *r, const E &e=E(), const string &lab=string()) | |
| BinTreeElement (const E &e=E(), const string &lab=string()) | |
| void | setLeft (BinTreeElement *l) |
| void | setRight (BinTreeElement *r) |
Public Member Functions inherited from bridges::datastructure::TreeElement< E > | |
| TreeElement (const E &e=E(), const string &lab=string()) | |
| vector< TreeElement * > & | getChildren () |
| const vector< TreeElement * > & | getChildren () const |
| TreeElement * | getChild (const int &n) |
| const TreeElement * | getChild (const int &n) const |
| void | addChild (TreeElement *child) |
| void | setChild (const size_t &index, TreeElement *kid) |
Public Member Functions inherited from bridges::datastructure::Element< E > | |
| Element (const E &val=E(), const string &lab=string()) | |
| Element (const Element &e) | |
| Element & | operator= (const Element &e) |
| E & | operator= (E const &e) |
| virtual | ~Element () |
| ElementVisualizer * | getVisualizer () |
| const ElementVisualizer * | getVisualizer () const |
| LinkVisualizer * | getLinkVisualizer (const Element *el) |
| LinkVisualizer * | getLinkVisualizer (const Element *el) const |
| string const & | getLabel () const |
| void | setLabel (const string &lab) |
| E const & | getValue () const |
| E & | getValue () |
| void | setValue (const E &val) |
| void | setSize (const double &sz) |
| Sets size of the element. More... | |
| double | getSize () const |
| void | setColor (const Color &col) |
| Set the color of the Element. More... | |
| void | setColor (const string col) |
| Set the color by name. More... | |
| Color | getColor () const |
| Get the current color of the element. More... | |
| void | setOpacity (double opacity) |
| double | getOpacity () |
| void | setShape (const Shape &shp) |
| Set the shape of the element. More... | |
| Shape | getShape () const |
| Returns the shape of the element. More... | |
| void | setLocation (const double &locX, const double &locY) |
| double | getLocationX () const |
| double | getLocationY () const |
Public Member Functions inherited from bridges::datastructure::DataStructure | |
| virtual | ~DataStructure ()=default |
Protected Member Functions | |
| virtual const string | getElementRepresentation () const override |
Protected Attributes | |
| K | key = K() |
Protected Attributes inherited from bridges::datastructure::Element< E > | |
| unordered_map< Element *, LinkVisualizer > | links |
Additional Inherited Members | |
Static Protected Member Functions inherited from bridges::datastructure::Element< E > | |
| static const string | getLinkRepresentation (const LinkVisualizer &lv, const string &src, const string &dest) |
|
inline |
Constructs a BSTElement with the provided value, label, key, left and right BSTElements. The defaults will be used if not provided.
| k | The key for ordering |
| l | The left BSTElement |
| r | The right BSTElement |
| val | The data to hold |
| lab | The label to show |
|
inline |
Constructs a BSTElement with the provided value, label, key, setting the left and right BSTElements to NULL. The defaults will be used if not provided.
| k | The key for ordering |
| val | The data to hold |
| lab | The label to show |
|
inlineoverridevirtual |
Returns the data structure name
Reimplemented from bridges::datastructure::BinTreeElement< E >.
Reimplemented in bridges::datastructure::KdTreeElement< K, E >, and bridges::datastructure::AVLTreeElement< K, E >.
|
inlineoverrideprotectedvirtual |
Gets the JSON representation of this element
Reimplemented from bridges::datastructure::Element< E >.
Reimplemented in bridges::datastructure::KdTreeElement< K, E >.
|
inline |
Returns the key value
|
inlineoverridevirtual |
Return the left child
Reimplemented from bridges::datastructure::BinTreeElement< E >.
Reimplemented in bridges::datastructure::KdTreeElement< K, E >, and bridges::datastructure::AVLTreeElement< K, E >.
|
inlineoverridevirtual |
Return the left child - Constant version
Reimplemented from bridges::datastructure::BinTreeElement< E >.
Reimplemented in bridges::datastructure::KdTreeElement< K, E >, and bridges::datastructure::AVLTreeElement< K, E >.
|
inlineoverridevirtual |
Return the right child
Reimplemented from bridges::datastructure::BinTreeElement< E >.
Reimplemented in bridges::datastructure::KdTreeElement< K, E >, and bridges::datastructure::AVLTreeElement< K, E >.
|
inlineoverridevirtual |
Return the right child - Constant version
Reimplemented from bridges::datastructure::BinTreeElement< E >.
Reimplemented in bridges::datastructure::KdTreeElement< K, E >, and bridges::datastructure::AVLTreeElement< K, E >.
|
inline |
Set key to "k"
| k | The key of this BSTElement |
|
inline |
Sets left to "l"
| l | The left child |
|
inline |
Sets right child to "r"
| r | The right BSTElement |
|
protected |
1.8.13