Class ResultSetUnionAll<O>

  • All Implemented Interfaces:
    Closeable, AutoCloseable, Iterable<O>

    public class ResultSetUnionAll<O>
    extends ResultSet<O>
    A ResultSet which provides a view onto the union of other ResultSets, without deduplication.

    This is equivalent to UNION ALL in SQL terminology, i.e. duplicates are not eliminated.

    Author:
    Niall Gallagher
    • Method Detail

      • contains

        public boolean contains​(O object)
        Returns true if the given object is contained in any underlying ResultSets.
        Specified by:
        contains in class ResultSet<O>
        Parameters:
        object - An object to check if contained
        Returns:
        true if the given object is contained in any underlying ResultSets, false if it is not contained in any ResultSets or if there are no underlying result sets
      • matches

        public boolean matches​(O object)
        Description copied from class: ResultSet
        Similar to the ResultSet.contains(Object) method, but checks for logical containment in the ResultSet as opposed to physical containment in the ResultSet. Determines if the given object would be contained in the ResultSet, by testing if the given object matches the query for which this ResultSet was generated, instead of actually checking if the object is contained in appropriate indexes.

        This method will typically make the determination by evaluating the query on the given object on-the-fly without accessing indexes, however in some cases this method might delegate to the ResultSet.contains(Object) method to make the determination.

        This method will perform better than ResultSet.contains(Object) in cases where querying indexes is more expensive than querying attributes, which is usually the case.

        Specified by:
        matches in class ResultSet<O>
        Parameters:
        object - The object to check for logical containment in this ResultSet
        Returns:
        True if this ResultSet logically contains the given object, false if it does not
      • size

        public int size()
        Returns the sum of the sizes of the the underlying ResultSets.
        Specified by:
        size in class ResultSet<O>
        Returns:
        the sum of the sizes of the the underlying ResultSets
      • getRetrievalCost

        public int getRetrievalCost()
        Returns the sum of the retrieval costs of the the underlying ResultSets.
        Specified by:
        getRetrievalCost in class ResultSet<O>
        Returns:
        the sum of the retrieval costs of the the underlying ResultSets
      • getMergeCost

        public int getMergeCost()
        Returns the sum of the merge costs of the the underlying ResultSets.
        Specified by:
        getMergeCost in class ResultSet<O>
        Returns:
        the sum of the merge costs of the the underlying ResultSets
      • getQuery

        public Query<O> getQuery()
        Description copied from class: ResultSet
        Returns the query for which this ResultSet provides results.
        Specified by:
        getQuery in class ResultSet<O>
        Returns:
        The query for which this ResultSet provides results.
      • getQueryOptions

        public QueryOptions getQueryOptions()
        Description copied from class: ResultSet
        Returns the query options associated with the query.
        Specified by:
        getQueryOptions in class ResultSet<O>
        Returns:
        The query options associated with the query.