Class QueryBody

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

public class QueryBody extends Object implements OutputXML
Represents the body of a query, this is essentially the query without the projected head variables.
See Also:
  • Field Details

    • conjuncts

      private List<Conjunct> conjuncts
      The conjuncts in this query body.
    • selectivity

      private Selectivity selectivity
      The selectivity of this query body.
    • shape

      private QueryShape 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

      public List<Conjunct> 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

      public Selectivity getSelectivity()
      Gets the selectivity of this query body.
      Returns:
      The selectivity of this query body.
    • getShape

      public QueryShape getShape()
      Gets the shape of this query body.
      Returns:
      The shape of this query body.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • writeSQL

      protected void writeSQL(IndentWriter writer)
      Writes the SQL form of this query body to the given writer.
      Parameters:
      writer - The writer to write to.
    • 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.