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

Detailed Description

The This class can be used to create K-d Tree elements, derived from BSTElement. K-D trees can be thought of as the spatial equivalent binary search trees and operate on multiple dimensions (2D and 3D are most common). These trees serve as a representation of the underlying geometrically defined spaces. Specialized versions of these trees include quadtrees and octrees, which subdivide into equal sized quadrants octants at each level, respectively.

This class extends the BSTElement class by adding a dimension property. It also includes a thickness property for displaying the partitioning lines generated by the convex decomposition. This thickness get passed to some constructor KdTreeElement() and to setThickness(). It is purely a graphical attribute.

convenient to generate visual representation to allow for use in a binary search tree implementation.

See also
Example tutorial using AVLTreeElement at http://bridgesuncc.github.io/tutorials/KdTree.html
Parameters
Kthat is the search key type - this is usually a number, integer or float
Ethe application data type
Author
Kalpathi Subramanian
Date
12/26/18, 7/12/19

Public Member Functions

 KdTreeElement (K k, int dim, float th, KdTreeElement< K, E > l, KdTreeElement< K, E > r, E val, String lab)
 
 KdTreeElement ()
 
 KdTreeElement (E e, KdTreeElement< K, E > left, KdTreeElement< K, E > right)
 
 KdTreeElement (K key, E e, KdTreeElement< K, E > left, KdTreeElement< K, E > right)
 
 KdTreeElement (E e)
 
 KdTreeElement (K key, int dim)
 
String getDataStructType ()
 
 KdTreeElement (K key, E e)
 
 KdTreeElement (String label, E e)
 
 KdTreeElement (String label, K key, E e)
 
 KdTreeElement (KdTreeElement< K, E > left, KdTreeElement< K, E > right)
 
int getDimension ()
 
void setDimension (int dim)
 
float getThickness ()
 
void setThickness (float th)
 
KdTreeElement< K, E > getLeft ()
 
KdTreeElement< 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)
 
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)
 
getKey ()
 
void setKey (K key)
 
BSTElement< K, E > getLeft ()
 
BSTElement< K, E > getRight ()
 
String getElementRepresentation ()
 
- 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)
 
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)
 
 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 ()
 
- Public Member Functions inherited from bridges.base.Element< E >
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)
 
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 ()
 
- Public Member Functions inherited from bridges.base.DataStruct
abstract String getDataStructType ()
 
abstract String getDataStructureRepresentation ()
 

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 = "\""
 

Constructor & Destructor Documentation

◆ KdTreeElement() [1/10]

bridges.base.KdTreeElement< K, E >.KdTreeElement ( k,
int  dim,
float  th,
KdTreeElement< K, E >  l,
KdTreeElement< K, E >  r,
val,
String  lab 
)

Constructs a KdTreeElement with the provided value, label, key, left and right KdTree elements. The defaults will be used if not provided.

Parameters
kThe key for ordering
dimnumber of dimensions
ththickness (used in rendering)
lThe left KdTree Element
rThe right KdTree Element
valThe data to hold
labThe label to show

◆ KdTreeElement() [2/10]

Construct an empty KdTreeElement with no key assigned and left and right pointers set to null.

◆ KdTreeElement() [3/10]

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

Construct a KdTreeElement holding an object "e" with a left pointer assigned to "left" and a right pointer assigned to "right".

Parameters
ethe object that KdTreeElement is holding
leftthe KdTreeElement that should be assigned to the left pointer
rightthe KdTreeElement taht should be assigned to the right pointer

◆ KdTreeElement() [4/10]

bridges.base.KdTreeElement< K, E >.KdTreeElement ( key,
e,
KdTreeElement< K, E >  left,
KdTreeElement< K, E >  right 
)

Construct a KdTreeElement with a key "key", holding an object "e" with a left pointer assigned to "left" and a right pointer assigned to "right".

Parameters
keythe key to be used in a binary search tree implementation
ethe object this KdTreeElement is holding
leftthe KdTreeElement that should be assigned to the left pointer
rightthe KdTreeElement that should be assigned to the right pointer

◆ KdTreeElement() [5/10]

Construct a KdTreeElement holding the object "e", with no key assigned and left and right pointers set to null.

Parameters
ethe object this KdTreeElement is holding

◆ KdTreeElement() [6/10]

bridges.base.KdTreeElement< K, E >.KdTreeElement ( key,
int  dim 
)

Construct a KdTreeElement given the key and dimension

Parameters
keythe key to be used in a binary search tree implementation
dimthe dimension of partitioning

◆ KdTreeElement() [7/10]

bridges.base.KdTreeElement< K, E >.KdTreeElement ( key,
e 
)

Construct a KdTreeElement holding the object "e", with key "key" assigned and left and right pointers set to null.

Parameters
keythe key to be used in a binary search tree implementation
ethe object this KdTreeElement is holding

◆ KdTreeElement() [8/10]

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

Construct a KdTreeElement holding the object "e", with label set to "label", with no key assigned, and left and right pointers set to null.

Parameters
labelthe label of KdTreeElement that shows up on the Bridges visualization
ethe object this KdTreeElement is holding

◆ KdTreeElement() [9/10]

bridges.base.KdTreeElement< K, E >.KdTreeElement ( String  label,
key,
e 
)

Construct a KdTreeElement holding the object "e", with label set to "label", with "key" assigned to key, and left and right pointers set to null.

Parameters
labelthe label of KdTreeElement that shows up on the Bridges visualization
keythe key to be used in a binary search tree implementation
ethe object this KdTreeElement is holding

◆ KdTreeElement() [10/10]

bridges.base.KdTreeElement< K, E >.KdTreeElement ( KdTreeElement< K, E >  left,
KdTreeElement< K, E >  right 
)

Construct an empty KdTreeElement, with no key assigned, and left and right pointers set to null.

Parameters
leftthe KdTreeElement that should be assigned to the left pointer
rightthe KdTreeElement that should be assigned to the right pointer

Member Function Documentation

◆ getDataStructType()

String bridges.base.KdTreeElement< K, E >.getDataStructType ( )

This method gets the data structure type

Returns
The date structure type as a string

◆ getDimension()

int bridges.base.KdTreeElement< K, E >.getDimension ( )

Return the partitioning dimension

Returns
the partitioning dimension of this KdTreeElement

◆ getElementRepresentation()

String bridges.base.KdTreeElement< K, E >.getElementRepresentation ( )

Augment the element with the "height" and "balance factor" fields.

Returns
the augmented JSON string

◆ getLeft()

KdTreeElement<K, E> bridges.base.KdTreeElement< K, E >.getLeft ( )

Return the left child

Returns
the left child of this KdTreeElement

◆ getRight()

KdTreeElement<K, E> bridges.base.KdTreeElement< K, E >.getRight ( )

Return the right child

Returns
the right child of this KdTreeElement

◆ getThickness()

float bridges.base.KdTreeElement< K, E >.getThickness ( )

Return the thickness of the KdtreeElement; thickness is used in the visualization to draw the partitioning lines

Returns
the thickness of this KdTreeElement

◆ setDimension()

void bridges.base.KdTreeElement< K, E >.setDimension ( int  dim)

Set the dimension of the KdTreElement to key

Parameters
dimthe dimension to set

◆ setThickness()

void bridges.base.KdTreeElement< K, E >.setThickness ( float  th)

Set the thickness of the KdTreeElement

Parameters
ththickness of the partitioner to set thickness is used in the visualization to draw the partitioning lines

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