Class RulePredicate
- java.lang.Object
-
- net.ontopia.topicmaps.query.impl.basic.AbstractQueryProcessor
-
- net.ontopia.topicmaps.query.impl.basic.RulePredicate
-
- All Implemented Interfaces:
BasicPredicateIF,PredicateIF
- Direct Known Subclasses:
RulePredicate
public class RulePredicate extends AbstractQueryProcessor implements BasicPredicateIF
INTERNAL: Implements rule predicates.
-
-
Field Summary
Fields Modifier and Type Field Description protected ParsedRuleruleprotected Stringsignature
-
Constructor Summary
Constructors Constructor Description RulePredicate(ParsedRule rule)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)ListgetClauses()intgetCost(boolean[] boundparams)INTERNAL.StringgetName()INTERNAL: Returns the name of the predicate.ListgetParameters()StringgetSignature()INTERNAL: Returns a string representing the signature of the predicate.booleanreplaceable()INTERNAL: Checks to see if this rule is simply an alias.QueryMatchessatisfy(QueryMatches extmatches, Object[] extarguments)PredicateClausetranslate(List arguments)INTERNAL: Creates a new PredicateClause representing the content of this rule inlined in an environment where the arguments in the args parameter have been passed to the predicate.-
Methods inherited from class net.ontopia.topicmaps.query.impl.basic.AbstractQueryProcessor
findClauseItems, findClauseVariables, satisfy
-
-
-
-
Field Detail
-
rule
protected ParsedRule rule
-
signature
protected String signature
-
-
Constructor Detail
-
RulePredicate
public RulePredicate(ParsedRule rule)
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:PredicateIFINTERNAL: Returns the name of the predicate. This will usually be the name of the predicate within its module ('instance-of', '/=', 'starts-with'), but some virtual predicates cannot be reached from the syntax and may return names that will not parse.- Specified by:
getNamein interfacePredicateIF
-
getSignature
public String getSignature() throws InvalidQueryException
Description copied from interface:PredicateIFINTERNAL: Returns a string representing the signature of the predicate. The string consists of a whitespace-separated list of arguments, where each argument is made up of tokens representing the type or cardinality of that argument.The instance-of predicate would have a signature of "t t", while /= would have ". .", and in would have ". .+". For full details, see topicmaps.impl.utils.ArgumentValidator.
- Specified by:
getSignaturein interfacePredicateIF- Throws:
InvalidQueryException
-
getCost
public int getCost(boolean[] boundparams)
Description copied from interface:PredicateIFINTERNAL.- Specified by:
getCostin interfacePredicateIF
-
satisfy
public QueryMatches satisfy(QueryMatches extmatches, Object[] extarguments) throws InvalidQueryException
- Specified by:
satisfyin interfaceBasicPredicateIF- Throws:
InvalidQueryException
-
getClauses
public List getClauses()
-
getParameters
public List getParameters()
-
replaceable
public boolean replaceable()
INTERNAL: Checks to see if this rule is simply an alias. If it is the optimizer can do an inline replacement of it to optimize other rules as well as queries that use it.
-
translate
public PredicateClause translate(List arguments)
INTERNAL: Creates a new PredicateClause representing the content of this rule inlined in an environment where the arguments in the args parameter have been passed to the predicate.
-
-