Bridges-Java
3.4.3
Bridges(Java API)
|
This class extends the BSTElement class by adding a height and balance factor fields that are useful in AVL tree implementations.
AVL tree elements include a 'height' and a 'balFactor' value, representing the height and balance factor of the AVL tree at that node, respectively. This is useful in representing AVL trees.
AVLTree elements contain a visualizer (ElementVisualizer) object for setting visual attributes (color, shape, opacity, size), necessary for displaying them in a web browser.
AVLTree 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
E | the generic parameter object that is part of this element, representing application specific data. |
K | is the search key parameter in the AVL tree node; K must be orderable, such as integer, float, string, etc., on which relational operators work. |
Public Member Functions | |
AVLTreeElement () | |
AVLTreeElement (K k, E e) | |
String | getDataStructType () |
int | getHeight () |
void | setHeight (int h) |
int | getBalanceFactor () |
void | setBalanceFactor (int bf) |
AVLTreeElement< K, E > | getLeft () |
AVLTreeElement< K, E > | getRight () |
String | getElementRepresentation () |
Public Member Functions inherited from bridges.base.BSTElement< K, E > | |
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) | |
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) |
Public Member Functions inherited from bridges.base.BinTreeElement< E > | |
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) | |
void | setLeft (BinTreeElement< E > left) |
void | setRight (BinTreeElement< E > right) |
Public Member Functions inherited from bridges.base.TreeElement< E > | |
TreeElement () | |
TreeElement (E e) | |
TreeElement (String label, E e) | |
void | addChild (TreeElement< E > child) |
int | getNumberOfChildren () |
void | setChild (int index, TreeElement< E > child) |
TreeElement< E > | getChild (int index) |
String | getDataStructureRepresentation () |
Public Member Functions inherited from bridges.base.Element< E > | |
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 | 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 () |
Package Attributes | |
Integer | balFactor |
Package Attributes inherited from bridges.base.DataStruct | |
String | COMMA = "," |
String | COLON = ":" |
String | OPEN_CURLY = "{" |
String | CLOSE_CURLY = "}" |
String | OPEN_PAREN = "(" |
String | CLOSE_PAREN = ")" |
String | OPEN_BOX = "[" |
String | CLOSE_BOX = "]" |
Additional Inherited Members | |
Protected Member Functions inherited from bridges.base.Element< E > | |
void | setLinkVisualizer (Element< E > el) |
Sets the link from this element to a new incoming element. More... | |
void | removeLinkVisualizer (Element< E > el) |
Removes the link from this element to a new incoming element. More... | |
void | validateVal (E value) |
Protected Attributes inherited from bridges.base.DataStruct | |
String | QUOTE = "\"" |
Static Package Attributes inherited from bridges.base.Element< E > | |
static Integer | ids = 0 |
bridges.base.AVLTreeElement< K, E >.AVLTreeElement | ( | ) |
Construct an AVLTreeElement with default values
bridges.base.AVLTreeElement< K, E >.AVLTreeElement | ( | K | k, |
E | e | ||
) |
Construct an AVLTreeElement holding a key value "k" and an object "e"
k | the search key |
e | the appl specific object that Element is holding |
int bridges.base.AVLTreeElement< K, E >.getBalanceFactor | ( | ) |
This method returns the balance factor of the tree at this node
String bridges.base.AVLTreeElement< K, E >.getDataStructType | ( | ) |
This method gets the data structure type
Reimplemented from bridges.base.BSTElement< K, E >.
String bridges.base.AVLTreeElement< K, E >.getElementRepresentation | ( | ) |
Get the representation of the AVL Tree element as a JSON string
Reimplemented from bridges.base.BSTElement< K, E >.
int bridges.base.AVLTreeElement< K, E >.getHeight | ( | ) |
This method returns the height of the tree at this node
AVLTreeElement<K, E> bridges.base.AVLTreeElement< K, E >.getLeft | ( | ) |
This method returns the left child of the tree node
Reimplemented from bridges.base.BSTElement< K, E >.
AVLTreeElement<K, E> bridges.base.AVLTreeElement< K, E >.getRight | ( | ) |
This method returns the right child of tree node
Reimplemented from bridges.base.BSTElement< K, E >.
void bridges.base.AVLTreeElement< K, E >.setBalanceFactor | ( | int | bf | ) |
This method sets the balance factor of the tree at this node
bf | balance factor |
void bridges.base.AVLTreeElement< K, E >.setHeight | ( | int | h | ) |
This method sets the height of the tree at this node
h | height |
|
package |