Class GenericEdge

java.lang.Object
dev.roanh.gmark.lang.generic.GenericEdge
All Implemented Interfaces:
QueryFragment, OutputFormal, OutputSQL, OutputXML
Direct Known Subclasses:
EdgeCPQ, EdgeRPQ

public abstract class GenericEdge extends Object implements OutputSQL, OutputFormal, OutputXML, QueryFragment
Simple query action of traversing an edge with a single label from either source to target or in inverse direction from target to source.
  • Field Details

    • symbol

      protected final Predicate symbol
      The label traversed by this query.
  • Constructor Details

    • GenericEdge

      protected GenericEdge(Predicate symbol)
      Constructs a new generic edge with the given label to traverse.
      Parameters:
      symbol - The label to traverse.
  • Method Details

    • getLabel

      public Predicate getLabel()
      Gets the label (symbol) for this edge.
      Returns:
      The label for this edge.
    • toFormalSyntax

      public String toFormalSyntax()
      Description copied from interface: OutputFormal
      Converts this object to its formal logic form.
      Specified by:
      toFormalSyntax in interface OutputFormal
      Returns:
      The formal representation of this object.
    • toString

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

      public void writeSQL(IndentWriter writer)
      Description copied from interface: OutputSQL
      Writes the SQL representation of this object to the given writer.
      Specified by:
      writeSQL in interface OutputSQL
      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.
    • getOperationType

      public OperationType getOperationType()
      Description copied from interface: QueryFragment
      The top level operation represented by this query fragment.
      Specified by:
      getOperationType in interface QueryFragment
      Returns:
      The top level operation for this query fragment.
    • toAbstractSyntaxTree

      public QueryTree toAbstractSyntaxTree()
      Description copied from interface: QueryFragment
      Converts this query fragment to an equivalent abstract syntax tree.
      Specified by:
      toAbstractSyntaxTree in interface QueryFragment
      Returns:
      The constructed Abstract Syntax Tree (AST).