it.unimi.di.mg4j.query.nodes
Class AbstractQueryBuilderVisitor<T>

java.lang.Object
  extended by it.unimi.di.mg4j.query.nodes.AbstractQueryBuilderVisitor<T>
All Implemented Interfaces:
QueryBuilderVisitor<T>, FlyweightPrototype<QueryBuilderVisitor<T>>
Direct Known Subclasses:
AbstractTermExpander.ExpanderVisitor, DocumentIteratorBuilderVisitor

public abstract class AbstractQueryBuilderVisitor<T>
extends Object
implements QueryBuilderVisitor<T>

A QueryBuilderVisitor that returns true on all visitPre() methods and does nothing on prepare().

Author:
Sebastiano Vigna

Constructor Summary
AbstractQueryBuilderVisitor()
           
 
Method Summary
 QueryBuilderVisitor<T> prepare()
          No-op.
 boolean visitPre(Align node)
          Visits an Align node before recursing into the corresponding subtree.
 boolean visitPre(And node)
          Visits an And node before recursing into the corresponding subtree.
 boolean visitPre(Consecutive node)
          Visits a Consecutive node before recursing into the corresponding subtree.
 boolean visitPre(Difference node)
          Visits an Difference node before recursing into the corresponding subtree.
 boolean visitPre(LowPass node)
          Visits a LowPass node before recursing into the corresponding subtree.
 boolean visitPre(MultiTerm node)
          Visits a MultiTerm node before recursing into the corresponding subtree.
 boolean visitPre(Not node)
          Visits a Not node before recursing into the corresponding subtree.
 boolean visitPre(Or node)
          Visits an Or node before recursing into the corresponding subtree.
 boolean visitPre(OrderedAnd node)
          Visits an OrderedAnd node before recursing into the corresponding subtree.
 boolean visitPre(Remap node)
          Visits a Remap node before recursing into the corresponding subtree.
 boolean visitPre(Select node)
          Visits a Select node before recursing into the corresponding subtree.
 boolean visitPre(Weight node)
          Visits a Weight node before recursing into the corresponding subtree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface it.unimi.di.mg4j.query.nodes.QueryBuilderVisitor
copy, newArray, visit, visit, visit, visit, visit, visitPost, visitPost, visitPost, visitPost, visitPost, visitPost, visitPost, visitPost, visitPost, visitPost, visitPost, visitPost
 

Constructor Detail

AbstractQueryBuilderVisitor

public AbstractQueryBuilderVisitor()
Method Detail

prepare

public QueryBuilderVisitor<T> prepare()
No-op.

Specified by:
prepare in interface QueryBuilderVisitor<T>
Returns:
this visitor.

visitPre

public boolean visitPre(And node)
                 throws QueryBuilderVisitorException
Description copied from interface: QueryBuilderVisitor
Visits an And node before recursing into the corresponding subtree.

Specified by:
visitPre in interface QueryBuilderVisitor<T>
Parameters:
node - the node to be visited.
Returns:
true if the visit should continue.
Throws:
QueryBuilderVisitorException

visitPre

public boolean visitPre(Consecutive node)
                 throws QueryBuilderVisitorException
Description copied from interface: QueryBuilderVisitor
Visits a Consecutive node before recursing into the corresponding subtree.

Specified by:
visitPre in interface QueryBuilderVisitor<T>
Parameters:
node - the node to be visited.
Returns:
true if the visit should continue.
Throws:
QueryBuilderVisitorException

visitPre

public boolean visitPre(LowPass node)
                 throws QueryBuilderVisitorException
Description copied from interface: QueryBuilderVisitor
Visits a LowPass node before recursing into the corresponding subtree.

Specified by:
visitPre in interface QueryBuilderVisitor<T>
Parameters:
node - the node to be visited.
Returns:
true if the visit should continue.
Throws:
QueryBuilderVisitorException

visitPre

public boolean visitPre(Not node)
                 throws QueryBuilderVisitorException
Description copied from interface: QueryBuilderVisitor
Visits a Not node before recursing into the corresponding subtree.

Specified by:
visitPre in interface QueryBuilderVisitor<T>
Parameters:
node - the node to be visited.
Returns:
true if the visit should continue.
Throws:
QueryBuilderVisitorException

visitPre

public boolean visitPre(Or node)
                 throws QueryBuilderVisitorException
Description copied from interface: QueryBuilderVisitor
Visits an Or node before recursing into the corresponding subtree.

Specified by:
visitPre in interface QueryBuilderVisitor<T>
Parameters:
node - the node to be visited.
Returns:
true if the visit should continue.
Throws:
QueryBuilderVisitorException

visitPre

public boolean visitPre(OrderedAnd node)
                 throws QueryBuilderVisitorException
Description copied from interface: QueryBuilderVisitor
Visits an OrderedAnd node before recursing into the corresponding subtree.

Specified by:
visitPre in interface QueryBuilderVisitor<T>
Parameters:
node - the node to be visited.
Returns:
true if the visit should continue.
Throws:
QueryBuilderVisitorException

visitPre

public boolean visitPre(Align node)
                 throws QueryBuilderVisitorException
Description copied from interface: QueryBuilderVisitor
Visits an Align node before recursing into the corresponding subtree.

Specified by:
visitPre in interface QueryBuilderVisitor<T>
Parameters:
node - the node to be visited.
Returns:
true if the visit should continue.
Throws:
QueryBuilderVisitorException

visitPre

public boolean visitPre(MultiTerm node)
                 throws QueryBuilderVisitorException
Description copied from interface: QueryBuilderVisitor
Visits a MultiTerm node before recursing into the corresponding subtree.

Specified by:
visitPre in interface QueryBuilderVisitor<T>
Parameters:
node - the node to be visited.
Returns:
true if the visit should continue.
Throws:
QueryBuilderVisitorException

visitPre

public boolean visitPre(Select node)
                 throws QueryBuilderVisitorException
Description copied from interface: QueryBuilderVisitor
Visits a Select node before recursing into the corresponding subtree.

Specified by:
visitPre in interface QueryBuilderVisitor<T>
Parameters:
node - the node to be visited.
Returns:
true if the visit should continue.
Throws:
QueryBuilderVisitorException

visitPre

public boolean visitPre(Remap node)
                 throws QueryBuilderVisitorException
Description copied from interface: QueryBuilderVisitor
Visits a Remap node before recursing into the corresponding subtree.

Specified by:
visitPre in interface QueryBuilderVisitor<T>
Parameters:
node - the node to be visited.
Returns:
true if the visit should continue.
Throws:
QueryBuilderVisitorException

visitPre

public boolean visitPre(Weight node)
                 throws QueryBuilderVisitorException
Description copied from interface: QueryBuilderVisitor
Visits a Weight node before recursing into the corresponding subtree.

Specified by:
visitPre in interface QueryBuilderVisitor<T>
Parameters:
node - the node to be visited.
Returns:
true if the visit should continue.
Throws:
QueryBuilderVisitorException

visitPre

public boolean visitPre(Difference node)
                 throws QueryBuilderVisitorException
Description copied from interface: QueryBuilderVisitor
Visits an Difference node before recursing into the corresponding subtree.

Specified by:
visitPre in interface QueryBuilderVisitor<T>
Parameters:
node - the node to be visited.
Returns:
true if the visit should continue.
Throws:
QueryBuilderVisitorException