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 Details

  • Constructor Details

    • AbstractInstanceOfPredicate

      public AbstractInstanceOfPredicate(TopicMapIF topicmap)
  • Method Details

    • 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 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, 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 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.