The BSTElement class is the building block for creating binary search trees.
It contains two children (left, right), and a search key, to be used in search operations .
BSTElement contains a visualizer (ElementVisualizer) object for setting visual attributes (color, shape, opacity, size), necessary for displaying them in a web browser.
BST Elements also have a LinkVisualizer object, that is used when they are linked to another element, appropriate for setting link attributes, for instance, between the current element and its left or right child
- See also
- Example tutorial using BSTElement at http://bridgesuncc.github.io/tutorials/BinarySearchTree.html
- Parameters
-
E | the generic parameter object that is part of this element, representing application specific data. |
K | is the search key parameter in the BST node; K must be orderable, such as integer, float, string, etc., on which relational operators work. |
- Author
- Kalpathi Subramanian, Mihai Mehedint
- Date
- 6/22/16, 1/7/17, 5/17/17
This class extends the BinTreeElement class by adding a 'key' value for use in a binary search tree implementations.
|
| BSTElement () |
|
| BSTElement (E e, BSTElement< K, E > left, BSTElement< K, E > right) |
|
| BSTElement (K key, E e, BSTElement< K, E > left, BSTElement< K, E > right) |
|
| BSTElement (E e) |
|
String | getDataStructType () |
|
| BSTElement (K key, E e) |
|
| BSTElement (String label, E e) |
|
| BSTElement (String label, K key, E e) |
|
| BSTElement (BSTElement< K, E > left, BSTElement< K, E > right) |
|
K | getKey () |
|
void | setKey (K key) |
|
BSTElement< K, E > | getLeft () |
|
BSTElement< K, E > | getRight () |
|
String | getElementRepresentation () |
|
| BinTreeElement () |
|
| BinTreeElement (E e) |
|
| BinTreeElement (String label, E e) |
|
| BinTreeElement (BinTreeElement< E > left, BinTreeElement< E > right) |
|
| BinTreeElement (E e, BinTreeElement< E > left, BinTreeElement< E > right) |
|
String | getDataStructType () |
|
BinTreeElement< E > | getLeft () |
|
void | setLeft (BinTreeElement< E > left) |
|
BinTreeElement< E > | getRight () |
|
void | setRight (BinTreeElement< E > right) |
|
| TreeElement () |
|
| TreeElement (E e) |
|
| TreeElement (String label, E e) |
|
| TreeElement (TreeElement< E > left, TreeElement< E > right) |
|
| TreeElement (E e, TreeElement< E > left, TreeElement< E > right) |
|
String | getDataStructType () |
|
void | addChild (TreeElement< E > child) |
|
int | getNumberOfChildren () |
|
void | setChild (int index, TreeElement< E > child) |
|
TreeElement< E > | getChild (int index) |
|
String | getDataStructureRepresentation () |
|
String | getDataStructType () |
| Get the Element type name. More...
|
|
| Element () |
| Element constructor. More...
|
|
| Element (E val) |
| the constructor of Element More...
|
|
| Element (String label, E val) |
| Constructor of Element. More...
|
|
| Element (Element< E > original) |
| performing deep copy of an element when needed More...
|
|
String | getIdentifier () |
|
void | setSize (double sz) |
|
void | setColor (Color col) |
|
Color | getColor () |
|
void | setOpacity (float opacity) |
|
double | getOpacity () |
|
void | setShape (String aShape) |
|
ElementVisualizer | getVisualizer () |
|
void | setVisualizer (ElementVisualizer visualizer) |
|
LinkVisualizer | getLinkVisualizer (Element< E > el) |
| Returns the Element's link visualizer object. More...
|
|
String | getClassName () |
|
int | compareTo (Element< E > e1) |
|
boolean | equals (Element< E > e1) |
|
String | getElementRepresentation () |
|
String | getDataStructureRepresentation () |
|
String | getLinkRepresentation (LinkVisualizer lv, String src, String dest) |
|
String | getLabel () |
|
void | setLabel (String label) |
|
E | getValue () |
|
void | setValue (E value) |
|
double | getSize () |
|
void | setColor (String col) |
| Change the element color. More...
|
|
String | getShape () |
|
void | setLocation (double locX, double locY) |
| Set the location attributes of an element. More...
|
|
double | getLocationX () |
|
double | getLocationY () |
|
String | toString () |
|
abstract String | getDataStructType () |
|
abstract String | getDataStructureRepresentation () |
|