Class ConcatCPQ

java.lang.Object
dev.roanh.gmark.conjunct.cpq.ConcatCPQ
All Implemented Interfaces:
CPQ, OutputSQL, OutputXML

public class ConcatCPQ extends Object implements CPQ
CPQ modelling the concatenation of a number of CPQs (also known as the join operation).
  • Field Details

    • cpq

      private List<CPQ> cpq
      In order the concatenated CPQs.
  • Constructor Details

    • ConcatCPQ

      public ConcatCPQ(List<CPQ> cpq)
      Constructs a new concat CPQ with the given list of CPQs to concatenate.
      Parameters:
      cpq - The CPQs to concatenate.
      Throws:
      IllegalArgumentException - When the list of CPQs is empty.
  • Method Details

    • toString

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

      public String toSQL()
      Description copied from interface: OutputSQL
      Converts this object to an SQL query.
      Specified by:
      toSQL in interface OutputSQL
      Returns:
      An SQL query representing this object.
    • 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.
    • toQueryGraph

      public QueryGraphCPQ toQueryGraph(QueryGraphCPQ.Vertex source, QueryGraphCPQ.Vertex target)
      Description copied from interface: CPQ
      Computes and returns the query graph for this CPQ using the given source and target vertices for the computation. Usually using CPQ.toQueryGraph() instead should be sufficient for most use cases, using this version instead can lead to unexpected results.
      Specified by:
      toQueryGraph in interface CPQ
      Parameters:
      source - The source vertex to use.
      target - The target vertex to use.
      Returns:
      The query graph for this CPQ.
      See Also:
    • getDiameter

      public int getDiameter()
      Description copied from interface: CPQ
      Returns the diameter of this CPQ. The diameter of a CPQ is the largest number of labels to which the join operation is applied. A simpler way to think of this concept is the length of the largest path through the CPQ from source to target.
      Specified by:
      getDiameter in interface CPQ
      Returns:
      The diameter of this CPQ.
    • isLoop

      public boolean isLoop()
      Description copied from interface: CPQ
      Tests if this CPQ is a loop, meaning its source and target are the same. When visualised as a query graph this means that the source and target node are the same node. In its grammar form this means that there is an intersection with identity at the highest level in the CPQ.
      Specified by:
      isLoop in interface CPQ
      Returns:
      True if this CPQ is a loop.
      See Also: