net.ontopia.topicmaps.query.impl.basic
Class RulePredicate

java.lang.Object
  extended by net.ontopia.topicmaps.query.impl.basic.AbstractQueryProcessor
      extended by 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
protected  ParsedRule rule
           
protected  java.lang.String signature
           
 
Constructor Summary
RulePredicate(ParsedRule rule)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.util.List getClauses()
           
 int getCost(boolean[] boundparams)
          INTERNAL.
 java.lang.String getName()
          INTERNAL: Returns the name of the predicate.
 java.util.List getParameters()
           
 java.lang.String getSignature()
          INTERNAL: Returns a string representing the signature of the predicate.
 boolean replaceable()
          INTERNAL: Checks to see if this rule is simply an alias.
 QueryMatches satisfy(QueryMatches extmatches, java.lang.Object[] extarguments)
           
 PredicateClause translate(java.util.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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rule

protected ParsedRule rule

signature

protected java.lang.String signature
Constructor Detail

RulePredicate

public RulePredicate(ParsedRule rule)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: PredicateIF
INTERNAL: 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:
getName in interface PredicateIF

getSignature

public java.lang.String getSignature()
                              throws InvalidQueryException
Description copied from interface: PredicateIF
INTERNAL: 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:
getSignature in interface PredicateIF
Throws:
InvalidQueryException

getCost

public int getCost(boolean[] boundparams)
Description copied from interface: PredicateIF
INTERNAL.

Specified by:
getCost in interface PredicateIF

satisfy

public QueryMatches satisfy(QueryMatches extmatches,
                            java.lang.Object[] extarguments)
                     throws InvalidQueryException
Specified by:
satisfy in interface BasicPredicateIF
Throws:
InvalidQueryException

getClauses

public java.util.List getClauses()

getParameters

public java.util.List getParameters()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

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(java.util.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.



Copyright © 2000-2012 Ontopia.