Package dev.roanh.gmark.query
Class QueryBody
java.lang.Object
dev.roanh.gmark.query.QueryBody
- All Implemented Interfaces:
OutputXML
Represents the body of a query, this is essentially
the query without the projected head variables.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionThe conjuncts in this query body.private Selectivity
The selectivity of this query body.private QueryShape
The shape of this query body. -
Constructor Summary
ConstructorDescriptionQueryBody
(List<Conjunct> conjuncts, Selectivity selectivity, QueryShape shape) Constructs a new query body with the given conjuncts, selectivity and shape. -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the number of conjuncts in this query body.Gets the conjuncts for this query body.double
Gets the multiplicity of this query body.Gets the selectivity of this query body.getShape()
Gets the shape of this query body.toString()
protected void
writeSQL
(IndentWriter writer) Writes the SQL form of this query body to the given writer.void
writeXML
(IndentWriter writer) Writes this object as XML to the given writer.
-
Field Details
-
conjuncts
The conjuncts in this query body. -
selectivity
The selectivity of this query body. -
shape
The shape of this query body.
-
-
Constructor Details
-
QueryBody
public QueryBody(List<Conjunct> conjuncts, Selectivity selectivity, QueryShape shape) throws IllegalArgumentException Constructs a new query body with the given conjuncts, selectivity and shape.- Parameters:
conjuncts
- The conjuncts for this query body.selectivity
- The selectivity of this query body.shape
- The shape of this query body.- Throws:
IllegalArgumentException
- When the list of conjuncts is empty.
-
-
Method Details
-
getConjuncts
Gets the conjuncts for this query body.- Returns:
- The conjuncts for this query body.
-
getConjunctCount
public int getConjunctCount()Gets the number of conjuncts in this query body.- Returns:
- The number of conjuncts in this query body.
-
getMultiplicity
public double getMultiplicity()Gets the multiplicity of this query body. This is computed as the fraction of all conjuncts that have a Kleene star above it.- Returns:
- The multiplicity of this query body.
-
getSelectivity
Gets the selectivity of this query body.- Returns:
- The selectivity of this query body.
-
getShape
Gets the shape of this query body.- Returns:
- The shape of this query body.
-
toString
-
writeSQL
Writes the SQL form of this query body to the given writer.- Parameters:
writer
- The writer to write to.
-
writeXML
Description copied from interface:OutputXML
Writes this object as XML to the given writer.
-