Bridges-Java
3.4.3
Bridges(Java API)
|
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 of 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 and octants at each level, respectively.
This class extends the BSTElement class by adding a dimension property, that specifies the partitioning dimension. The partitioner value is set by the generic parameter, K, or using setPartition() method. It also includes a thickness property for displaying the partitioning lines generated by the subdivision.
K | that is the partitioner value - this is usually a number, integer or float, given a chosen dimension of partititioning |
E | the application data type |
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 partitioner, 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) |
K | getPartitioner () |
void | setPartitioner (K partitioner) |
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) | |
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 () |
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 |
bridges.base.KdTreeElement< K, E >.KdTreeElement | ( | K | k, |
int | dim, | ||
float | th, | ||
KdTreeElement< K, E > | l, | ||
KdTreeElement< K, E > | r, | ||
E | val, | ||
String | lab | ||
) |
Constructs a KdTreeElement with the provided value, label, partitioner, dimension, thickness, left and right KdTree elements. The defaults will be used params are not provided.
bridges.base.KdTreeElement< K, E >.KdTreeElement | ( | ) |
Construct an empty KdTreeElement with no key assigned and left and right pointers set to null.
bridges.base.KdTreeElement< K, E >.KdTreeElement | ( | E | 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".
e | the object that KdTreeElement is holding |
left | the KdTreeElement that should be assigned to the left pointer |
right | the KdTreeElement taht should be assigned to the right pointer |
bridges.base.KdTreeElement< K, E >.KdTreeElement | ( | K | partitioner, |
E | 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".
partitioner | the key to be used in a binary search tree implementation |
e | the object this KdTreeElement is holding |
left | the KdTreeElement that should be assigned to the left pointer |
right | the KdTreeElement that should be assigned to the right pointer |
bridges.base.KdTreeElement< K, E >.KdTreeElement | ( | E | e | ) |
Construct a KdTreeElement holding the object "e", with no key assigned and left and right pointers set to null.
e | the object this KdTreeElement is holding |
bridges.base.KdTreeElement< K, E >.KdTreeElement | ( | K | key, |
int | dim | ||
) |
Construct a KdTreeElement given the key and dimension
key | the key to be used in a binary search tree implementation |
dim | the dimension of partitioning |
bridges.base.KdTreeElement< K, E >.KdTreeElement | ( | K | key, |
E | e | ||
) |
Construct a KdTreeElement holding the object "e", with key "key" assigned and left and right pointers set to null.
key | the key to be used in a binary search tree implementation |
e | the object this KdTreeElement is holding |
bridges.base.KdTreeElement< K, E >.KdTreeElement | ( | String | label, |
E | 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.
label | the label of KdTreeElement that shows up on the Bridges visualization |
e | the object this KdTreeElement is holding |
bridges.base.KdTreeElement< K, E >.KdTreeElement | ( | String | label, |
K | key, | ||
E | 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.
label | the label of KdTreeElement that shows up on the Bridges visualization |
key | the key to be used in a binary search tree implementation |
e | the object this KdTreeElement is holding |
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.
left | the KdTreeElement that should be assigned to the left pointer |
right | the KdTreeElement that should be assigned to the right pointer |
String bridges.base.KdTreeElement< K, E >.getDataStructType | ( | ) |
This method gets the data structure type
Reimplemented from bridges.base.BSTElement< K, E >.
int bridges.base.KdTreeElement< K, E >.getDimension | ( | ) |
Return the partitioning dimension
String bridges.base.KdTreeElement< K, E >.getElementRepresentation | ( | ) |
Augment the element with the "height" and "balance factor" fields.
Reimplemented from bridges.base.BSTElement< K, E >.
KdTreeElement<K, E> bridges.base.KdTreeElement< K, E >.getLeft | ( | ) |
Return the left child
Reimplemented from bridges.base.BSTElement< K, E >.
K bridges.base.KdTreeElement< K, E >.getPartitioner | ( | ) |
Return the partitioner value
KdTreeElement<K, E> bridges.base.KdTreeElement< K, E >.getRight | ( | ) |
Return the right child
Reimplemented from bridges.base.BSTElement< K, E >.
float bridges.base.KdTreeElement< K, E >.getThickness | ( | ) |
Return the thickness of the KdtreeElement; thickness is used in the visualization to draw the partitioning lines
void bridges.base.KdTreeElement< K, E >.setDimension | ( | int | dim | ) |
Set the dimension of the KdTreElement to key
dim | the dimension to set |
void bridges.base.KdTreeElement< K, E >.setPartitioner | ( | K | partitioner | ) |
Set the dimension of the KdTreElement to key
partitioner | the partitioner value to set |
void bridges.base.KdTreeElement< K, E >.setThickness | ( | float | th | ) |
Set the thickness of the KdTreeElement; thickness can used in the visualization to draw the partitioning lines
th | thickness of the partitioner to set |