Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.search
Class SearchClause

    java.lang.Object
      oracle.ifs.search.SearchQualification
          oracle.ifs.search.SearchClause

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable

    public class SearchClause

extends SearchQualification

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.

>      // 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);

See Also:
  Serialized Form
(Published)

Field Summary
`static int` | `AND` Represents the 'AND' operator.
`protected static java.lang.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 java.lang.String` | `NOT_STR` Represents the 'NOT' operator string
`static int` | `OR` Represents the 'OR' operator.
`protected static java.lang.String` | `OR_STR` Represents the 'OR' operator string.

Fields inherited from class oracle.ifs.search.SearchQualification
`LATE_BIND_OPER`

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
`protected void` | `accept(oracle.ifs.search.SearchQualificationVisitor v)` Accepts a SearchQualificationVisitor.
`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.
`static java.lang.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(java.lang.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.

Methods inherited from class oracle.ifs.search.SearchQualification
`isLateBound`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### NOT

    public static final int NOT

  Description copied from class: `SearchClause`
  Represents the 'NOT' operator

  See Also:
    Constant Field Values
  (Published)

### NOT_STR

    protected static final java.lang.String NOT_STR

  Description copied from class: `SearchClause`
  Represents the 'NOT' operator string

  See Also:
    Constant Field Values
  (Unpublished)

### AND

    public static final int AND

  Description copied from class: `SearchClause`
  Represents the 'AND' operator.

  See Also:
    Constant Field Values
  (Published)

### AND_STR

    protected static final java.lang.String AND_STR

  Description copied from class: `SearchClause`
  Represents the 'AND' operator string.

  See Also:
    Constant Field Values
  (Unpublished)

### OR

    public static final int OR

  Description copied from class: `SearchClause`
  Represents the 'OR' operator.

  See Also:
    Constant Field Values
  (Published)

### OR_STR

    protected static final java.lang.String OR_STR

  Description copied from class: `SearchClause`
  Represents the 'OR' operator string.

  See Also:
    Constant Field Values
  (Unpublished)

### m_Lhs

    protected SearchQualification m_Lhs

  Description copied from class: `SearchClause`
  The Left Hand Side Qualification. Default is null.

  (Unpublished)

### m_Rhs

    protected SearchQualification m_Rhs

  Description copied from class: `SearchClause`
  The Right Hand Qualification. Default is null.

  (Unpublished)

### m_Oper

    protected int m_Oper

  Description copied from class: `SearchClause`
  Composing Operator. There is no default.

  (Unpublished)

Constructor Detail

### SearchClause

    public SearchClause()

  Constructs a SearchClause. By default the left and right Qualifications are null.

  (Published)

### SearchClause

    public SearchClause(SearchQualification l,
                        SearchQualification r,
                        java.lang.String oper)
                 throws IfsException

  Constructs a SearchClause. Based on the Qualifications and operator.

  Parameters:
    `l` - LHS Qualification
    `r` - RHS Qualification
    `oper` - composing operator, should be AND, OR or NOT.
  Throws:
    `IfsException` - 22103 if oper is not valid.
  (Published)

### SearchClause

    public SearchClause(SearchQualification l,
                        SearchQualification r,
                        int oper)
                 throws IfsException

  Constructs a SearchClause. Based on the Qualifications and operator.

  Parameters:
    `l` - LHS Qualification
    `r` - RHS Qualification
    `oper` - composing operator, should be AND, OR or NOT. Use public constants `SearchClause.NOT, SearchClause.OR, SearchClause.AND`
  Throws:
    `IfsException` - 22103 if oper is not valid.
  (Published)

Method Detail

### setLeftSearchQualification

    public void setLeftSearchQualification(SearchQualification s)
                                    throws IfsException

  Description copied from class: `SearchClause`
  Set the left hand side SearchQualification. Null value allowed only for NOT operation.

  Parameters:
    `s` - the composed qualification
  Throws:
    `IfsException` - if the operation fails
  (Published)

### getLeftSearchQualification

    public SearchQualification getLeftSearchQualification()
                                                   throws IfsException

  Description copied from class: `SearchClause`
  Returns the left side SearchQualification.

  Returns:
    left SearchQualification.
  Throws:
    `IfsException` - if the operation fails
  (Published)

### setRightSearchQualification

    public void setRightSearchQualification(SearchQualification s)
                                     throws IfsException

  Description copied from class: `SearchClause`
  Set the right side SearchQualification. Cannot be null.

  Parameters:
    `s` - the composed qualification
  Throws:
    `IfsException` - if the operation fails
  (Published)

### getRightSearchQualification

    public SearchQualification getRightSearchQualification()

  Description copied from class: `SearchClause`
  Return the right side SearchQualification.

  Returns:
    RHS SearchQualification.
  (Published)

### setOperatorType

    public void setOperatorType(java.lang.String oper)
                         throws IfsException

  Description copied from class: `SearchClause`
  Set the operator to put together SearchQualifications.

  Parameters:
    `oper` - composing operator; Must be one of, AND, OR, NOT.
  Throws:
    `IfsException` - if operation fails.
  (Published)

### setOperatorType

    public void setOperatorType(int oper)
                         throws IfsException

  Description copied from class: `SearchClause`
  Set the composing operator.

  Parameters:
    `oper` - composing operator; Must be one of, `SearchClause.AND` `SearchClause.OR` `SearchClause.NOT`
  Throws:
    `IfsException` - if the operation fails
  (Published)

### getOperatorType

    public int getOperatorType()

  Description copied from class: `SearchClause`
  Return the composing operator.

  Returns:
    composing operator.
  (Published)

### accept

    protected void accept(oracle.ifs.search.SearchQualificationVisitor v)
                   throws IfsException

  Description copied from class: `SearchClause`
  Accepts a SearchQualificationVisitor. Calls visitSearchClause on the visitor. Default Behavior is to call accept on the LHS & RHS Qualifications. Overriding this behavior is strongly discommended(yes this is a word, it shows up as an Antonym for recommend in MS Word).

  Specified by:
    `accept` in class `SearchQualification`
  Parameters:
    `v` - SearchQualificationVisitor
  Throws:
    `IfsException` - thrown if Visitor code throws.
  (Unpublished)

### traverseBothSides

    protected boolean traverseBothSides()
                                 throws IfsException

  Description copied from class: `SearchClause`
  Used by Visitors to decide how traversal should proceed. For NOT operators only the RHS is traversed. For AND and ORs the LHS and then the RHS is traversed.

  Returns:
    true if operator is AND or OR, false if operator is NOT.
  Throws:
    `IfsException` - 22002, if Qualifications are null or operator is incorrect.
  (Unpublished)

### clone

    public java.lang.Object clone()

  Description copied from class: `SearchClause`
  Returns a clone of this SearchClause. Clones the LHS & RHS and then creates a new SearchClause from the clones.

  Overrides:
    `clone` in class `SearchQualification`
  Returns:
    Return a clone of this SearchClause.
  (Published)

### operatorTypeName

    public static java.lang.String operatorTypeName(int oper)

  Description copied from class: `SearchClause`
  Returns the operator type string for a given operator.

  Parameters:
    `oper` - integer representing the operator; must be one of `SearchClause.AND` , `SearchClause.OR` , `SearchClause.NOT`
  Returns:
    String if a valid operator, null otherwise.
  Throws:
    `IfsException` - if the operation fails
  (Published)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD