LYCOS RETRIEVER
Tree Data Structure: Elements
built 615 days ago
Trees, tables and lists are controls that display a range of data. There may be circumstances where this range of data is fairly small – say less than 100 data elements, or where the range is very large – say tens or hundreds of thousands of elements. In the case where the data range is small it may be convenient to have each element represented in memory as an Object organized in some sort of structure. For trees, this structure would be a tree type data structure, for tables a grid data structure would be appropriate, and for lists a single dimensional vector would be appropriate. This allows the programmer to create the entire structure once and then allow the control to access the various elements within the structure (depending on the view the user is interacting with) with no further programmer assistance. This approach can be thought of as Object Representation.
Source:
Figure 1: The elements of the tree data structure are shown for a two-dimensional quad-tree with 64 bodies, and a terminal threshold m=3. The upper left square shows just the bodies without any imposed tree structure. The other squares are
Source:
This is very easy to do, since the basic TreeTableModel is geared towards easy display of tree data using the ewe.data.TreeNode interface. This interface represents data elements that can have a single parent and several children. The interface consists of methods that allow a tree structure of such elements to be traversed and to be displayed in a TreeControl.
Source:
The ArrayList provides a more flexible array-like data structure. Rather than enforcing homogeneous types, the ArrayList allows for heterogeneous types to be stored by using an array of objects. Furthermore, the ArrayList does not require explicit allocation and can gracefully grow as the more elements are added.
Source:
In addition to the function to create and destroy the tree data structure, there is another function which allows you to apply a function to all elements of the tree. The function must have this type:
Source: