Package it.unimi.di.big.mg4j.query.nodes
Class AbstractTermExpander.ExpanderVisitor
- java.lang.Object
-
- it.unimi.di.big.mg4j.query.nodes.AbstractQueryBuilderVisitor<Query>
-
- it.unimi.di.big.mg4j.query.nodes.AbstractTermExpander.ExpanderVisitor
-
- All Implemented Interfaces:
QueryBuilderVisitor<Query>,FlyweightPrototype<QueryBuilderVisitor<Query>>
- Direct Known Subclasses:
MultiIndexTermExpander.ExpanderVisitor
- Enclosing class:
- AbstractTermExpander
protected class AbstractTermExpander.ExpanderVisitor extends AbstractQueryBuilderVisitor<Query>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedExpanderVisitor()
-
Method Summary
Modifier and Type Method Description AbstractTermExpander.ExpanderVisitorcopy()Query[]newArray(int len)Builds an array of given length of typeT.QueryBuilderVisitor<Query>prepare()No-op.Queryvisit(False node)VisitsFalse.Queryvisit(Prefix node)Visits aPrefix.Queryvisit(Range node)Visits aRange.Queryvisit(Term node)Visits aTerm.Queryvisit(True node)VisitsTrue.QueryvisitPost(Align node, Query[] subNode)Visits anAlignnode after recursing into the corresponding subtree.QueryvisitPost(And node, Query[] subNode)Visits anAndnode after recursing into the corresponding subtree.QueryvisitPost(Annotation node, Query subNode)Visits aAnnotationnode after recursing into the corresponding subtree.QueryvisitPost(Consecutive node, Query[] subNode)Visits aConsecutivenode after recursing into the corresponding subtree.QueryvisitPost(Containment node, Query[] subNode)Visits anContainmentnode after recursing into the corresponding subtree.QueryvisitPost(Difference node, Query[] subNode)Visits aDifferencenode after recursing into the corresponding subtree.QueryvisitPost(Inclusion node, Query[] subNode)Visits anInclusionnode after recursing into the corresponding subtree.QueryvisitPost(LowPass node, Query subNode)Visits aLowPassnode after recursing into the corresponding subtree.QueryvisitPost(MultiTerm node, Query[] subNode)Visits aMultiTermnode after recursing into the corresponding subtree.QueryvisitPost(Not node, Query subNode)Visits aNotnode after recursing into the corresponding subtree.QueryvisitPost(OrderedAnd node, Query[] subNode)Visits anOrderedAndnode after recursing into the corresponding subtree.QueryvisitPost(Or node, Query[] subNode)Visits anOrnode after recursing into the corresponding subtree.QueryvisitPost(Remap node, Query subNode)Visits aRemapnode after recursing into the corresponding subtree.QueryvisitPost(Select node, Query subNode)Visits aSelectnode after recursing into the corresponding subtree.QueryvisitPost(Weight node, Query subNode)Visits aWeightnode after recursing into the corresponding subtree.
-
-
-
Method Detail
-
copy
public AbstractTermExpander.ExpanderVisitor copy()
-
newArray
public Query[] newArray(int len)
Description copied from interface:QueryBuilderVisitorBuilds an array of given length of typeT.Because of erasure, generic classes in Java cannot allocate arrays of generic types. This impossibility can be a problem if for some reason the
visitPost()methods expect an actual array of typeT. This method must provide an array of given length that is an acceptable input for allvisitPost()methods.Note that by declaring an implementing class of this interface that has a sole constructor accepting an argument of type
Class<T>, you will force the user to provide the class of the generic type, opening the way for the reflective methods inArray.- Parameters:
len- the required array length.- Returns:
- an array of type
Tof lengthlen.
-
prepare
public QueryBuilderVisitor<Query> prepare()
Description copied from class:AbstractQueryBuilderVisitorNo-op.- Specified by:
preparein interfaceQueryBuilderVisitor<Query>- Overrides:
preparein classAbstractQueryBuilderVisitor<Query>- Returns:
- this visitor.
-
visit
public Query visit(Term node) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisits aTerm.- Parameters:
node- the leaf to be visited.- Returns:
- true if the visit should continue.
- Throws:
QueryBuilderVisitorException
-
visit
public Query visit(Prefix node) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisits aPrefix.- Parameters:
node- the leaf to be visited.- Returns:
- an appropriate return value (usually, the object built using the elements in
subNodeResult) if the visit should continue, ornull. - Throws:
QueryBuilderVisitorException
-
visit
public Query visit(Range node) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisits aRange.- Parameters:
node- the leaf to be visited.- Returns:
- true if the visit should continue.
- Throws:
QueryBuilderVisitorException
-
visitPost
public Query visitPost(And node, Query[] subNode) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisits anAndnode after recursing into the corresponding subtree.- Parameters:
node- the internal node to be visited.subNode- the array of results returned by subnodes.- Returns:
- an appropriate return value (usually, the object built using the elements in
subNodeResult) if the visit should continue, ornull. - Throws:
QueryBuilderVisitorException
-
visitPost
public Query visitPost(Consecutive node, Query[] subNode) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisits aConsecutivenode after recursing into the corresponding subtree.- Parameters:
node- the internal node to be visited.subNode- the array of results returned by subnodes.- Returns:
- an appropriate return value (usually, the object built using the elements in
subNodeResult) if the visit should continue, ornull. - Throws:
QueryBuilderVisitorException
-
visitPost
public Query visitPost(OrderedAnd node, Query[] subNode) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisits anOrderedAndnode after recursing into the corresponding subtree.- Parameters:
node- the internal node to be visited.subNode- the array of results returned by subnodes.- Returns:
- an appropriate return value (usually, the object built using the elements in
subNodeResult) if the visit should continue, ornull. - Throws:
QueryBuilderVisitorException
-
visitPost
public Query visitPost(Difference node, Query[] subNode) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisits aDifferencenode after recursing into the corresponding subtree.- Parameters:
node- the internal node to be visited.subNode- the array of results returned by subnodes.- Returns:
- an appropriate return value (usually, the object built using the elements in
subNodeResult) if the visit should continue, ornull. - Throws:
QueryBuilderVisitorException
-
visitPost
public Query visitPost(Inclusion node, Query[] subNode) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisits anInclusionnode after recursing into the corresponding subtree.- Parameters:
node- the internal node to be visited.subNode- the array of results returned by subnodes.- Returns:
- an appropriate return value (usually, the object built using the elements in
subNodeResult) if the visit should continue, ornull. - Throws:
QueryBuilderVisitorException
-
visitPost
public Query visitPost(Containment node, Query[] subNode) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisits anContainmentnode after recursing into the corresponding subtree.- Parameters:
node- the internal node to be visited.subNode- the array of results returned by subnodes.- Returns:
- an appropriate return value (usually, the object built using the elements in
subNodeResult) if the visit should continue, ornull. - Throws:
QueryBuilderVisitorException
-
visitPost
public Query visitPost(LowPass node, Query subNode) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisits aLowPassnode after recursing into the corresponding subtree.- Parameters:
node- the internal node to be visited.subNode- the of result returned by the sole subnode.- Returns:
- an appropriate return value (usually, the object built using
subNodeResult) if the visit should continue, ornull. - Throws:
QueryBuilderVisitorException
-
visitPost
public Query visitPost(Annotation node, Query subNode) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisits aAnnotationnode after recursing into the corresponding subtree.- Parameters:
node- the internal node to be visited.subNode- the of result returned by the sole subnode.- Returns:
- an appropriate return value (usually, the object built using
subNodeResult) if the visit should continue, ornull. - Throws:
QueryBuilderVisitorException
-
visitPost
public Query visitPost(Not node, Query subNode) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisits aNotnode after recursing into the corresponding subtree.- Parameters:
node- the internal node to be visited.subNode- the of result returned by the sole subnode.- Returns:
- an appropriate return value (usually, the object built using
subNodeResult) if the visit should continue, ornull. - Throws:
QueryBuilderVisitorException
-
visitPost
public Query visitPost(Or node, Query[] subNode) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisits anOrnode after recursing into the corresponding subtree.- Parameters:
node- the internal node to be visited.- Returns:
- an appropriate return value (usually, the object built using the elements in
subNodeResult) if the visit should continue, ornull. - Throws:
QueryBuilderVisitorException
-
visitPost
public Query visitPost(Align node, Query[] subNode) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisits anAlignnode after recursing into the corresponding subtree.- Parameters:
node- the internal node to be visited.subNode- the array of results returned by subnodes.- Returns:
- an appropriate return value (usually, the object built using the elements in
subNodeResult) if the visit should continue, ornull. - Throws:
QueryBuilderVisitorException
-
visitPost
public Query visitPost(MultiTerm node, Query[] subNode) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisits aMultiTermnode after recursing into the corresponding subtree.- Parameters:
node- the internal node to be visited.subNode- the of result returned by the sole subnode.- Returns:
- an appropriate return value (usually, the object built using
subNodeResult) if the visit should continue, ornull. - Throws:
QueryBuilderVisitorException
-
visitPost
public Query visitPost(Select node, Query subNode) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisits aSelectnode after recursing into the corresponding subtree.- Parameters:
node- the internal node to be visited.subNode- the of result returned by the sole subnode.- Returns:
- an appropriate return value (usually, the object built using
subNodeResult) if the visit should continue, ornull. - Throws:
QueryBuilderVisitorException
-
visitPost
public Query visitPost(Remap node, Query subNode) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisits aRemapnode after recursing into the corresponding subtree.- Parameters:
node- the internal node to be visited.subNode- the of result returned by the sole subnode.- Returns:
- an appropriate return value (usually, the object built using
subNodeResult) if the visit should continue, ornull. - Throws:
QueryBuilderVisitorException
-
visitPost
public Query visitPost(Weight node, Query subNode) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisits aWeightnode after recursing into the corresponding subtree.- Parameters:
node- the internal node to be visited.subNode- the of result returned by the sole subnode.- Returns:
- an appropriate return value (usually, the object built using
subNodeResult) if the visit should continue, ornull. - Throws:
QueryBuilderVisitorException
-
visit
public Query visit(True node) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisitsTrue.- Parameters:
node- the leaf to be visited.- Returns:
- true if the visit should continue.
- Throws:
QueryBuilderVisitorException
-
visit
public Query visit(False node) throws QueryBuilderVisitorException
Description copied from interface:QueryBuilderVisitorVisitsFalse.- Parameters:
node- the leaf to be visited.- Returns:
- true if the visit should continue.
- Throws:
QueryBuilderVisitorException
-
-