|
|||||||||
| Home >> All >> ojb >> broker >> [ query overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
ojb.broker.query
Class SearchFilter

java.lang.Objectojb.broker.query.SearchFilter
- Direct Known Subclasses:
- OJBSearchFilter
- public abstract class SearchFilter
- extends java.lang.Object
Class to build selection criteria for searches Search Filter Class (Abstract) This class builds a search filter tree, specifing how names and values are to be compared when searching a database. It just builds internal structures, and needs to be extended to return a search filter string or other object that can be used by the database to perform the actual search.
| Nested Class Summary | |
protected class |
SearchFilter.SearchBase
SearchBase is the base node class for the parse tree This class holds the binary operator |
protected class |
SearchFilter.SearchBaseLeaf
SearchBaseLeaf holds a leaf of the search tree This class holds an element name, and a vector of possible matches. |
protected class |
SearchFilter.SearchBaseLeafComparison
SearchBaseLeafComparison holds a leaf of the search tree This class holds an element name, a binary operator, and a value to be compared |
protected class |
SearchFilter.SearchBaseLeafInt
SearchBaseLeafInt holds a leaf of the search tree with integers This class holds an element name, and a vector of possible matches. |
protected class |
SearchFilter.SearchBaseNode
Define the class to represent a node of the search tree This class holds an operator and a vector other nodes. |
| Field Summary | |
static int |
AND
|
protected static int |
BINARY_OPER_MASK
|
static int |
EQUAL
|
protected SearchFilter.SearchBase |
filter
|
static int |
GREATER_EQUAL
|
static int |
GREATER_THAN
|
static int |
IN
|
static int |
LESS_EQUAL
|
static int |
LESS_THAN
|
static int |
LIKE
|
protected static int |
LOGICAL_OPER_MASK
|
static int |
NOT
|
static int |
NOT_EQUAL
|
static int |
NOT_IN
|
static int |
OR
|
| Constructor Summary | |
SearchFilter()
Create an empty search filter. |
|
| Method Summary | |
void |
combine(SearchFilter new_filter,
int op)
Combine one other search filters with this one, using the specific operator. |
void |
combine(java.util.Vector new_filters,
int op)
Combine other search filters with this one, using the specific operator. |
void |
compareFilter(java.lang.String ElementName,
java.lang.String value,
int oper)
Change the search filter to one that compares an element name to a value. |
protected static java.lang.String |
ConvertBinaryOperator(int oper)
Static method to convert a binary operator into a string. |
protected SearchFilter.SearchBase |
getFilter()
Get the actual filter out of the class. |
void |
matchList(java.lang.String ElementName,
int[] values,
int oper)
Change the search filter to one that specifies an element to not match one of a list of integer values. |
void |
matchList(java.lang.String ElementName,
java.lang.String[] values,
int oper)
Change the search filter to one that specifies an element to not match one of a list of values. |
void |
matchList(java.lang.String ElementName,
java.util.Vector values,
int oper)
Change the search filter to one that specifies an element to match or not match one of a list of values. |
void |
matchSet(java.util.Hashtable elements,
int combine_op,
int compare_op)
Change the search filter to one that specifies a set of elements and their values that must match, and the operator to use to combine the elements. |
void |
matchSet(java.lang.String[] ElementNames,
java.lang.String[] ElementValues,
int op)
Change the search filter to one that specifies a set of elements and their values that must match, and the operator to use to combine the elements. |
void |
matchValue(java.lang.String ElementName,
int value,
int oper)
----------------------------------------------------------- |
void |
matchValue(java.lang.String ElementName,
java.lang.String value,
int oper)
Change the search filter to one that specifies an element to not match one single value. |
abstract java.lang.String |
toString()
----------------------------------------------------------- |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
AND
public static final int AND
- See Also:
- Constant Field Values
OR
public static final int OR
- See Also:
- Constant Field Values
NOT
public static final int NOT
- See Also:
- Constant Field Values
IN
public static final int IN
- See Also:
- Constant Field Values
NOT_IN
public static final int NOT_IN
- See Also:
- Constant Field Values
LIKE
public static final int LIKE
- See Also:
- Constant Field Values
EQUAL
public static final int EQUAL
- See Also:
- Constant Field Values
NOT_EQUAL
public static final int NOT_EQUAL
- See Also:
- Constant Field Values
LESS_THAN
public static final int LESS_THAN
- See Also:
- Constant Field Values
GREATER_THAN
public static final int GREATER_THAN
- See Also:
- Constant Field Values
GREATER_EQUAL
public static final int GREATER_EQUAL
- See Also:
- Constant Field Values
LESS_EQUAL
public static final int LESS_EQUAL
- See Also:
- Constant Field Values
BINARY_OPER_MASK
protected static final int BINARY_OPER_MASK
- See Also:
- Constant Field Values
LOGICAL_OPER_MASK
protected static final int LOGICAL_OPER_MASK
- See Also:
- Constant Field Values
filter
protected SearchFilter.SearchBase filter
| Constructor Detail |
SearchFilter
public SearchFilter()
- Create an empty search filter.
| Method Detail |
matchList
public void matchList(java.lang.String ElementName, java.util.Vector values, int oper)
- Change the search filter to one that specifies an element to
match or not match one of a list of values.
The old search filter is deleted.
matchList
public void matchList(java.lang.String ElementName, java.lang.String[] values, int oper)
- Change the search filter to one that specifies an element to not
match one of a list of values.
The old search filter is deleted.
matchList
public void matchList(java.lang.String ElementName, int[] values, int oper)
- Change the search filter to one that specifies an element to not
match one of a list of integer values.
The old search filter is deleted.
matchValue
public void matchValue(java.lang.String ElementName, java.lang.String value, int oper)
- Change the search filter to one that specifies an element to not
match one single value.
The old search filter is deleted.
matchValue
public void matchValue(java.lang.String ElementName, int value, int oper)
- -----------------------------------------------------------
compareFilter
public void compareFilter(java.lang.String ElementName, java.lang.String value, int oper) throws DBException
- Change the search filter to one that compares an element name to a value.
The old search filter is deleted.
matchSet
public void matchSet(java.util.Hashtable elements, int combine_op, int compare_op) throws DBException
- Change the search filter to one that specifies a set of elements and their values
that must match, and the operator to use to combine the elements.
Each key is compared for an equal match to the value, and all
comparisons are combined by the specified logical operator (OR or AND).
The old search filter is deleted.
matchSet
public void matchSet(java.lang.String[] ElementNames, java.lang.String[] ElementValues, int op) throws DBException
- Change the search filter to one that specifies a set of elements and their values
that must match, and the operator to use to combine the elements.
Each element name is compared for an equal match to the value, and all
comparisons are combined by the specified logical operator (OR or AND).
The old search filter is deleted.
combine
public void combine(java.util.Vector new_filters, int op) throws DBException
- Combine other search filters with this one, using the specific operator.
combine
public void combine(SearchFilter new_filter, int op) throws DBException
- Combine one other search filters with this one, using the specific operator.
ConvertBinaryOperator
protected static java.lang.String ConvertBinaryOperator(int oper)
- Static method to convert a binary operator into a string.
getFilter
protected SearchFilter.SearchBase getFilter()
- Get the actual filter out of the class.
This is only needed when combining filters together
and one instantiation has to get the filter from another.
However, I do not know how to protect it from outside use.
toString
public abstract java.lang.String toString()
- -----------------------------------------------------------
|
|||||||||
| Home >> All >> ojb >> broker >> [ query overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
ojb.broker.query.SearchFilter