public class SearchClause extends SearchQualification
The SearchClause is a subClass of SearchQualification, this allows the composed Qualification of a SearchClause to be another SearchClause. This way a SearchTree of any depth can be constructed.
The SearchClause is an instance of the 'Composite Pattern', for details see 'Design Patterns' by Gamma et. all.
// Usage Examples // Let's assume we have the following pre constructed qualifications AttributeQualification aq1, aq2; FolderRestrictQualification frq1; JoinQualification jq1; // Now we use SearchClause to put together these qualifications into // search tree. This shows the use AND, OR, NOT operators and also // re-using the search clause object to construct the tree. // Using and operator // SQL - ( (aq1) AND (aq2) ) where aq1 and aq2 are the SQL clauses // generated by AttributeQualifications aq1 and aq2 respectively. SearchClause sc = new SearchClause(aq1, aq2, SearchClause.AND); // Using the OR operator // SQL - ( (aq1) OR (aq2) ) where aq1 and aq2 are the SQL clauses // generated by AttributeQualifications aq1 and aq2 respectively. SearchClause sc = new SearchClause(aq1, aq2, SearchClause.OR); // Using the NOT operator // SQL - ( NOT (aq1) ) where aq1 is the SQL clauses // generated by AttributeQualifications aq1. SearchClause sc = new SearchClause(null, aq1, SearchClause.NOT); // Building a composit search tree with more than one level. // SQL - jq1 AND ( frq1 or (aq1 and aq2) ) SearchClause sc = new SearchClause(aq1, aq2, SearchClause.AND); // Note that search clause built on the last line is being reused as one of // components making the new search clause. sc = new SearchClause(sc, frq1, SearchClause.OR); sc = new SearchClause(sc, jq1, SearchClause.AND);
Modifier and Type | Field and Description |
---|---|
static int |
AND
Represents the 'AND' operator.
|
protected static String |
AND_STR
Represents the 'AND' operator string.
|
protected SearchQualification |
m_Lhs
The Left Hand Side Qualification.
|
protected int |
m_Oper
Composing Operator.
|
protected SearchQualification |
m_Rhs
The Right Hand Qualification.
|
static int |
NOT
Represents the 'NOT' operator
|
protected static String |
NOT_STR
Represents the 'NOT' operator string
|
static int |
OR
Represents the 'OR' operator.
|
protected static String |
OR_STR
Represents the 'OR' operator string.
|
LATE_BIND_OPER
Constructor and Description |
---|
SearchClause()
Constructs a SearchClause.
|
SearchClause(SearchQualification l,
SearchQualification r,
int oper)
Constructs a SearchClause.
|
SearchClause(SearchQualification l,
SearchQualification r,
String oper)
Constructs a SearchClause.
|
Modifier and Type | Method and Description |
---|---|
protected void |
accept(oracle.ifs.search.SearchQualificationVisitor v)
Accepts a SearchQualificationVisitor.
|
Object |
clone()
Returns a clone of this SearchClause.
|
SearchQualification |
getLeftSearchQualification()
Returns the left side SearchQualification.
|
int |
getOperatorType()
Return the composing operator.
|
SearchQualification |
getRightSearchQualification()
Return the right side SearchQualification.
|
static String |
operatorTypeName(int oper)
Returns the operator type string for a given operator.
|
void |
setLeftSearchQualification(SearchQualification s)
Set the left hand side SearchQualification.
|
void |
setOperatorType(int oper)
Set the composing operator.
|
void |
setOperatorType(String oper)
Set the operator to put together SearchQualifications.
|
void |
setRightSearchQualification(SearchQualification s)
Set the right side SearchQualification.
|
protected boolean |
traverseBothSides()
Used by Visitors to decide how traversal should proceed.
|
isLateBound
public static final int NOT
protected static final String NOT_STR
public static final int AND
protected static final String AND_STR
public static final int OR
protected static final String OR_STR
protected SearchQualification m_Lhs
protected SearchQualification m_Rhs
protected int m_Oper
public SearchClause()
public SearchClause(SearchQualification l, SearchQualification r, String oper) throws IfsException
l
- LHS Qualificationr
- RHS Qualificationoper
- composing operator, should be AND, OR or NOT.IfsException
- 22103 if oper is not valid.public SearchClause(SearchQualification l, SearchQualification r, int oper) throws IfsException
l
- LHS Qualificationr
- RHS Qualificationoper
- composing operator, should be AND, OR or NOT. Use public constants
SearchClause.NOT, SearchClause.OR, SearchClause.AND
IfsException
- 22103 if oper is not valid.public void setLeftSearchQualification(SearchQualification s) throws IfsException
s
- the composed qualificationIfsException
- if the operation failspublic SearchQualification getLeftSearchQualification() throws IfsException
IfsException
- if the operation failspublic void setRightSearchQualification(SearchQualification s) throws IfsException
s
- the composed qualificationIfsException
- if the operation failspublic SearchQualification getRightSearchQualification()
public void setOperatorType(String oper) throws IfsException
oper
- composing operator; Must be one of, AND, OR, NOT.IfsException
- if operation fails.public void setOperatorType(int oper) throws IfsException
oper
- composing operator; Must be one of,
SearchClause.AND
SearchClause.OR
SearchClause.NOT
IfsException
- if the operation failspublic int getOperatorType()
protected void accept(oracle.ifs.search.SearchQualificationVisitor v) throws IfsException
accept
in class SearchQualification
v
- SearchQualificationVisitorIfsException
- thrown if Visitor code throws.protected boolean traverseBothSides() throws IfsException
IfsException
- 22002, if Qualifications are null or operator is incorrect.public Object clone()
clone
in class SearchQualification
public static String operatorTypeName(int oper)
oper
- integer representing the operator; must be one of
SearchClause.AND
,
SearchClause.OR
,
SearchClause.NOT
IfsException
- if the operation failsCopyright © 2023. All rights reserved.