edu.iastate.metnet.metaomgraph
Class TreeSearcher
java.lang.Object
edu.iastate.metnet.metaomgraph.TreeSearcher
public class TreeSearcher
- extends java.lang.Object
Searches a tree rooted at a DefaultMutableTreeNode. If the nodes' user
objects are of type ExtendedInfoTree.Infondoe, this can
search for a given value in a given field. Otherwise, this'll just search the
results of the nodes' user objects' toString() method (this is what is
displayed in JTrees).
|
Nested Class Summary |
static class |
TreeSearcher.Query
Specifies a search for a TreeSearcher object. |
|
Constructor Summary |
TreeSearcher(javax.swing.tree.DefaultMutableTreeNode root)
|
|
Method Summary |
java.util.Vector<javax.swing.tree.TreeNode[]> |
doSearch(TreeSearcher.Query thisQuery)
Searches the tree specified by this TreeSearcher's
constructor using the given query. |
java.util.Vector<javax.swing.tree.TreeNode[]> |
doSearch(TreeSearcher.Query[] queries)
Searches the tree specified by this TreeSearcher's
constructor using the given queries. |
java.util.Vector |
getLastSearchResult()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TreeSearcher
public TreeSearcher(javax.swing.tree.DefaultMutableTreeNode root)
doSearch
public java.util.Vector<javax.swing.tree.TreeNode[]> doSearch(TreeSearcher.Query thisQuery)
- Searches the tree specified by this
TreeSearcher's
constructor using the given query. Returns a Vector of
TreeNode[] objects. The last node in each
TreeNode[] is the found node, the first node is the root.
If no hits are found, the Vector will be empty.
- Parameters:
thisQuery - the query to conduct
- Returns:
- a Vector of TreeNode[] objects.
doSearch
public java.util.Vector<javax.swing.tree.TreeNode[]> doSearch(TreeSearcher.Query[] queries)
- Searches the tree specified by this
TreeSearcher's
constructor using the given queries. Returns a Vector of
TreeNode[] objects. The last node in each
TreeNode[] is the found node, the first node is the root.
If no hits are found, the Vector will be empty.
- Parameters:
queries - the queries to conduct
- Returns:
- a Vector of TreeNode[] objects.
getLastSearchResult
public java.util.Vector getLastSearchResult()