Package org.hpccsystems.commons.ecl
Class FieldFilterRange
- java.lang.Object
-
- org.hpccsystems.commons.ecl.FieldFilterRange
-
- All Implemented Interfaces:
Serializable
public class FieldFilterRange extends Object implements Serializable
A filter value range. Used to construct a range (open or closed on either end) of values for filtering records. The value range can be a single value for an equality filter.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFieldFilterRange.BoundThe Lower, Upper, Both, Unbounded are the possibilities for bounding the range.
-
Field Summary
Fields Modifier and Type Field Description static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description FieldFilterRange(Object[] valueList, boolean donotquote)Use for a set of discrete values.FieldFilterRange(String low, String high, boolean leftRangeOpen, boolean rightRangeOpen, boolean donotquote)Use for bounded range.FieldFilterRange(String v, FieldFilterRange.Bound rangeBound, boolean leftRangeOpen, boolean rightRangeOpen, boolean donotquote)Use for single value ranges.FieldFilterRange(String v, FieldFilterRange.Bound rangeBound, boolean leftRangeOpen, boolean rightRangeOpen, boolean donotquote, short prefixMatchLength)Use for single value ranges.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringfilterExpression()The filter test range in appropriate syntax for the remote read engine.FieldFilterRange.BoundgetBound()booleangetLeftOpen()booleangetRightOpen()String[]getValues()static FieldFilterRangemakeEq(Object v)Create equality filter range.static FieldFilterRangemakeGE(Object v)Create greater or equal filter range.static FieldFilterRangemakeGT(Object v)Create greater than filter range.static FieldFilterRangemakeIn(Object[] vs)Create IN filter range If all entries are numeric, numeric based compare created.static FieldFilterRangemakeIn(Object[] vs, boolean stringecapsulate)Create IN filter range Encapsulate entries as string values based on stringecapsulate.static FieldFilterRangemakeLE(Object v)Create less or equal filter range.static FieldFilterRangemakeLT(Object v)Create less than filter range.static FieldFilterRangemakeNE(Object v)Create inequality filter range.static FieldFilterRangemakeStartsWith(Object v, short len)Create startswith filter range.StringtoString()
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FieldFilterRange
public FieldFilterRange(String v, FieldFilterRange.Bound rangeBound, boolean leftRangeOpen, boolean rightRangeOpen, boolean donotquote, short prefixMatchLength)
Use for single value ranges.- Parameters:
v- the valuerangeBound- the range boundleftRangeOpen- the left range openrightRangeOpen- the right range opendonotquote- entry should not be quotedprefixMatchLength- the prefix match length
-
FieldFilterRange
public FieldFilterRange(String v, FieldFilterRange.Bound rangeBound, boolean leftRangeOpen, boolean rightRangeOpen, boolean donotquote)
Use for single value ranges.- Parameters:
v- the valuerangeBound- the range boundleftRangeOpen- the left range openrightRangeOpen- the right range opendonotquote- entry should not be quoted
-
FieldFilterRange
public FieldFilterRange(String low, String high, boolean leftRangeOpen, boolean rightRangeOpen, boolean donotquote)
Use for bounded range.- Parameters:
low- the lowhigh- the highleftRangeOpen- the left range openrightRangeOpen- the right range opendonotquote- entry should not be quoted
-
FieldFilterRange
public FieldFilterRange(Object[] valueList, boolean donotquote)
Use for a set of discrete values.- Parameters:
valueList- the value listdonotquote- entry should not be quoted
-
-
Method Detail
-
getValues
public String[] getValues()
-
getBound
public FieldFilterRange.Bound getBound()
-
getLeftOpen
public boolean getLeftOpen()
-
getRightOpen
public boolean getRightOpen()
-
makeEq
public static FieldFilterRange makeEq(Object v)
Create equality filter range.- Parameters:
v- the test value- Returns:
- the test range
-
makeNE
public static FieldFilterRange makeNE(Object v)
Create inequality filter range.- Parameters:
v- the test value- Returns:
- the test range
-
makeLT
public static FieldFilterRange makeLT(Object v)
Create less than filter range.- Parameters:
v- the test value- Returns:
- the test range
-
makeLE
public static FieldFilterRange makeLE(Object v)
Create less or equal filter range.- Parameters:
v- the test value- Returns:
- the test range
-
makeGT
public static FieldFilterRange makeGT(Object v)
Create greater than filter range.- Parameters:
v- the test value- Returns:
- the test range
-
makeGE
public static FieldFilterRange makeGE(Object v)
Create greater or equal filter range.- Parameters:
v- the test value- Returns:
- the test range
-
makeIn
public static FieldFilterRange makeIn(Object[] vs)
Create IN filter range If all entries are numeric, numeric based compare created. Otherwise, string-wise compare- Parameters:
vs- set of values- Returns:
- the filter range
-
makeIn
public static FieldFilterRange makeIn(Object[] vs, boolean stringecapsulate)
Create IN filter range Encapsulate entries as string values based on stringecapsulate.- Parameters:
vs- set of valuesstringecapsulate- the stringecapsulate- Returns:
- the filter range
-
makeStartsWith
public static FieldFilterRange makeStartsWith(Object v, short len) throws Exception
Create startswith filter range.- Parameters:
v- the subsetlen- the length to compare- Returns:
- the filter range
- Throws:
Exception- the exception
-
filterExpression
public String filterExpression()
The filter test range in appropriate syntax for the remote read engine.- Returns:
- the filter string
-
-