Class LogicalQuery<O>

  • Type Parameters:
    O - The type of the object containing the attributes on which child queries in the query make assertions
    All Implemented Interfaces:
    Query<O>
    Direct Known Subclasses:
    And, Not, Or

    public abstract class LogicalQuery<O>
    extends Object
    implements Query<O>
    The superclass of Querys which logically connect other queries together to form complex queries.
    Since:
    2012-04-30 16:56
    Author:
    ngallagher
    • Constructor Detail

      • LogicalQuery

        public LogicalQuery​(Collection<Query<O>> childQueries)
        Creates a new LogicalQuery initialized to logically connect the supplied set of child queries.
        Parameters:
        childQueries - The child queries which this LogicalQuery is to logically connect
    • Method Detail

      • getLogicalQueries

        public List<LogicalQuery<O>> getLogicalQueries()
        Returns a collection of child queries which are themselves LogicalQuerys.
        Returns:
        a collection of child queries which are themselves LogicalQuerys
      • getSimpleQueries

        public List<SimpleQuery<O,​?>> getSimpleQueries()
        Returns a collection of child queries which are themselves SimpleQuerys.
        Returns:
        a collection of child queries which are themselves SimpleQuerys
      • hasLogicalQueries

        public boolean hasLogicalQueries()
        Returns true if this logical query has child queries which are themselves LogicalQuerys.
        Returns:
        true if this logical query has child queries which are themselves LogicalQuerys, false if this logical query has no child queries which are themselves LogicalQuerys
      • hasSimpleQueries

        public boolean hasSimpleQueries()
        Returns true if this logical query has child queries which are themselves SimpleQuerys.
        Returns:
        true if this logical query has child queries which are themselves SimpleQuerys, false if this logical query has no child queries which are themselves SimpleQuerys
      • hasComparativeQueries

        public boolean hasComparativeQueries()
        Returns true if this logical query has child queries which are themselves ComparativeQuerys.
        Returns:
        true if this logical query has child queries which are themselves ComparativeQuerys, false if this logical query has no child queries which are themselves ComparativeQuerys
      • size

        public int size()
        Returns the total number of child queries (both logical and simple).
        Returns:
        the total number of child queries (both logical and simple)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • calcHashCode

        protected abstract int calcHashCode()