|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.lanl.Database.SearchFilter
Class to build selection criteria for searches
| 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 |
public static final int AND
public static final int OR
public static final int NOT
public static final int IN
public static final int NOT_IN
public static final int LIKE
public static final int EQUAL
public static final int NOT_EQUAL
public static final int LESS_THAN
public static final int GREATER_THAN
public static final int GREATER_EQUAL
public static final int LESS_EQUAL
protected static final int BINARY_OPER_MASK
protected static final int LOGICAL_OPER_MASK
protected SearchFilter.SearchBase filter
| Constructor Detail |
public SearchFilter()
| Method Detail |
public void matchList(java.lang.String ElementName,
java.util.Vector values,
int oper)
ElementName - is the name of the element to be matchedvalues - is a vector of possible matchesoper - is the IN or NOT_IN operator to indicate how to matche
public void matchList(java.lang.String ElementName,
java.lang.String[] values,
int oper)
ElementName - is the name of the element to be matchedvalues - is an array of possible matchesoper - is the IN or NOT_IN operator to indicate how to matche
public void matchList(java.lang.String ElementName,
int[] values,
int oper)
ElementName - is the name of the element to be matchedvalues - is an array of possible integer matchesoper - is the IN or NOT_IN operator to indicate how to matche
public void matchValue(java.lang.String ElementName,
java.lang.String value,
int oper)
ElementName - is the name of the element to be matchedvalue - is the value to not be matchedoper - is the IN or NOT_IN operator to indicate how to matche
public void matchValue(java.lang.String ElementName,
int value,
int oper)
ElementName - value - oper -
public void compareFilter(java.lang.String ElementName,
java.lang.String value,
int oper)
throws DBException
ElementName - is the name of the element to be testedvalue - is the value to be compared againstoper - is the binary comparison operator to be used
DBException
public void matchSet(java.util.Hashtable elements,
int combine_op,
int compare_op)
throws DBException
elements - is a hashtable holding key-value pairscombine_op - is the logical operator to be used to combine the comparisonscompare_op - is the binary operator to be used for the comparisons
DBException
public void matchSet(java.lang.String[] ElementNames,
java.lang.String[] ElementValues,
int op)
throws DBException
ElementNames - is an array of names of elements to be testedElementValues - is an array of values for the corresponding element
DBException
public void combine(java.util.Vector new_filters,
int op)
throws DBException
new_filters - is a vector of SearchFilter classes to be combinedop - is the logical operator to be used to combine the filters
DBException
public void combine(SearchFilter new_filter,
int op)
throws DBException
new_filter - is the SearchFilter class to be combinedop - is the logical operator to be used to combine the filters
DBExceptionprotected static java.lang.String ConvertBinaryOperator(int oper)
oper - is the binary comparison operator to be converted
protected SearchFilter.SearchBase getFilter()
public abstract java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||