Bridges-Java  3.4.2
Bridges(Java API)
Public Member Functions | List of all members
bridges.base.BinTreeElement< E > Class Template Reference
Inheritance diagram for bridges.base.BinTreeElement< E >:
bridges.base.TreeElement< E > bridges.base.Element< E > bridges.base.DataStruct bridges.base.BSTElement< K, E > bridges.base.AVLTreeElement< K, E > bridges.base.KdTreeElement< K, E >

Detailed Description

@brief This class is extended from the TreeElement class  and can be used to create

binary tree element objects.

The BinTree element class is the building block for creating binary tree structures. It contains two children (viz., left, right).

BinTreeElement contains a visualizer (ElementVisualizer) object for setting visual attributes (color, shape, opacity, size), necessary for displaying them in a web browser.

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 at https://bridgesuncc.github.io/tutorials/BinTree.html
Parameters
Ethe generic parameter object that is part of this element, representing application specific data.
Author
Kalpathi Subramanian, Mihai Mehedint
Date
6/22/16, 1/7/17, 5/17/17

Public Member Functions

 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)
 
- 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 getElementRepresentation ()
 
String getLinkRepresentation (LinkVisualizer lv, String src, String dest)
 
String getLabel ()
 
void setLabel (String label)
 
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 ()
 

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 = "\""
 
- 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 = "]"
 
- Static Package Attributes inherited from bridges.base.Element< E >
static Integer ids = 0
 

Constructor & Destructor Documentation

◆ BinTreeElement() [1/5]

Constructs an empty Binary Tree Element with right and left pointers set to null.

◆ BinTreeElement() [2/5]

Constructs a TreeElement holding an object "e" with right and left pointers set to null.

Parameters
ethe generic object that TreeElement will hold

◆ BinTreeElement() [3/5]

bridges.base.BinTreeElement< E >.BinTreeElement ( String  label,
e 
)

Constructs a TreeElement with label set to "label", holding an object "e".

Parameters
labelthe label of TreeElement that shows up on the Bridges visualization
ethe generic object that TreeElement will hold

◆ BinTreeElement() [4/5]

Constructs an empty TreeElement left pointer pointing to "left" and right pointer pointing to "right".

Parameters
leftthe TreeElement to be assigned to the left pointer of this TreeElement
rightthe TreeElement to be assigned to the right pointer of this TreeElement

◆ BinTreeElement() [5/5]

bridges.base.BinTreeElement< E >.BinTreeElement ( e,
BinTreeElement< E >  left,
BinTreeElement< E >  right 
)

Constructs a TreeElement holding the object "e", left pointer pointing to "left" and right pointer pointing to "right".

Parameters
ethe generic object that TreeElement will hold
leftthe TreeElement to be assigned to the left pointer of this TreeElement
rightthe TreeElement to be assigned to the right pointer of this TreeElement

Member Function Documentation

◆ getDataStructType()

String bridges.base.BinTreeElement< E >.getDataStructType ( )

This method gets the data structure type

Returns
The date structure type as a string

Reimplemented from bridges.base.TreeElement< E >.

Reimplemented in bridges.base.KdTreeElement< K, E >, bridges.base.BSTElement< K, E >, and bridges.base.AVLTreeElement< K, E >.

◆ getLeft()

This method returns the left tree element pointer

Returns
the left child of this TreeElement

Reimplemented in bridges.base.KdTreeElement< K, E >, bridges.base.BSTElement< K, E >, and bridges.base.AVLTreeElement< K, E >.

◆ getRight()

This method returns the right tree element pointer

Returns
the right child of this TreeElement

Reimplemented in bridges.base.KdTreeElement< K, E >, bridges.base.BSTElement< K, E >, and bridges.base.AVLTreeElement< K, E >.

◆ setLeft()

void bridges.base.BinTreeElement< E >.setLeft ( BinTreeElement< E >  left)

This method sets the left tree element pointer

Parameters
leftthe TreeElement that should be assigned to the left child

◆ setRight()

void bridges.base.BinTreeElement< E >.setRight ( BinTreeElement< E >  right)

This method sets the right tree element pointer

Parameters
rightthe TreeElement that should be assigned to the right child

The documentation for this class was generated from the following file: