Class BasePQuery
java.lang.Object
tools.refinery.interpreter.matchers.psystem.queries.BasePQuery
- All Implemented Interfaces:
PTraceable
,PQuery
,PQueryHeader
Default implementation of PQuery.
-
Nested Class Summary
Nested classes/interfaces inherited from interface tools.refinery.interpreter.matchers.psystem.queries.PQuery
PQuery.PQueryStatus
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAnnotation
(PAnnotation annotation) protected void
void
Before a modification operation is executed, a mutability check is performed (via thePQuery.getStatus()
implementation, and in case of problems anIllegalStateException
is thrown.Creates and returns the bodies of the query.final void
If the query definition is uninitialized, initializes it.Returns the list of annotations specified for this queryReturns all queries required to evaluate this query (transitively).getAnnotationsByName
(String annotationName) Returns the list of annotations with a specified nameReturns all queries directly referred in the constraints.Returns all bodies associated with the query in their canonical form.Optional hints regarding the query evaluation strategy, to be interpreted by the query engine.getFirstAnnotationByName
(String annotationName) Returns the first annotation with a specified nameReturn the list of parameter namesgetPositionOfParameter
(String parameterName) Returns the index of a named parameterReturns a list describing the problems that were found in this query.Returns the initialization status of the definitionType information, expressed on query parameters, that all matches of the query are guaranteed to respect.Returns the visibility information about the query.boolean
An option to check mutability of the query.Returns the end-user query specification API objects that wrap this query.protected final void
void
protected void
setStatus
(PQuery.PQueryStatus newStatus) toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface tools.refinery.interpreter.matchers.psystem.queries.PQueryHeader
getFullyQualifiedName, getParameter, getParameters, getSimpleName
-
Field Details
-
status
-
visibility
- Since:
- 2.0
-
pProblems
-
-
Constructor Details
-
BasePQuery
- Since:
- 2.0
-
-
Method Details
-
getPositionOfParameter
Description copied from interface:PQueryHeader
Returns the index of a named parameter- Specified by:
getPositionOfParameter
in interfacePQueryHeader
- Parameters:
parameterName
-- Returns:
- the index, or null of no such parameter is available
-
setStatus
-
addError
-
getStatus
Description copied from interface:PQuery
Returns the initialization status of the definition -
getPProblems
Description copied from interface:PQuery
Returns a list describing the problems that were found in this query.TODO: formulate invariant connecting
PQuery.getPProblems()
andPQuery.getStatus()
.- Specified by:
getPProblems
in interfacePQuery
- Returns:
- a non-null, but possibly empty list of problems
-
isMutable
public boolean isMutable()Description copied from interface:PQuery
An option to check mutability of the query. It can be used to avoid getting anIllegalStateException
by the execution ofPQuery.checkMutability()
. -
checkMutability
public void checkMutability()Description copied from interface:PQuery
Before a modification operation is executed, a mutability check is performed (via thePQuery.getStatus()
implementation, and in case of problems anIllegalStateException
is thrown.- Specified by:
checkMutability
in interfacePQuery
-
setEvaluationHints
- Since:
- 1.5
-
getEvaluationHints
Description copied from interface:PQuery
Optional hints regarding the query evaluation strategy, to be interpreted by the query engine.To ensure the possibility of external overrides, the evaluation engine should not directly consult this field, but use an
IQueryBackendHintProvider
instead.- Specified by:
getEvaluationHints
in interfacePQuery
-
addAnnotation
-
getAllAnnotations
Description copied from interface:PQueryHeader
Returns the list of annotations specified for this query- Specified by:
getAllAnnotations
in interfacePQueryHeader
- Returns:
- a non-null, but possibly empty list of annotations
-
getAnnotationsByName
Description copied from interface:PQueryHeader
Returns the list of annotations with a specified name- Specified by:
getAnnotationsByName
in interfacePQueryHeader
- Parameters:
annotationName
-- Returns:
- a non-null, but possibly empty list of annotations
-
getFirstAnnotationByName
Description copied from interface:PQueryHeader
Returns the first annotation with a specified name- Specified by:
getFirstAnnotationByName
in interfacePQueryHeader
-
getParameterNames
Description copied from interface:PQueryHeader
Return the list of parameter names- Specified by:
getParameterNames
in interfacePQueryHeader
- Returns:
- a non-null, but possibly empty list of parameter names
-
getDirectReferredQueries
Description copied from interface:PQuery
Returns all queries directly referred in the constraints. They are all required to evaluate this query- Specified by:
getDirectReferredQueries
in interfacePQuery
- Returns:
- a non-null, but possibly empty list of query definitions
-
getAllReferredQueries
Description copied from interface:PQuery
Returns all queries required to evaluate this query (transitively).- Specified by:
getAllReferredQueries
in interfacePQuery
- Returns:
- a non-null, but possibly empty list of query definitions
-
publishedAs
Description copied from interface:PQuery
Returns the end-user query specification API objects that wrap this query.Intended for traceability and debug purposes, not part of normal operation. Returned list is intended to be appended during query specification construction time.
- Specified by:
publishedAs
in interfacePQuery
- Returns:
- a non-null, but possibly empty list of query specification objects;
-
getTypeGuarantees
Description copied from interface:PQuery
Type information, expressed on query parameters, that all matches of the query are guaranteed to respect.At the very minimum, this should include the declared types of the parameters.
The type judgement tuples shall contain the parameter index, NOT the
PParameter
object.- Specified by:
getTypeGuarantees
in interfacePQuery
- Returns:
- a non-null set of type judgements that the query guarantees for its matches
-
getDisjunctBodies
Description copied from interface:PQuery
Returns all bodies associated with the query in their canonical form. If called multiple times, the same set with the same contents will be returned.- Specified by:
getDisjunctBodies
in interfacePQuery
-
ensureInitialized
public final void ensureInitialized()Description copied from interface:PQuery
If the query definition is uninitialized, initializes it.- Specified by:
ensureInitialized
in interfacePQuery
-
setBodies
-
doGetContainedBodies
Creates and returns the bodies of the query. If recalled again, a new instance is created.- Returns:
- Throws:
InterpreterRuntimeException
-
toString
-
getVisibility
Description copied from interface:PQueryHeader
Returns the visibility information about the query.- Specified by:
getVisibility
in interfacePQueryHeader
- Since:
- 2.0
-