Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Help
12c (12.1.2)

E48720-01


oracle.help.common.search
Class BooleanExpression

java.lang.Object
  extended by oracle.help.common.search.BooleanExpression

All Implemented Interfaces:
SearchExpression

public class BooleanExpression
extends java.lang.Object
implements SearchExpression

BooleanExpression is a recursive tree structure for expressing search criteria involving boolean expressions. The BooleanExpression is based on the following grammar : BooleanExpression :: BooleanExpression AND BooleanExpression BooleanExpression OR BooleanExpression BooleanExpression NOT BooleanExpression BooleanExpression + BooleanExpression BooleanExpression - BooleanExpression + BooleanExpression - BooleanExpression NOT BooleanExpression StringExpression (base case) The tree is built in such a way that StringExpression are the leaf items and the expressions occupy the branch items. For example, "Oracle Discoverer AND (Browser OR Query)" will be parsed into : AND / \ Oracle Discoverer OR / \ Browser Query


Field Summary

 

Fields inherited from interface oracle.help.common.search.SearchExpression
AND, NAND, NONE, NOT, OR

 

Constructor Summary
BooleanExpression(SearchExpression expr1, SearchExpression expr2, int operator, boolean caseSensitive)
          Constructs a BooleanExpression object.

 

Method Summary
static SearchExpression buildExpressionTree(java.lang.String buffer, boolean caseSensitive)
          Utility method to build a SearchExpression tree from list of words possibly containing paranthesis, ANDs, ORs, NOTs, "+"s and "-"s.
 java.lang.String[] getData()
          Returns the data associated with the expression.
 SearchExpression getExpression1()
          Returns the left hand side expression.
 SearchExpression getExpression2()
          Returns the right hand side expression.
 int getOperator()
          Returns the operator for this boolean expression.
static int isBooleanOperator(java.lang.String word)
           
 boolean isCaseSensitive()
          Returns true if the SearchExpression is case sensitive, and false otherwise.
 void print()
          Prints a SearchExpression recursively.
 void setCaseSensitive(boolean caseSensitive)
           

 

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

 

Constructor Detail

BooleanExpression

public BooleanExpression(SearchExpression expr1,
                         SearchExpression expr2,
                         int operator,
                         boolean caseSensitive)
Constructs a BooleanExpression object. This constructs a branch level item from two SearchExpression items.
Parameters:
expr1 - SearchExpression1
expr2 - SearchExpression2
operator - Possible values are SearchExpression.AND, SearchExpression.OR and SearchExpression.NOT

Method Detail

getExpression1

public SearchExpression getExpression1()
Returns the left hand side expression.
Specified by:
getExpression1 in interface SearchExpression

getExpression2

public SearchExpression getExpression2()
Returns the right hand side expression.
Specified by:
getExpression2 in interface SearchExpression

getData

public java.lang.String[] getData()
Description copied from interface: SearchExpression
Returns the data associated with the expression. This is only useful for the base case (StringExpression).
Specified by:
getData in interface SearchExpression

getOperator

public int getOperator()
Returns the operator for this boolean expression.
Specified by:
getOperator in interface SearchExpression

isCaseSensitive

public boolean isCaseSensitive()
Description copied from interface: SearchExpression
Returns true if the SearchExpression is case sensitive, and false otherwise.
Specified by:
isCaseSensitive in interface SearchExpression

setCaseSensitive

public void setCaseSensitive(boolean caseSensitive)

print

public void print()
Prints a SearchExpression recursively. [Used for debugging purpose only].
Specified by:
print in interface SearchExpression

buildExpressionTree

public static SearchExpression buildExpressionTree(java.lang.String buffer,
                                                   boolean caseSensitive)
                                            throws SearchException
Utility method to build a SearchExpression tree from list of words possibly containing paranthesis, ANDs, ORs, NOTs, "+"s and "-"s.
Throws:
SearchException

isBooleanOperator

public static int isBooleanOperator(java.lang.String word)

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Help
12c (12.1.2)

E48720-01


Copyright © 1998, 2013, Oracle. All Rights Reserved.