Class NegateQuery


  • public class NegateQuery
    extends Query
    A wrapper a query which should be negated, i.e. must not match
    • Constructor Detail

      • NegateQuery

        public NegateQuery​(Query negatedQuery)
    • Method Detail

      • getQuery

        public Query getQuery()
        Returns:
        a query to be negated
      • getChildQueries

        public java.util.List<Query> getChildQueries()
        Description copied from class: Query
        Returns all the children of the query in question. The returned List is provided as a copy - changes made to it do not impact the originating Query object in any way.
        Specified by:
        getChildQueries in class Query
      • replaceChildQuery

        public boolean replaceChildQuery​(Query toReplace,
                                         Query replacement)
        Description copied from class: Query
        Swap 'replacement' in as a replacement, if 'toReplace' is currently a child of this Query object. Because a tree of Query objects might conceivably have repeated clauses, this method is implemented to test 'toReplace' using reference-equality instead of value-equality.
        Specified by:
        replaceChildQuery in class Query
        Returns:
        true if a replacement was made, false otherwise.
      • removeChildQuery

        public boolean removeChildQuery​(Query toRemove)
        Description copied from class: Query
        Remove 'toRemove', if 'toRemove' is currently a child of this Query object. Because a tree of Query objects might conceivably have repeated clauses, this method is implemented to test 'toRemove' using reference-equality instead of value-equality.
        Specified by:
        removeChildQuery in class Query
        Returns:
        true if a removal was made, false otherwise.
      • isEmptyQuery

        public boolean isEmptyQuery()
        Specified by:
        isEmptyQuery in class Query
        Returns:
        true if this query is now essentially "empty" (doesn't affect query logic at all) and can now be removed from the query tree. This can happen, for example, if all child queries were removed and the query logic depends on having at least one child query.