|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SK.gnome.dwarf.mail.store.search.SearchKey
Provides a generic search key.
A search key may have its type specified via the SearchKey(int)
constructor.
The abstract match(MailMessage)
method must be implemented by the derived classes.
This method matches the given message according to any internal criteria defined for the
particular search key.
If a search key encounters a malformed message, it should not throw an exception since it
would probably interrupt the whole searching process, which might not be always desirable. Instead,
the exception may be added to the internal list of errors via the addError(Exception)
method. When the whole searching process finishes, all processing errors may be then accessed
via the hasError()
, getErrors()
and clearErrors()
methods.
Field Summary | |
protected int |
type
The key type. |
Constructor Summary | |
protected |
SearchKey()
Creates a new SearchKey. |
protected |
SearchKey(int type)
Creates a new SearchKey with the given type. |
Method Summary | |
void |
addError(java.lang.Exception e)
Adds the searching error to the list. |
void |
clearErrors()
Clears the list of searching errors. |
java.util.Iterator |
getErrors()
Returns the errors occured during the search process. |
int |
getType()
Returns the key type. |
boolean |
hasError()
Whether an error occured during the search process. |
abstract boolean |
match(MailMessage message)
Matches the given message. |
java.lang.String |
toString()
Returns the string represenation of the key. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int type
getType()
Constructor Detail |
protected SearchKey()
protected SearchKey(int type)
type
- the key typetype
Method Detail |
public int getType()
type
public boolean hasError()
public void addError(java.lang.Exception e)
e
- the exception occured while matching a messagepublic java.util.Iterator getErrors()
public void clearErrors()
public abstract boolean match(MailMessage message) throws MailException
message
- the searched message
MailException
- if an error occurspublic java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |