Enum Class QueryShape

java.lang.Object
java.lang.Enum<QueryShape>
dev.roanh.gmark.core.QueryShape
All Implemented Interfaces:
Serializable, Comparable<QueryShape>, Constable

public enum QueryShape extends Enum<QueryShape>
Enum of different shapes the conjuncts of a query can be arranged in.
  • Enum Constant Details

    • CHAIN

      public static final QueryShape CHAIN
      A chain query shape where conjuncts are ordered sequentially.
      For example: (?x0,?x1),(?x1,?x2),(?x2,?x3).
    • STAR

      public static final QueryShape STAR
      A star query shape where conjuncts all share a single variable.
      For example: (?x0,?x1),(?x0,?x2),(?x0,?x3).
    • CYCLE

      public static final QueryShape CYCLE
      A cycle query shape where two chains of conjuncts exist that share the same first variable and last variable.
      For example: (?x0,?x1),(?x1,?x2),(?x0,?x3),(?x3,?x2).
    • STARCHAIN

      public static final QueryShape STARCHAIN
      A query shape where a chain effectively has a star on both ends.
      For example: (?x0,?x1),(?x0,?x2),(?x0,?x3),(?x3,?x4),(?x4,?x5),(?x4,?x6)
  • Field Details

    • id

      private final String id
      The ID of this query shape (as used in configuration files).
    • ctor

      A function to create a new instance of a query shape generator.
  • Constructor Details

    • QueryShape

      private QueryShape(String id, Function<Workload,ShapeGenerator> ctor)
      Constructs a new query shape with the given ID and constructor.
      Parameters:
      id - The ID of this query shape (as used for configuration).
      ctor - A function to create a new generator for this query shape when given a workload instance.
  • Method Details

    • values

      public static QueryShape[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static QueryShape valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getName

      public String getName()
      Gets the display name of this query shape.
      Returns:
      The display name of this query shape.
    • getID

      public String getID()
      Gets the ID of this query shape. This is name is consistent with the name used for writing configuration files.
      Returns:
      The name of this query shape.
    • getQueryGenerator

      public ShapeGenerator getQueryGenerator(Workload workload)
      Gets a new generator to generate query with this shape for the given workload instance.
      Parameters:
      workload - The workload instance to generate queries for.
      Returns:
      A query shape generator for the given workload.
    • getByName

      public static final QueryShape getByName(String id)
      Gets a query shape by its configuration ID.
      Parameters:
      id - The ID to find the query shape for.
      Returns:
      The query shape identified by the given ID or null if no query shape was found for the given ID.