org.apache.slide.search.basic
Class QueryTree

java.lang.Object
  extended byorg.apache.slide.search.basic.QueryTree

public class QueryTree
extends java.lang.Object

Represents the scopes for all stores, that are within the scope of one query.

Version:
$Revision: 1.6 $

Nested Class Summary
(package private)  class QueryTree.TokenizedScope
          Helper class to handle the scopes
 
Constructor Summary
(package private) QueryTree(java.util.Enumeration stores, Scope scope, Scope[] excluded)
          Constructs a query tree
 
Method Summary
 java.util.Set getChildren(Scope scopeToBeChecked)
          Returns a set of all scopes in the query that are children of the scopeToBeChecked.
 boolean hasChildren(Scope scopeToBeChecked)
          Checks, if the indicated scope has children within this QueryTree.
 java.util.Iterator iterator()
          Retrieves an iterator of all scopes in this Tree
 int relativeDepth(Scope scope)
          calculates the depth of scope within this QueryTree (relative to the topLevel of tree)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryTree

QueryTree(java.util.Enumeration stores,
          Scope scope,
          Scope[] excluded)
    throws InvalidScopeException
Constructs a query tree

Parameters:
stores - all stores, that are within this namespace
scope - the scope of this query
excluded - a list of scopes, that shall be excluded from search
Method Detail

hasChildren

public boolean hasChildren(Scope scopeToBeChecked)
Checks, if the indicated scope has children within this QueryTree.

Parameters:
scopeToBeChecked - the Scope to be checked
Returns:
a boolean

getChildren

public java.util.Set getChildren(Scope scopeToBeChecked)
Returns a set of all scopes in the query that are children of the scopeToBeChecked.

Parameters:
scopeToBeChecked -

relativeDepth

public int relativeDepth(Scope scope)
calculates the depth of scope within this QueryTree (relative to the topLevel of tree)

Parameters:
scope - a Scope
Returns:
an int

iterator

public java.util.Iterator iterator()
Retrieves an iterator of all scopes in this Tree

Returns:
an Iterator of Scope objects