Package dev.roanh.gmark.query
Class QuerySet
java.lang.Object
dev.roanh.gmark.query.QuerySet
- All Implemented Interfaces:
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
Modifier and TypeFieldDescriptionprivate final long
The total time it took to generate the queries in this query set (in milliseconds).The queries stored in this query set. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionget
(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
getSelectivityFraction
(Selectivity selectivity) Gets the fraction of all queries in this set with the given selectivity.int
getSelectivityTotal
(Selectivity selectivity) Gets the total number of queries in this set with the given selectivity.double
getShapeFraction
(QueryShape shape) Gets the fraction of all queries in this set with the given shape.int
getShapeTotal
(QueryShape shape) Gets the total number of queries in this set with the given shape.double
Gets the fraction of all the conjuncts across all the queries in this query set that have a Kleene star above them.int
size()
Gets the number of queries in this query set.void
writeXML
(IndentWriter writer) Writes this object as XML to the given writer.
-
Field Details
-
queries
The queries stored in this query set. -
generationTime
private final long generationTimeThe total time it took to generate the queries in this query set (in milliseconds).
-
-
Constructor Details
-
QuerySet
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
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
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
public double getStarFraction()Gets the fraction of all the conjuncts across all the queries in this query set that have a Kleene star above them.- Returns:
- The multiplicity across all the conjuncts in this query set.
-
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
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
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
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
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
Description copied from interface:OutputXML
Writes this object as XML to the given writer.
-