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

java.lang.Object
  extended by net.ontopia.topicmaps.query.impl.basic.AbstractInstanceOfPredicate
All Implemented Interfaces:
BasicPredicateIF, PredicateIF
Direct Known Subclasses:
DirectInstanceOfPredicate, InstanceOfPredicate

public abstract class AbstractInstanceOfPredicate
extends java.lang.Object
implements BasicPredicateIF

INTERNAL: Common superclass for the two instance-of predicates.


Field Summary
protected  ClassInstanceIndexIF index
           
protected  TopicMapIF topicmap
           
 
Constructor Summary
AbstractInstanceOfPredicate(TopicMapIF topicmap)
           
 
Method Summary
protected abstract  java.util.Collection getClasses(TopicIF instance)
          INTERNAL: Should return all applicable types of the given topic.
 int getCost(boolean[] boundparams)
          INTERNAL.
protected  java.util.Collection getDirectInstances(TopicIF classes)
          INTERNAL: Should return all instances of the topic, as seen by the specific predicate.
protected abstract  java.util.Collection getInstances(TopicIF klass)
          INTERNAL: Should return all instances of the topic, as seen by the specific predicate.
 java.lang.String getSignature()
          INTERNAL: Returns a string representing the signature of the predicate.
protected abstract  java.util.Collection getSupertypes(TopicIF type)
          INTERNAL: Should return all supertypes of the given class, including the class itself.
protected abstract  java.util.Collection getTypes()
          INTERNAL: Should return all topic types, as seen by the specific predicate.
 QueryMatches satisfy(QueryMatches result, java.lang.Object[] arguments)
           
protected abstract  void start()
          INTERNAL: Called before the evaluation of a new query, to allow resetting of internal caches etc.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.ontopia.topicmaps.query.parser.PredicateIF
getName
 

Field Detail

topicmap

protected TopicMapIF topicmap

index

protected ClassInstanceIndexIF index
Constructor Detail

AbstractInstanceOfPredicate

public AbstractInstanceOfPredicate(TopicMapIF topicmap)
Method Detail

getSignature

public java.lang.String getSignature()
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

getCost

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

Specified by:
getCost in interface PredicateIF

satisfy

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

start

protected abstract void start()
INTERNAL: Called before the evaluation of a new query, to allow resetting of internal caches etc.


getClasses

protected abstract java.util.Collection getClasses(TopicIF instance)
INTERNAL: Should return all applicable types of the given topic. In 'instance-of' this includes the supertypes of the topic's types.


getInstances

protected abstract java.util.Collection getInstances(TopicIF klass)
INTERNAL: Should return all instances of the topic, as seen by the specific predicate.


getTypes

protected abstract java.util.Collection getTypes()
INTERNAL: Should return all topic types, as seen by the specific predicate.


getSupertypes

protected abstract java.util.Collection getSupertypes(TopicIF type)
INTERNAL: Should return all supertypes of the given class, including the class itself. In 'direct-instance-of' this should just be the class itself.


getDirectInstances

protected java.util.Collection getDirectInstances(TopicIF classes)
INTERNAL: Should return all instances of the topic, as seen by the specific predicate.



Copyright © 2000-2012 Ontopia.