|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcorny.addressbook.searching.Filter.Filter
corny.addressbook.searching.Filter.ContactFilter
public class ContactFilter
Filter class for filtering Contacts.
The enumeration ContactProperty
declares all the Contact properties
which can be searched in. A possible property can for example be the first
name or the phone number.
There are multiple constants which declare the way in which the properties
are compared. For example, you could check if a property contains a specified
String (CONTAINS_SUBSTRING
) or if a property is greater
than a given Number (GREATER
).
The value which the property is compared against can be either a String value or another class, like a Date or a Group. The ContactProperty documentation declares the possible classes which the property can be compared against.
Field Summary | |
---|---|
static int |
CONTAINS_SUBSTRING
The property should contain a given substring. |
static int |
CONTAINS_SUBSTRING_CASE_SENSITIVE
|
static int |
ENDS_WITH
The property should end with a given String. |
static int |
ENDS_WITH_CASE_SENSITIVE
|
static int |
EQUAL
The property should equal to a given value. |
static int |
EQUAL_CASE_SENSITIVE
|
static int |
GREATER
The property should be greater than a given value. |
static int |
GREATER_OR_EQUAL
The property should be greater or equal than a given value. |
static int |
IN_GROUP
The Contact should be contained in a given Group. |
static int |
IN_GROUP_CASE_SENSITIVE
|
static int |
LESS
The property should be less than a given value. |
static int |
LESS_OR_EQUAL
The property should be less or equal than a given value. |
static int |
LIKE
The property should match a given regular expression. |
static int |
NOT_CONTAINS_SUBSTRING
|
static int |
NOT_CONTAINS_SUBSTRING_CASE_SENSITIVE
|
static int |
NOT_ENDS_WITH
|
static int |
NOT_ENDS_WITH_CASE_SENSITIVE
|
static int |
NOT_EQUAL
|
static int |
NOT_EQUAL_CASE_SENSITIVE
|
static int |
NOT_IN_GROUP
|
static int |
NOT_IN_GROUP_CASE_SENSITIVE
|
static int |
NOT_LIKE
|
static int |
NOT_PART_OF_STRING
|
static int |
NOT_PART_OF_STRING_CASE_SENSITIVE
|
static int |
NOT_STARTS_WITH
|
static int |
NOT_STARTS_WITH_CASE_SENSITIVE
|
static int |
PART_OF_STRING
The property should be part of a given String. |
static int |
PART_OF_STRING_CASE_SENSITIVE
|
static int |
STARTS_WITH
The property should start with a given String. |
static int |
STARTS_WITH_CASE_SENSITIVE
|
Constructor Summary | |
---|---|
ContactFilter(ContactProperty property,
int comparison,
java.lang.Object value)
Creates new ContactFilter which compares the selected property by the selected comparison to the given value. |
|
ContactFilter(ContactProperty property,
java.lang.String propertyLabel,
int comparison,
java.lang.Object value)
Creates new ContactFilter which compares the selected property by the selected comparison to the given value. |
Method Summary | |
---|---|
boolean |
appliesToFilter(Contact c)
Used by NativeAddressBook to determine whether the Contact matches the search query |
static java.lang.String |
getDefaultRegex(int comparison)
Returns the default regular expression for a given comparison. |
java.lang.String |
toString()
|
Methods inherited from class corny.addressbook.searching.Filter.Filter |
---|
createFilter |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int EQUAL
public static final int EQUAL_CASE_SENSITIVE
EQUAL
,
Constant Field Valuespublic static final int NOT_EQUAL
EQUAL
,
Constant Field Valuespublic static final int NOT_EQUAL_CASE_SENSITIVE
EQUAL
,
Constant Field Valuespublic static final int GREATER
public static final int GREATER_OR_EQUAL
public static final int LESS
public static final int LESS_OR_EQUAL
public static final int CONTAINS_SUBSTRING
public static final int CONTAINS_SUBSTRING_CASE_SENSITIVE
CONTAINS_SUBSTRING
,
Constant Field Valuespublic static final int NOT_CONTAINS_SUBSTRING
CONTAINS_SUBSTRING
,
Constant Field Valuespublic static final int NOT_CONTAINS_SUBSTRING_CASE_SENSITIVE
CONTAINS_SUBSTRING
,
Constant Field Valuespublic static final int ENDS_WITH
public static final int ENDS_WITH_CASE_SENSITIVE
ENDS_WITH
,
Constant Field Valuespublic static final int NOT_ENDS_WITH
ENDS_WITH
,
Constant Field Valuespublic static final int NOT_ENDS_WITH_CASE_SENSITIVE
ENDS_WITH
,
Constant Field Valuespublic static final int STARTS_WITH
public static final int STARTS_WITH_CASE_SENSITIVE
STARTS_WITH
,
Constant Field Valuespublic static final int NOT_STARTS_WITH
STARTS_WITH
,
Constant Field Valuespublic static final int NOT_STARTS_WITH_CASE_SENSITIVE
STARTS_WITH
,
Constant Field Valuespublic static final int PART_OF_STRING
public static final int PART_OF_STRING_CASE_SENSITIVE
PART_OF_STRING
,
Constant Field Valuespublic static final int NOT_PART_OF_STRING
PART_OF_STRING
,
Constant Field Valuespublic static final int NOT_PART_OF_STRING_CASE_SENSITIVE
PART_OF_STRING
,
Constant Field Valuespublic static final int IN_GROUP
public static final int NOT_IN_GROUP
IN_GROUP
,
Constant Field Valuespublic static final int IN_GROUP_CASE_SENSITIVE
IN_GROUP
,
Constant Field Valuespublic static final int NOT_IN_GROUP_CASE_SENSITIVE
IN_GROUP
,
Constant Field Valuespublic static final int LIKE
Pattern
for more details about regular
expressions.
Works with every kind of property but only with String values. If the
property isn't a String, the String representation will be used.
Comparison using LIKE is always case sensitive.
public static final int NOT_LIKE
LIKE
,
Constant Field ValuesConstructor Detail |
---|
public ContactFilter(ContactProperty property, java.lang.String propertyLabel, int comparison, java.lang.Object value)
property
- Property of the Contacts which should be comparedcomparison
- Comparison typepropertyLabel
- The label (key) of the property, if the property is a multi
value type (like the Phone Property)value
- The Contact property will be compared to this valuepublic ContactFilter(ContactProperty property, int comparison, java.lang.Object value)
property
- Property of the Contacts which should be comparedcomparison
- Comparison typevalue
- The Contact property will be compared to this valueMethod Detail |
---|
public static java.lang.String getDefaultRegex(int comparison)
comparison
- Comparison
public boolean appliesToFilter(Contact c)
Filter
appliesToFilter
in class Filter
c
- Contact to compare
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |