Package dev.roanh.gmark.core
Enum Class QueryShape
- All Implemented Interfaces:
Serializable
,Comparable<QueryShape>
,Constable
Enum of different shapes the conjuncts
of a query can be arranged in.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionA chain query shape where conjuncts are ordered sequentially.A cycle query shape where two chains of conjuncts exist that share the same first variable and last variable.A star query shape where conjuncts all share a single variable.A query shape where a chain effectively has a star on both ends. -
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprivate
QueryShape
(String id, Function<Workload, ShapeGenerator> ctor) Constructs a new query shape with the given ID and constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic final QueryShape
Gets a query shape by its configuration ID.getID()
Gets the ID of this query shape.getName()
Gets the display name of this query shape.getQueryGenerator
(Workload workload) Gets a new generator to generate query with this shape for the given workload instance.static QueryShape
Returns the enum constant of this class with the specified name.static QueryShape[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CHAIN
A chain query shape where conjuncts are ordered sequentially.
For example:(?x0,?x1),(?x1,?x2),(?x2,?x3)
. -
STAR
A star query shape where conjuncts all share a single variable.
For example:(?x0,?x1),(?x0,?x2),(?x0,?x3)
. -
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
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
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
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
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
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 nameNullPointerException
- if the argument is null
-
getName
Gets the display name of this query shape.- Returns:
- The display name of this query shape.
-
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
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
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.
-