Class AbstractInstanceOfPredicate
- java.lang.Object
-
- net.ontopia.topicmaps.query.impl.basic.AbstractInstanceOfPredicate
-
- All Implemented Interfaces:
BasicPredicateIF
,PredicateIF
- Direct Known Subclasses:
DirectInstanceOfPredicate
,InstanceOfPredicate
public abstract class AbstractInstanceOfPredicate extends Object implements BasicPredicateIF
INTERNAL: Common superclass for the two instance-of predicates.
-
-
Field Summary
Fields Modifier and Type Field Description protected ClassInstanceIndexIF
index
protected TopicMapIF
topicmap
-
Constructor Summary
Constructors Constructor Description AbstractInstanceOfPredicate(TopicMapIF topicmap)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Collection
getClasses(TopicIF instance)
INTERNAL: Should return all applicable types of the given topic.int
getCost(boolean[] boundparams)
INTERNAL.protected Collection
getDirectInstances(TopicIF classes)
INTERNAL: Should return all instances of the topic, as seen by the specific predicate.protected abstract Collection
getInstances(TopicIF klass)
INTERNAL: Should return all instances of the topic, as seen by the specific predicate.String
getSignature()
INTERNAL: Returns a string representing the signature of the predicate.protected abstract Collection
getSupertypes(TopicIF type)
INTERNAL: Should return all supertypes of the given class, including the class itself.protected abstract Collection
getTypes()
INTERNAL: Should return all topic types, as seen by the specific predicate.QueryMatches
satisfy(QueryMatches result, 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 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 interfacePredicateIF
-
getCost
public int getCost(boolean[] boundparams)
Description copied from interface:PredicateIF
INTERNAL.- Specified by:
getCost
in interfacePredicateIF
-
satisfy
public QueryMatches satisfy(QueryMatches result, Object[] arguments) throws InvalidQueryException
- Specified by:
satisfy
in interfaceBasicPredicateIF
- 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 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 Collection getInstances(TopicIF klass)
INTERNAL: Should return all instances of the topic, as seen by the specific predicate.
-
getTypes
protected abstract Collection getTypes()
INTERNAL: Should return all topic types, as seen by the specific predicate.
-
getSupertypes
protected abstract 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 Collection getDirectInstances(TopicIF classes)
INTERNAL: Should return all instances of the topic, as seen by the specific predicate.
-
-