Class AbstractAtomicPattern
java.lang.Object
fr.inria.rules.integraal.model.data.readable.query.AbstractAtomicPattern
- All Implemented Interfaces:
AtomicPattern
- Direct Known Subclasses:
ViewImpl
Represents a basic pattern for querying predicates with specific constraints on term positions.
This pattern defines which positions must be specified (Mandatory), which can be indexed (Indexable),
and what types of terms are allowed in each position.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the positions that must be assigned before evaluation.Returns the predicate described by this pattern.getTermConstraint(int position) Retrieves the allowed term type for a specific position.booleanhasAssignedMandatoryParameters(Map<Integer, Term> positionsAssignation) Checks whether all mandatory parameters are assigned.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface AtomicPattern
createQueries, getIndexablePatterns
-
Constructor Details
-
AbstractAtomicPattern
public AbstractAtomicPattern(Predicate predicate, Set<Integer> mandatoryPositions, Map<Integer, Class<? extends Term>> termConstraints) Constructs an AtomicPattern with specific constraints.- Parameters:
predicate- The predicate associated with this pattern.mandatoryPositions- A list of positions that are mandatory.termConstraints- A map associating positions (0-based index) with allowed term types.
-
-
Method Details
-
getPredicate
Description copied from interface:AtomicPatternReturns the predicate described by this pattern.- Specified by:
getPredicatein interfaceAtomicPattern- Returns:
- The predicate associated with this pattern.
-
getTermConstraint
Description copied from interface:AtomicPatternRetrieves the allowed term type for a specific position.- Specified by:
getTermConstraintin interfaceAtomicPattern- Parameters:
position- The position to check (0-based index).- Returns:
- The class type of the allowed term, or null if no constraint.
-
getMandatoryPositions
Description copied from interface:AtomicPatternReturns the positions that must be assigned before evaluation.- Specified by:
getMandatoryPositionsin interfaceAtomicPattern- Returns:
- An unmodifiable list of positions that are mandatory.
-
hasAssignedMandatoryParameters
Description copied from interface:AtomicPatternChecks whether all mandatory parameters are assigned.- Specified by:
hasAssignedMandatoryParametersin interfaceAtomicPattern- Parameters:
positionsAssignation- the assignation of the positions- Returns:
- true iff the mandatory parameters are assigned
-
toString
-