|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.qtunes.core.util.AbstractMatcher<E>
public abstract class AbstractMatcher<E>
A Utility class that can be used to determine if an Object matches a specified filter. The filter is made up of multiple tests, each one taking one of the following forms
| key = value | The specified field equals the value, eg "type = 'mp3'" |
|---|---|
| key != value | The specified field doesn't equal the value, eg "type != 'mp3'" |
| key < value | The specified field is less than the value, eg "year < 2000" |
| key > value | The specified field is greater than the value, eg "year > 2000" |
| key <= value | The specified field is less than or equal to the value, eg "year <= 2000" |
| key >= value | The specified field is greater than or equal to the value, eg "year >= 2000" |
| key =~ value | The specified field matches the value regex, eg "title =~ '.*King.*'" |
| key !~ value | The specified field doesn't match the value regex, eg "album !~ '^The'" |
getProperty(E, java.lang.String) method, which returns the named property from the
object being tested.
| Constructor Summary | |
|---|---|
AbstractMatcher(java.lang.String filter)
Create a new AbstractMatcher |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
|
java.lang.String |
getFilter()
Return the Filter String for this Matcher |
abstract java.lang.Object |
getProperty(E source,
java.lang.String property)
Return the specified Property from the source object being tested |
int |
hashCode()
|
boolean |
isUniversal()
Return true if the Filter will match anything |
boolean |
matches(E source)
Return true if this AbstractMatcher matches the specified object |
boolean |
test(java.lang.String key,
java.lang.String op,
java.lang.String testval,
java.lang.Object propval)
Compare two values |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractMatcher(java.lang.String filter)
filter - the filter String| Method Detail |
|---|
public abstract java.lang.Object getProperty(E source,
java.lang.String property)
public boolean matches(E source)
public boolean test(java.lang.String key,
java.lang.String op,
java.lang.String testval,
java.lang.Object propval)
key - the key the values are stored underop - the operation, one of "=", "!=", "<", ">", "<=", ">=", "=~" or "!~"testval - the value specified in the testpropval - the property value that we're testing, as returned from getProperty(E, java.lang.String)public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic final java.lang.String getFilter()
public boolean isUniversal()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||