Public Member Functions | |
void | addElement (Object element, double xPos, double yPos) |
void | addElement (Object element, double xPos, double yPos, boolean evenlevel) |
Vector | collectElements (Vector v) |
Enumeration | elements () |
Vector | elementsVector () |
Object | get (double xPos, double yPos) |
Vector | getAll (double xPos1, double yPos1, double xPos2, double yPos2) |
Vector | getAll (double xPos1, double yPos1, double xPos2, double yPos2, boolean evenlevel, Vector v) |
TwoDTree | getNode (double xPos, double yPos) |
TwoDTree | getNode (double xPos, double yPos, boolean evenlevel) |
Object | info () |
void | initialize () |
boolean | isLeafNode () |
boolean | isTopNode () |
int | level () |
void | level (int l) |
void | llink (TwoDTree n) |
TwoDTree | llink () |
void | parent (TwoDTree n) |
TwoDTree | parent () |
void | removeAllElements () |
void | removeElement (double xPos, double yPos) |
void | rlink (TwoDTree n) |
TwoDTree | rlink () |
int | size () |
String | toString () |
void | toString (StringBuffer buf, int level) |
TwoDTree () | |
TwoDTree (Object element, double xPos, double yPos) | |
Protected Attributes | |
Object | info |
int | level |
TwoDTree | llink |
TwoDTree | parent |
TwoDTree | rlink |
double | xval |
double | yval |
This class implements a two dimensional d tree (2d-tree) which can be used in multimedia and graphics applications.
Definition at line 37 of file TwoDTree.java.
utils.TwoDTree.TwoDTree | ( | ) | [inline] |
This method creates a new instance.
Definition at line 50 of file TwoDTree.java.
utils.TwoDTree.TwoDTree | ( | Object | element, |
double | xPos, | ||
double | yPos | ||
) | [inline] |
This method creates a new instance using the given parameters.
element,a | new info object. |
xPos,the | x position. |
yPos,the | y position. |
Definition at line 60 of file TwoDTree.java.
void utils.TwoDTree.addElement | ( | Object | element, |
double | xPos, | ||
double | yPos | ||
) | [inline] |
This method adds a new element to the collection.
element,a | new info object. |
xPos,the | x position. |
yPos,the | y position. |
Definition at line 128 of file TwoDTree.java.
void utils.TwoDTree.addElement | ( | Object | element, |
double | xPos, | ||
double | yPos, | ||
boolean | evenlevel | ||
) | [inline] |
This method adds a new element to the collection using the level of the current node.
element,a | sorted collection element. |
xPos,the | x position. |
yPos,the | y position. |
evenLevel,true | if the current level is even and false otherwise. |
Definition at line 140 of file TwoDTree.java.
Vector utils.TwoDTree.collectElements | ( | Vector | v | ) | [inline] |
Definition at line 238 of file TwoDTree.java.
Enumeration utils.TwoDTree.elements | ( | ) | [inline] |
This method is for returning an enumeration of elements.
Definition at line 230 of file TwoDTree.java.
Vector utils.TwoDTree.elementsVector | ( | ) | [inline] |
Definition at line 234 of file TwoDTree.java.
Object utils.TwoDTree.get | ( | double | xPos, |
double | yPos | ||
) | [inline] |
This method returns the info object for the given position and null if no such object exists.
xPos,the | x position. |
yPos,the | y position. |
Definition at line 257 of file TwoDTree.java.
Vector utils.TwoDTree.getAll | ( | double | xPos1, |
double | yPos1, | ||
double | xPos2, | ||
double | yPos2 | ||
) | [inline] |
This method returns a vector of objects that are located within the specified bounds.
xPos1,the | smallest x position. |
yPos1,the | smallest y position. |
xPos2,the | largest x position. |
yPos2,the | largest y position. |
Definition at line 346 of file TwoDTree.java.
Vector utils.TwoDTree.getAll | ( | double | xPos1, |
double | yPos1, | ||
double | xPos2, | ||
double | yPos2, | ||
boolean | evenlevel, | ||
Vector | v | ||
) | [inline] |
Definition at line 352 of file TwoDTree.java.
TwoDTree utils.TwoDTree.getNode | ( | double | xPos, |
double | yPos | ||
) | [inline] |
Definition at line 266 of file TwoDTree.java.
TwoDTree utils.TwoDTree.getNode | ( | double | xPos, |
double | yPos, | ||
boolean | evenlevel | ||
) | [inline] |
Definition at line 270 of file TwoDTree.java.
Object utils.TwoDTree.info | ( | ) | [inline] |
Definition at line 79 of file TwoDTree.java.
void utils.TwoDTree.initialize | ( | ) | [inline] |
This method initializes the data structure
Definition at line 69 of file TwoDTree.java.
boolean utils.TwoDTree.isLeafNode | ( | ) | [inline] |
Definition at line 119 of file TwoDTree.java.
boolean utils.TwoDTree.isTopNode | ( | ) | [inline] |
Definition at line 115 of file TwoDTree.java.
int utils.TwoDTree.level | ( | ) | [inline] |
Definition at line 107 of file TwoDTree.java.
void utils.TwoDTree.level | ( | int | l | ) | [inline] |
Definition at line 111 of file TwoDTree.java.
void utils.TwoDTree.llink | ( | TwoDTree | n | ) | [inline] |
Definition at line 91 of file TwoDTree.java.
TwoDTree utils.TwoDTree.llink | ( | ) | [inline] |
Definition at line 95 of file TwoDTree.java.
void utils.TwoDTree.parent | ( | TwoDTree | n | ) | [inline] |
Definition at line 99 of file TwoDTree.java.
TwoDTree utils.TwoDTree.parent | ( | ) | [inline] |
Definition at line 103 of file TwoDTree.java.
void utils.TwoDTree.removeAllElements | ( | ) | [inline] |
This method removes all elements from self.
Definition at line 209 of file TwoDTree.java.
void utils.TwoDTree.removeElement | ( | double | xPos, |
double | yPos | ||
) | [inline] |
This method removes the given element from the collection.
xPos,the | element's x position. |
yPos,the | element's y position. |
Definition at line 189 of file TwoDTree.java.
void utils.TwoDTree.rlink | ( | TwoDTree | n | ) | [inline] |
Definition at line 83 of file TwoDTree.java.
TwoDTree utils.TwoDTree.rlink | ( | ) | [inline] |
Definition at line 87 of file TwoDTree.java.
int utils.TwoDTree.size | ( | ) | [inline] |
This method answers the number of elements stored in self.
Definition at line 216 of file TwoDTree.java.
String utils.TwoDTree.toString | ( | ) | [inline] |
This method converts the tree into a string.
Definition at line 309 of file TwoDTree.java.
void utils.TwoDTree.toString | ( | StringBuffer | buf, |
int | level | ||
) | [inline] |
Definition at line 315 of file TwoDTree.java.
Object utils.TwoDTree.info [protected] |
Definition at line 39 of file TwoDTree.java.
int utils.TwoDTree.level [protected] |
Definition at line 45 of file TwoDTree.java.
TwoDTree utils.TwoDTree.llink [protected] |
Definition at line 43 of file TwoDTree.java.
TwoDTree utils.TwoDTree.parent [protected] |
Definition at line 42 of file TwoDTree.java.
TwoDTree utils.TwoDTree.rlink [protected] |
Definition at line 44 of file TwoDTree.java.
double utils.TwoDTree.xval [protected] |
Definition at line 40 of file TwoDTree.java.
double utils.TwoDTree.yval [protected] |
Definition at line 41 of file TwoDTree.java.