|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.ifs.search.SearchQualification | +--oracle.ifs.search.SearchClause
A SearchClause provides the means of combining Individual Qualifications into a SearchTree. A SearchClause composes one or two Qualifications. The composing operators are AND, OR or NOT. The first two compose two Qualifications, while NOT takes one Qualification. Their semantics are obvious. For the NOT operator the RHS Qualification is used.
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.
// Code Sample
//
// Search Clause is used to express AND, OR, NOT operations on 1 or 2 operands.
// See a case ANDing and AttribuuteQualification and JoinQualification below.
//
AtrributeQualification aq;
JoinQualification jq;
//
SearchClause sc = new SearchClause(aq, jq, SearchClause.AND)
//
// Search clause can be built from Search Clauses also.
SearchClause sc1, sc2;
SearchClause sc = new SearchCaluse(sc1, sc2, SearchClause.OR)
//
// Example below shows implementing a complete WHERE condition.
// WHERE Document.Name like 'Doc%' AND
// Document is in "/home/tuser1"
//
// Create a AttributeQualification Search
AttributeQualification aq = new AttributeQualification();
aq.setAttribute("DOCUMENT", "NAME");
aq.setOperatorType(AttributeQualification.LIKE);
aq.setValue("Doc%");
//
// Create Folder Restrict option now.
FolderRestrictQualification frq = new FolderRestrictQualification();
FolderPathResolver fpr;
Folder startFolder = (Folder) fpr.findPublicObjectByPath("/home/tuser1");
frq.setStartFolder(startFolder);
frq.setMaxLevels(1);
//
// Now put the two together.
SearchClause sc = new SearchCaluse(aq, frq, SearchCaluse.AND);
Field Summary | |
static int |
AND
Represents the 'AND' operator. |
static int |
NOT
Represents the 'NOT' operator |
static int |
OR
Represents the 'OR' operator. |
Constructor Summary | |
SearchClause()
Constructs a SearchClause. |
|
SearchClause(SearchQualification l,
SearchQualification r,
int oper)
Constructs a SearchClause. |
|
SearchClause(SearchQualification l,
SearchQualification r,
java.lang.String oper)
Constructs a SearchClause. |
Method Summary | |
java.lang.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. |
void |
setLeftSearchQualification(SearchQualification s)
Set the left hand side SearchQualification. |
void |
setOperatorType(int oper)
Set the composing operator. |
void |
setOperatorType(java.lang.String oper)
Set the operator to put together SearchQualifications. |
void |
setRightSearchQualification(SearchQualification s)
Set the right side SearchQualification. |
Field Detail |
public static final int NOT
public static final int AND
public static final int OR
Constructor Detail |
public SearchClause()
public SearchClause(SearchQualification l, SearchQualification r, java.lang.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.Method Detail |
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(java.lang.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()
public java.lang.Object clone()
clone
in class SearchQualification
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |