org.eigenbase.lurql
Class LurqlFilter

java.lang.Object
  extended by org.eigenbase.lurql.LurqlQueryNode
      extended by org.eigenbase.lurql.LurqlFilter

public class LurqlFilter
extends LurqlQueryNode

LurqlFilter represents a filter condition in a LURQL query. Currently the only filters supported are of the form

or negations, e.g. NOT ATTRIBUTE = 'VALUE' TODO jvs 6-July-2006: refactor into LurqlExistsFilter, LurqlComparisonFilter

Version:
$Id: //open/dev/farrago/src/org/eigenbase/lurql/LurqlFilter.java#1 $
Author:
John V. Sichi

Field Summary
private  String attributeName
           
static LurqlFilter[] EMPTY_ARRAY
           
private  LurqlExists exists
           
private  boolean hasDynamicParams
           
private  boolean isNegated
           
private  boolean isPattern
           
private  Matcher matcher
           
static Object NULL_VALUE
          Sentinel object distinguishing NULL from any real value.
private  LurqlDynamicParam setParam
           
private  String sqlQuery
           
private  Set<Object> values
           
 
Constructor Summary
LurqlFilter(LurqlExists exists)
           
LurqlFilter(String attributeName, LurqlDynamicParam param)
           
LurqlFilter(String attributeName, Set<Object> values)
           
LurqlFilter(String attributeName, Set<Object> values, boolean isPattern)
           
LurqlFilter(String attributeName, String sqlQuery)
           
 
Method Summary
 String getAttributeName()
           
 LurqlExists getExists()
           
 LurqlDynamicParam getSetParam()
           
 String getSqlQuery()
           
 Set getValues()
           
 boolean hasDynamicParams()
           
 boolean isMofId()
           
 boolean isNegated()
           
 boolean isPattern()
           
 boolean patternMatch(String patternString, String value)
           
 void setNegated()
           
 void unparse(PrintWriter pw)
          Converts this node to text.
private  void unparseValue(PrintWriter pw, Object value)
           
 
Methods inherited from class org.eigenbase.lurql.LurqlQueryNode
toString, unparseFilterList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_ARRAY

public static final LurqlFilter[] EMPTY_ARRAY

NULL_VALUE

public static final Object NULL_VALUE
Sentinel object distinguishing NULL from any real value.


attributeName

private final String attributeName

values

private final Set<Object> values

sqlQuery

private final String sqlQuery

setParam

private final LurqlDynamicParam setParam

exists

private final LurqlExists exists

isPattern

private final boolean isPattern

hasDynamicParams

private boolean hasDynamicParams

isNegated

private boolean isNegated

matcher

private Matcher matcher
Constructor Detail

LurqlFilter

public LurqlFilter(String attributeName,
                   Set<Object> values)

LurqlFilter

public LurqlFilter(String attributeName,
                   Set<Object> values,
                   boolean isPattern)

LurqlFilter

public LurqlFilter(String attributeName,
                   String sqlQuery)

LurqlFilter

public LurqlFilter(String attributeName,
                   LurqlDynamicParam param)

LurqlFilter

public LurqlFilter(LurqlExists exists)
Method Detail

getExists

public LurqlExists getExists()

getAttributeName

public String getAttributeName()

getSqlQuery

public String getSqlQuery()

getValues

public Set getValues()

isMofId

public boolean isMofId()

isPattern

public boolean isPattern()

patternMatch

public boolean patternMatch(String patternString,
                            String value)

hasDynamicParams

public boolean hasDynamicParams()

isNegated

public boolean isNegated()

getSetParam

public LurqlDynamicParam getSetParam()

setNegated

public void setNegated()

unparse

public void unparse(PrintWriter pw)
Description copied from class: LurqlQueryNode
Converts this node to text.

Specified by:
unparse in class LurqlQueryNode
Parameters:
pw - the PrintWriter on which to unparse; must have an underlying StackWriter to interpret indentation

unparseValue

private void unparseValue(PrintWriter pw,
                          Object value)