org.eigenbase.lurql
Class LurqlFilter
java.lang.Object
org.eigenbase.lurql.LurqlQueryNode
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
ATTRIBUTE = 'VALUE'
ATTRIBUTE = ?scalar-param
ATTRIBUTE MATCHES 'PATTERN'
ATTRIBUTE IN ('VALUE1', 'VALUE2', ...)
ATTRIBUTE IN ?set-param
ATTRIBUTE IN [SQL-QUERY]
EXISTS (path-spec)
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
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
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)
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)