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 voidaddAnnotation(PAnnotation annotation) protected voidvoidBefore a modification operation is executed, a mutability check is performed (via thePQuery.getStatus()implementation, and in case of problems anIllegalStateExceptionis thrown.Creates and returns the bodies of the query.final voidIf 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.booleanAn option to check mutability of the query.booleanDetermines whether the query transitively refers to itself.Returns the end-user query specification API objects that wrap this query.protected final voidvoidprotected voidsetStatus(PQuery.PQueryStatus newStatus) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:PQueryHeaderReturns the index of a named parameter- Specified by:
getPositionOfParameterin interfacePQueryHeader- Parameters:
parameterName-- Returns:
- the index, or null of no such parameter is available
-
setStatus
-
addError
-
getStatus
Description copied from interface:PQueryReturns the initialization status of the definition -
getPProblems
Description copied from interface:PQueryReturns a list describing the problems that were found in this query.TODO: formulate invariant connecting
PQuery.getPProblems()andPQuery.getStatus().- Specified by:
getPProblemsin interfacePQuery- Returns:
- a non-null, but possibly empty list of problems
-
isMutable
public boolean isMutable()Description copied from interface:PQueryAn option to check mutability of the query. It can be used to avoid getting anIllegalStateExceptionby the execution ofPQuery.checkMutability(). -
checkMutability
public void checkMutability()Description copied from interface:PQueryBefore a modification operation is executed, a mutability check is performed (via thePQuery.getStatus()implementation, and in case of problems anIllegalStateExceptionis thrown.- Specified by:
checkMutabilityin interfacePQuery
-
setEvaluationHints
- Since:
- 1.5
-
getEvaluationHints
Description copied from interface:PQueryOptional 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
IQueryBackendHintProviderinstead.- Specified by:
getEvaluationHintsin interfacePQuery
-
addAnnotation
-
getAllAnnotations
Description copied from interface:PQueryHeaderReturns the list of annotations specified for this query- Specified by:
getAllAnnotationsin interfacePQueryHeader- Returns:
- a non-null, but possibly empty list of annotations
-
getAnnotationsByName
Description copied from interface:PQueryHeaderReturns the list of annotations with a specified name- Specified by:
getAnnotationsByNamein interfacePQueryHeader- Parameters:
annotationName-- Returns:
- a non-null, but possibly empty list of annotations
-
getFirstAnnotationByName
Description copied from interface:PQueryHeaderReturns the first annotation with a specified name- Specified by:
getFirstAnnotationByNamein interfacePQueryHeader
-
getParameterNames
Description copied from interface:PQueryHeaderReturn the list of parameter names- Specified by:
getParameterNamesin interfacePQueryHeader- Returns:
- a non-null, but possibly empty list of parameter names
-
getDirectReferredQueries
Description copied from interface:PQueryReturns all queries directly referred in the constraints. They are all required to evaluate this query- Specified by:
getDirectReferredQueriesin interfacePQuery- Returns:
- a non-null, but possibly empty list of query definitions
-
getAllReferredQueries
Description copied from interface:PQueryReturns all queries required to evaluate this query (transitively).- Specified by:
getAllReferredQueriesin interfacePQuery- Returns:
- a non-null, but possibly empty list of query definitions
-
isRecursive
public boolean isRecursive()Description copied from interface:PQueryDetermines whether the query transitively refers to itself. Add commentMore actions Note that even if false is returned, the query may refer to another query that is recursive, but not mutually recursive with this query.- Specified by:
isRecursivein interfacePQuery- Returns:
- true if the query transitively calls itself.
-
publishedAs
Description copied from interface:PQueryReturns 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:
publishedAsin interfacePQuery- Returns:
- a non-null, but possibly empty list of query specification objects;
-
getTypeGuarantees
Description copied from interface:PQueryType 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
PParameterobject.- Specified by:
getTypeGuaranteesin interfacePQuery- Returns:
- a non-null set of type judgements that the query guarantees for its matches
-
getDisjunctBodies
Description copied from interface:PQueryReturns 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:
getDisjunctBodiesin interfacePQuery
-
ensureInitialized
public final void ensureInitialized()Description copied from interface:PQueryIf the query definition is uninitialized, initializes it.- Specified by:
ensureInitializedin 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:PQueryHeaderReturns the visibility information about the query.- Specified by:
getVisibilityin interfacePQueryHeader- Since:
- 2.0
-