|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--xxl.indexStructures.Tree.QueryIterator
Queries on the Tree are evaluated lazily (ONC). This means when
query() is called a QueryIterator is returned. No work has
yet been done.
Idea: start with the root-node: assess all entries, select those
entries that are important for the query and insert
them into a priority queue. If the top-element of
the priority queue is a data-page an answer has been
found else an index entry has been found. In that
case the node referenced by that index entry has to
be read and its nodes have to be assessed
recursively.
This is a generalization of the incremental nearest-neighbor-search
algorithm (Henrich 94, Hjaltason and Samet 95) and greatly
facilitates the implementation of arbitrary query types on
arbitrary trees.
Example: TODO
| Inner Class Summary | |
static class |
Tree.QueryIterator.Candidate
A Candidate is an entry of the priority queue used for queries. |
| Field Summary | |
protected Function |
assessment
The assessment-function Function Object x Descriptor -> Object |
protected Queue |
queue
The (priority-)queue used to store candidates that passed the selection-Function. |
protected Function |
selection
The selection-Function checks whether the candidate is of interest. |
protected int |
targetLevel
Determines the level, whose nodes TODO: Haeh? |
protected Tree |
tree
The Tree to query. |
| Constructor Summary | |
protected |
Tree.QueryIterator(Tree tree,
Function assessment,
Function selection,
Queue queue,
int targetLevel)
Creates a new QueryIterator. |
| Method Summary | |
protected java.util.Iterator |
expand(Tree.Node node,
Tree.Descriptor nodeDescriptor,
Function currentAssessment)
Returns an Iterator of Candidate-Objects for all entries of node. |
protected java.util.Iterator |
filter(java.util.Iterator candidates)
Removes all elements from the candidate set for which the selection-Function returns a value < 0. |
boolean |
hasNext()
Checks whether there exists a next result. |
java.lang.Object |
next()
Returns the next result of the query. |
void |
remove()
Not supported. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected Tree tree
protected Function assessment
protected Function selection
protected Queue queue
protected int targetLevel
| Constructor Detail |
protected Tree.QueryIterator(Tree tree,
Function assessment,
Function selection,
Queue queue,
int targetLevel)
| Method Detail |
protected java.util.Iterator expand(Tree.Node node,
Tree.Descriptor nodeDescriptor,
Function currentAssessment)
node - the node to be expandednodeDescriptor - the descriptor of the nodecurrentAssessment - the assessment that computes the value for each candidate-objectprotected java.util.Iterator filter(java.util.Iterator candidates)
public boolean hasNext()
public java.lang.Object next()
throws java.util.NoSuchElementException
public void remove()
throws java.lang.UnsupportedOperationException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||