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

java.lang.Object
  extended by net.ontopia.topicmaps.query.impl.basic.PredicateUtils

public class PredicateUtils
extends java.lang.Object

INTERNAL: Shared utilities for the predicate implementations.


Field Summary
static int ASSOCIATION_TO_ROLE
           
static int EQUAL_TO_EQUAL
           
static int FILTER_ASSOCIATION_ROLE
           
static int FILTER_DATATYPE
           
static int FILTER_EQUALS
           
static int FILTER_ID
           
static int FILTER_OCCURRENCE
           
static int FILTER_REIFIES
           
static int FILTER_RESOURCE
           
static int FILTER_ROLE_PLAYER
           
static int FILTER_SCOPE
           
static int FILTER_SRCLOC
           
static int FILTER_STR_CONTAINS
           
static int FILTER_STR_ENDS_WITH
           
static int FILTER_STR_LENGTH
           
static int FILTER_STR_STARTS_WITH
           
static int FILTER_SUBJID
           
static int FILTER_SUBJLOC
           
static int FILTER_TOPIC_NAME
           
static int FILTER_TYPE
           
static int FILTER_VALUE
           
static int FILTER_VARIANT
           
static int GENERATE_DATATYPE
           
static int GENERATE_ID
           
static int GENERATE_OCCURRENCE
           
static int GENERATE_REIFIES
           
static int GENERATE_RESOURCES
           
static int GENERATE_ROLE_PLAYER
           
static int GENERATE_ROLES
           
static int GENERATE_SCOPED
           
static int GENERATE_SRCLOC
           
static int GENERATE_SUBJID
           
static int GENERATE_SUBJLOC
           
static int GENERATE_TOPIC_NAME
           
static int GENERATE_TYPE
           
static int GENERATE_VALUE
           
static int GENERATE_VARIANTS
           
static int ID_TO_OBJECT
           
static int INSTANCE_TO_TYPE
           
static int NAME_TO_TOPIC
           
static int NO_OPERATION
           
static int OBJECT_TO_DATATYPE
           
static int OBJECT_TO_ID
           
static int OBJECT_TO_RESOURCE
           
static int OBJECT_TO_SRCLOC
           
static int OBJECT_TO_VALUE
           
static int OCCURRENCE_TO_TOPIC
           
static int REIFIED_TO_REIFIER
           
static int REIFIER_TO_REIFIED
           
static int RESOURCE_TO_OBJECT
           
static int ROLE_TO_ASSOCIATION
           
static int ROLE_TO_PLAYER
           
static int SCOPED_TO_THEME
           
static int SRCLOC_TO_OBJECT
           
static int STR_TO_LENGTH
           
static int SUBJID_TO_TOPIC
           
static int SUBJLOC_TO_TOPIC
           
static int THEME_TO_SCOPED
           
static int TNAME_TO_VNAME
           
static int TOPIC_TO_NAME
           
static int TOPIC_TO_OCCURRENCE
           
static int TOPIC_TO_SUBJID
           
static int TOPIC_TO_SUBJLOC
           
static int VNAME_TO_TNAME
           
 
Constructor Summary
PredicateUtils()
           
 
Method Summary
static QueryMatches collectionToOne(QueryMatches matches, java.lang.Object[] objects, int fromix, int toix, int operation)
          Given a collection of objects, produce a single new object from each of them and put it into the toix column.
static int compare(java.lang.Object o1, java.lang.Object o2)
           
static QueryMatches filter(QueryMatches matches, int ix1, int ix2, java.lang.Class class1, java.lang.Class class2, int operation)
           
static QueryMatches filterClass(QueryMatches matches, int ix1, java.lang.Class klass)
          Filters a result set so that only rows where the object in a specific column is an instance of a specific class are accepted.
static QueryMatches generateFromCollection(QueryMatches matches, int fromix, int toix, java.util.Collection startset, int operation)
          Assuming both columns are empty, iterate over a collection of start values, binding the first column to the start value, and the second column to each object in a collection generated from the start value.
static java.util.Collection getAllObjects(TopicMapIF topicmap)
          Returns all topic map objects in the topic map.
static QueryMatches objectToMany(QueryMatches matches, int fromix, int toix, java.lang.Class fromclass, int operation, IndexIF index)
           
static QueryMatches objectToMany(QueryMatches matches, int fromix, int toix, java.lang.Class fromclass, int operation, IndexIF index1, IndexIF index2)
           
static QueryMatches objectToOne(QueryMatches matches, int fromix, int toix, java.lang.Class fromclass, int operation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_OPERATION

public static final int NO_OPERATION
See Also:
Constant Field Values

NAME_TO_TOPIC

public static final int NAME_TO_TOPIC
See Also:
Constant Field Values

OCCURRENCE_TO_TOPIC

public static final int OCCURRENCE_TO_TOPIC
See Also:
Constant Field Values

ROLE_TO_ASSOCIATION

public static final int ROLE_TO_ASSOCIATION
See Also:
Constant Field Values

REIFIER_TO_REIFIED

public static final int REIFIER_TO_REIFIED
See Also:
Constant Field Values

REIFIED_TO_REIFIER

public static final int REIFIED_TO_REIFIER
See Also:
Constant Field Values

INSTANCE_TO_TYPE

public static final int INSTANCE_TO_TYPE
See Also:
Constant Field Values

OBJECT_TO_VALUE

public static final int OBJECT_TO_VALUE
See Also:
Constant Field Values

ROLE_TO_PLAYER

public static final int ROLE_TO_PLAYER
See Also:
Constant Field Values

OBJECT_TO_RESOURCE

public static final int OBJECT_TO_RESOURCE
See Also:
Constant Field Values

VNAME_TO_TNAME

public static final int VNAME_TO_TNAME
See Also:
Constant Field Values

SUBJLOC_TO_TOPIC

public static final int SUBJLOC_TO_TOPIC
See Also:
Constant Field Values

SRCLOC_TO_OBJECT

public static final int SRCLOC_TO_OBJECT
See Also:
Constant Field Values

SUBJID_TO_TOPIC

public static final int SUBJID_TO_TOPIC
See Also:
Constant Field Values

STR_TO_LENGTH

public static final int STR_TO_LENGTH
See Also:
Constant Field Values

OBJECT_TO_ID

public static final int OBJECT_TO_ID
See Also:
Constant Field Values

ID_TO_OBJECT

public static final int ID_TO_OBJECT
See Also:
Constant Field Values

EQUAL_TO_EQUAL

public static final int EQUAL_TO_EQUAL
See Also:
Constant Field Values

OBJECT_TO_DATATYPE

public static final int OBJECT_TO_DATATYPE
See Also:
Constant Field Values

ASSOCIATION_TO_ROLE

public static final int ASSOCIATION_TO_ROLE
See Also:
Constant Field Values

SCOPED_TO_THEME

public static final int SCOPED_TO_THEME
See Also:
Constant Field Values

RESOURCE_TO_OBJECT

public static final int RESOURCE_TO_OBJECT
See Also:
Constant Field Values

TNAME_TO_VNAME

public static final int TNAME_TO_VNAME
See Also:
Constant Field Values

THEME_TO_SCOPED

public static final int THEME_TO_SCOPED
See Also:
Constant Field Values

TOPIC_TO_SUBJLOC

public static final int TOPIC_TO_SUBJLOC
See Also:
Constant Field Values

TOPIC_TO_SUBJID

public static final int TOPIC_TO_SUBJID
See Also:
Constant Field Values

OBJECT_TO_SRCLOC

public static final int OBJECT_TO_SRCLOC
See Also:
Constant Field Values

TOPIC_TO_OCCURRENCE

public static final int TOPIC_TO_OCCURRENCE
See Also:
Constant Field Values

TOPIC_TO_NAME

public static final int TOPIC_TO_NAME
See Also:
Constant Field Values

FILTER_ROLE_PLAYER

public static final int FILTER_ROLE_PLAYER
See Also:
Constant Field Values

FILTER_REIFIES

public static final int FILTER_REIFIES
See Also:
Constant Field Values

FILTER_TOPIC_NAME

public static final int FILTER_TOPIC_NAME
See Also:
Constant Field Values

FILTER_VALUE

public static final int FILTER_VALUE
See Also:
Constant Field Values

FILTER_TYPE

public static final int FILTER_TYPE
See Also:
Constant Field Values

FILTER_VARIANT

public static final int FILTER_VARIANT
See Also:
Constant Field Values

FILTER_SCOPE

public static final int FILTER_SCOPE
See Also:
Constant Field Values

FILTER_ASSOCIATION_ROLE

public static final int FILTER_ASSOCIATION_ROLE
See Also:
Constant Field Values

FILTER_RESOURCE

public static final int FILTER_RESOURCE
See Also:
Constant Field Values

FILTER_SUBJLOC

public static final int FILTER_SUBJLOC
See Also:
Constant Field Values

FILTER_SUBJID

public static final int FILTER_SUBJID
See Also:
Constant Field Values

FILTER_SRCLOC

public static final int FILTER_SRCLOC
See Also:
Constant Field Values

FILTER_STR_STARTS_WITH

public static final int FILTER_STR_STARTS_WITH
See Also:
Constant Field Values

FILTER_STR_CONTAINS

public static final int FILTER_STR_CONTAINS
See Also:
Constant Field Values

FILTER_STR_LENGTH

public static final int FILTER_STR_LENGTH
See Also:
Constant Field Values

FILTER_ID

public static final int FILTER_ID
See Also:
Constant Field Values

FILTER_EQUALS

public static final int FILTER_EQUALS
See Also:
Constant Field Values

FILTER_OCCURRENCE

public static final int FILTER_OCCURRENCE
See Also:
Constant Field Values

FILTER_STR_ENDS_WITH

public static final int FILTER_STR_ENDS_WITH
See Also:
Constant Field Values

FILTER_DATATYPE

public static final int FILTER_DATATYPE
See Also:
Constant Field Values

GENERATE_REIFIES

public static final int GENERATE_REIFIES
See Also:
Constant Field Values

GENERATE_VALUE

public static final int GENERATE_VALUE
See Also:
Constant Field Values

GENERATE_TYPE

public static final int GENERATE_TYPE
See Also:
Constant Field Values

GENERATE_RESOURCES

public static final int GENERATE_RESOURCES
See Also:
Constant Field Values

GENERATE_SUBJLOC

public static final int GENERATE_SUBJLOC
See Also:
Constant Field Values

GENERATE_ID

public static final int GENERATE_ID
See Also:
Constant Field Values

GENERATE_DATATYPE

public static final int GENERATE_DATATYPE
See Also:
Constant Field Values

GENERATE_TOPIC_NAME

public static final int GENERATE_TOPIC_NAME
See Also:
Constant Field Values

GENERATE_OCCURRENCE

public static final int GENERATE_OCCURRENCE
See Also:
Constant Field Values

GENERATE_VARIANTS

public static final int GENERATE_VARIANTS
See Also:
Constant Field Values

GENERATE_ROLES

public static final int GENERATE_ROLES
See Also:
Constant Field Values

GENERATE_ROLE_PLAYER

public static final int GENERATE_ROLE_PLAYER
See Also:
Constant Field Values

GENERATE_SCOPED

public static final int GENERATE_SCOPED
See Also:
Constant Field Values

GENERATE_SUBJID

public static final int GENERATE_SUBJID
See Also:
Constant Field Values

GENERATE_SRCLOC

public static final int GENERATE_SRCLOC
See Also:
Constant Field Values
Constructor Detail

PredicateUtils

public PredicateUtils()
Method Detail

objectToOne

public static QueryMatches objectToOne(QueryMatches matches,
                                       int fromix,
                                       int toix,
                                       java.lang.Class fromclass,
                                       int operation)
                                throws InvalidQueryException
Throws:
InvalidQueryException

objectToMany

public static QueryMatches objectToMany(QueryMatches matches,
                                        int fromix,
                                        int toix,
                                        java.lang.Class fromclass,
                                        int operation,
                                        IndexIF index)
                                 throws InvalidQueryException
Throws:
InvalidQueryException

objectToMany

public static QueryMatches objectToMany(QueryMatches matches,
                                        int fromix,
                                        int toix,
                                        java.lang.Class fromclass,
                                        int operation,
                                        IndexIF index1,
                                        IndexIF index2)
                                 throws InvalidQueryException
Throws:
InvalidQueryException

filter

public static QueryMatches filter(QueryMatches matches,
                                  int ix1,
                                  int ix2,
                                  java.lang.Class class1,
                                  java.lang.Class class2,
                                  int operation)
                           throws InvalidQueryException
Throws:
InvalidQueryException

collectionToOne

public static QueryMatches collectionToOne(QueryMatches matches,
                                           java.lang.Object[] objects,
                                           int fromix,
                                           int toix,
                                           int operation)
Given a collection of objects, produce a single new object from each of them and put it into the toix column. So for each row in the input result, either remove it (if it's of the wrong type, or if it has no new object) or insert the new object in the toix column.


generateFromCollection

public static QueryMatches generateFromCollection(QueryMatches matches,
                                                  int fromix,
                                                  int toix,
                                                  java.util.Collection startset,
                                                  int operation)
Assuming both columns are empty, iterate over a collection of start values, binding the first column to the start value, and the second column to each object in a collection generated from the start value.


filterClass

public static QueryMatches filterClass(QueryMatches matches,
                                       int ix1,
                                       java.lang.Class klass)
Filters a result set so that only rows where the object in a specific column is an instance of a specific class are accepted.


getAllObjects

public static java.util.Collection getAllObjects(TopicMapIF topicmap)
Returns all topic map objects in the topic map.


compare

public static int compare(java.lang.Object o1,
                          java.lang.Object o2)


Copyright © 2000-2012 Ontopia.