|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.devexperts.qd.kit.PatternFilter
public final class PatternFilter
SubscriptionFilter
that understands a simple GLOB-like grammar
to specify matching symbols.
This filter always accepts wildcard
symbol regardless
of an actual pattern.
Method Summary | |
---|---|
boolean |
acceptRecord(DataRecord record,
int cipher,
java.lang.String symbol)
Determines if specified record shall be processed by corresponding subsystem. |
static SubscriptionFilterFactory |
getFactory(DataScheme scheme)
|
static PatternFilter |
getInstance(java.lang.String pattern)
Deprecated. Use PatternFilter.valueOf(pattern, scheme) |
static SubscriptionFilter |
getInstance(java.lang.String pattern,
SubscriptionFilter chained_filter)
Deprecated. Use CompositeFilters.makeAnd(PatternFilter.valueOf(pattern, scheme), chained_filter) |
static java.lang.String |
quote(java.lang.String string)
Quotes all reserved characters in the given string, so that it can be used as a pattern filter. |
StableSubscriptionFilter |
toStableFilter()
Returns a stable filter that is the same or more encompassing as this filter. |
java.lang.String |
toString()
Returns filter description -- its pattern. |
static SubscriptionFilter |
valueOf(java.lang.String pattern,
DataScheme scheme)
Returns filter with a specified pattern. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static SubscriptionFilterFactory getFactory(DataScheme scheme)
public static java.lang.String quote(java.lang.String string) throws FilterSyntaxException
quote("Trade&N")
will be equal to "Trade[&]N"
. Special
characters that are quoted with braces are:
'!', ':', ';', '|', '&', '*', '?', '+',
'(', ')', '{', '}', '<', '>',
'\', '~', ',', '"', ''', and '`'.
If the input string starts with a lower-case characters (from 'a' to 'z') it is also quoted with braces,
because patterns starting with a lower case letter are reserved. For example,
quote("feed")
is equal to "[f]eed"
.
java.lang.NullPointerException
- if the string is null
.
FilterSyntaxException
- if the string contains characters that cannot be represented in
pattern filter in any form.
All characters with codes larger than 32 and lower than 128 are supported with the exception of '[' and ']'.public static SubscriptionFilter valueOf(java.lang.String pattern, DataScheme scheme) throws FilterSyntaxException
null
if pattern
is empty or matches everything.
java.lang.NullPointerException
- if pattern is null.
FilterSyntaxException
- if pattern is invalid.public static PatternFilter getInstance(java.lang.String pattern) throws FilterSyntaxException
PatternFilter.valueOf(pattern, scheme)
null
if pattern
is empty or matches everything.
java.lang.NullPointerException
- if pattern is null.
FilterSyntaxException
- if pattern is invalid.public static SubscriptionFilter getInstance(java.lang.String pattern, SubscriptionFilter chained_filter) throws FilterSyntaxException
CompositeFilters.makeAnd(PatternFilter.valueOf(pattern, scheme), chained_filter)
null
if resulting filter
matches everything.
java.lang.NullPointerException
- if pattern is null.
FilterSyntaxException
- if pattern is invalid.public StableSubscriptionFilter toStableFilter()
StableSubscriptionFilter
null
, which means that this filter is not stable
and the only stable extension of it consitutes all symbols. Stable filters
must return this
as a result of this method. The result of this method
satisfies the following constrains:
result
is null or result.toStableFilter() == result
result
is null or this.acceptRecord(...)
implies result.acceptRecord(...)
.
result
is null or
result.toString()
must parse back to the same filter via data scheme's
SubscriptionFilterFactory
.
toStableFilter
in interface StableSubscriptionFilter
public java.lang.String toString()
toString
in class java.lang.Object
public boolean acceptRecord(DataRecord record, int cipher, java.lang.String symbol)
SubscriptionFilter
acceptRecord
in interface SubscriptionFilter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |