Class PredicateUtils
- java.lang.Object
-
- net.ontopia.topicmaps.query.impl.basic.PredicateUtils
-
public class PredicateUtils extends Object
INTERNAL: Shared utilities for the predicate implementations.
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description PredicateUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static QueryMatches
collectionToOne(QueryMatches matches, 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(Object o1, Object o2)
static QueryMatches
filter(QueryMatches matches, int ix1, int ix2, Class class1, Class class2, int operation)
static QueryMatches
filterClass(QueryMatches matches, int ix1, 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, 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 Collection
getAllObjects(TopicMapIF topicmap)
Returns all topic map objects in the topic map.static QueryMatches
objectToMany(QueryMatches matches, int fromix, int toix, Class fromclass, int operation, IndexIF index)
static QueryMatches
objectToMany(QueryMatches matches, int fromix, int toix, Class fromclass, int operation, IndexIF index1, IndexIF index2)
static QueryMatches
objectToOne(QueryMatches matches, int fromix, int toix, Class fromclass, int operation)
-
-
-
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
-
-
Method Detail
-
objectToOne
public static QueryMatches objectToOne(QueryMatches matches, int fromix, int toix, Class fromclass, int operation) throws InvalidQueryException
- Throws:
InvalidQueryException
-
objectToMany
public static QueryMatches objectToMany(QueryMatches matches, int fromix, int toix, Class fromclass, int operation, IndexIF index) throws InvalidQueryException
- Throws:
InvalidQueryException
-
objectToMany
public static QueryMatches objectToMany(QueryMatches matches, int fromix, int toix, Class fromclass, int operation, IndexIF index1, IndexIF index2) throws InvalidQueryException
- Throws:
InvalidQueryException
-
filter
public static QueryMatches filter(QueryMatches matches, int ix1, int ix2, Class class1, Class class2, int operation) throws InvalidQueryException
- Throws:
InvalidQueryException
-
collectionToOne
public static QueryMatches collectionToOne(QueryMatches matches, 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, 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, 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 Collection getAllObjects(TopicMapIF topicmap)
Returns all topic map objects in the topic map.
-
-