Interface Query
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
Align
,And
,Annotation
,Composite
,Consecutive
,Containment
,Difference
,False
,Inclusion
,LowPass
,MultiTerm
,Not
,Or
,OrderedAnd
,Prefix
,Range
,Remap
,Select
,Term
,True
,Weight
public interface Query extends Serializable
A node of a composite representing a query.A query is abstractly represented by a composite made of implementations of this interface. The syntax can be different from parser to parser, but the result of the parsing process is an instance of this class.
Queries support building visits: invoking
accept(QueryBuilderVisitor)
on a suitableQueryBuilderVisitor
will return an object that has been built by the visitor.To this purpose, the implementation of
accept(QueryBuilderVisitor)
on internal nodes must gather in an array (or in an element) the results returned by the recursive calls toaccept(QueryBuilderVisitor)
on subnodes and pass the array (or the element) to the suitablevisitPost()
method ofQueryBuilderVisitor
.Since allocating a generic array is impossible, every visitor must provide an explicit
QueryBuilderVisitor.newArray(int)
method which returns an array of the correct type.- Author:
- Sebastiano Vigna
- See Also:
Query
-
-
Method Summary
Modifier and Type Method Description <T> T
accept(QueryBuilderVisitor<T> visitor)
Accepts a visitor.
-
-
-
Method Detail
-
accept
<T> T accept(QueryBuilderVisitor<T> visitor) throws QueryBuilderVisitorException
Accepts a visitor.- Parameters:
visitor
- the visitor.- Returns:
- the result of the visit, or
null
if the visit should stop. - Throws:
QueryBuilderVisitorException
- See Also:
Query
-
-