Class QuerySet

java.lang.Object
dev.roanh.gmark.query.QuerySet
All Implemented Interfaces:
OutputXML

public class QuerySet extends Object implements OutputXML
Represents a collection of several generated queries together with an easy way to get information about the whole set of generated queries.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final long
    The total time it took to generate the queries in this query set (in milliseconds).
    private final List<Query>
    The queries stored in this query set.
  • Constructor Summary

    Constructors
    Constructor
    Description
    QuerySet(List<Query> queries, long time)
    Constructs a new query set with the given queries and generation time.
  • Method Summary

    Modifier and Type
    Method
    Description
    get(int index)
    Gets the query at the given index from this set.
    int
    Gets the number of binary queries in this set (queries with arity 0).
    long
    Gets the total time it took to generate the queries in this set.
    int
    Gets the arity of the query with the highest arity in this set.
    int
    Gets the number of conjuncts in the query with the most conjuncts in this set.
    int
    Gets the arity of the query with the lowest arity in this set.
    int
    Gets the number of conjuncts in the query with the least conjuncts in this set.
    Gets the queries in this query set.
    double
    Gets the fraction of all queries in this set with the given selectivity.
    int
    Gets the total number of queries in this set with the given selectivity.
    double
    Gets the fraction of all queries in this set with the given shape.
    int
    Gets the total number of queries in this set with the given shape.
    double
    Deprecated.
    Not yet implemented.
    int
    Gets the number of queries in this query set.
    void
    Writes this object as XML to the given writer.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface dev.roanh.gmark.output.OutputXML

    toXML
  • Field Details

    • queries

      private final List<Query> queries
      The queries stored in this query set.
    • generationTime

      private final long generationTime
      The total time it took to generate the queries in this query set (in milliseconds).
  • Constructor Details

    • QuerySet

      public QuerySet(List<Query> queries, long time)
      Constructs a new query set with the given queries and generation time.
      Parameters:
      queries - The queries for this query set.
      time - The time in milliseconds it took to generate the queries in this query set.
  • Method Details

    • getQueries

      public List<Query> getQueries()
      Gets the queries in this query set.
      Returns:
      The queries in this query set.
    • size

      public int size()
      Gets the number of queries in this query set.
      Returns:
      The number of queries in this query set.
    • get

      public Query get(int index)
      Gets the query at the given index from this set.
      Parameters:
      index - The index of the query to get.
      Returns:
      The query at the given index.
    • getMinArity

      public int getMinArity()
      Gets the arity of the query with the lowest arity in this set.
      Returns:
      The arity of the query with the lowest arity.
    • getMaxArity

      public int getMaxArity()
      Gets the arity of the query with the highest arity in this set.
      Returns:
      The arity of the query with the highest arity.
    • getBinaryQueryCount

      public int getBinaryQueryCount()
      Gets the number of binary queries in this set (queries with arity 0).
      Returns:
      The number of binary queries.
    • getMinConjuncts

      public int getMinConjuncts()
      Gets the number of conjuncts in the query with the least conjuncts in this set.
      Returns:
      The number of conjuncts in the query with the least conjuncts.
    • getMaxConjuncts

      public int getMaxConjuncts()
      Gets the number of conjuncts in the query with the most conjuncts in this set.
      Returns:
      The number of conjuncts in the query with the most conjuncts.
    • getStarFraction

      @Deprecated public double getStarFraction()
      Deprecated.
      Not yet implemented.
      Returns:
      Always 0.
    • getGenerationTime

      public long getGenerationTime()
      Gets the total time it took to generate the queries in this set.
      Returns:
      The total generation time in milliseconds.
    • getShapeTotal

      public int getShapeTotal(QueryShape shape)
      Gets the total number of queries in this set with the given shape.
      Parameters:
      shape - The query shape to search for.
      Returns:
      The number of queries with the given shape.
      See Also:
    • getSelectivityTotal

      public int getSelectivityTotal(Selectivity selectivity)
      Gets the total number of queries in this set with the given selectivity.
      Parameters:
      selectivity - The query selectivity to search for.
      Returns:
      The number of queries with the given selectivity.
      See Also:
    • getShapeFraction

      public double getShapeFraction(QueryShape shape)
      Gets the fraction of all queries in this set with the given shape.
      Parameters:
      shape - The query shape to search for.
      Returns:
      The fraction of all queries with the given shape.
    • getSelectivityFraction

      public double getSelectivityFraction(Selectivity selectivity)
      Gets the fraction of all queries in this set with the given selectivity.
      Parameters:
      selectivity - The query selectivity to search for.
      Returns:
      The fraction of all queries with the given selectivity.
    • writeXML

      public void writeXML(IndentWriter writer)
      Description copied from interface: OutputXML
      Writes this object as XML to the given writer.
      Specified by:
      writeXML in interface OutputXML
      Parameters:
      writer - The writer to write to.