SK.gnome.dwarf.mail.store.search
Class SearchKeyList

java.lang.Object
  extended bySK.gnome.dwarf.mail.store.search.SearchKey
      extended bySK.gnome.dwarf.mail.store.search.SearchKeyList
Direct Known Subclasses:
AndKey, OrKey

public class SearchKeyList
extends SearchKey

This key groups other keys together.


Field Summary
static int AND
          This key type specifies that the grouped keys will be logically AND-ed.
protected  java.util.List keys
          The list of grouped keys.
static int OR
          This key type specifies that the grouped keys will be logically OR-ed.
 
Fields inherited from class SK.gnome.dwarf.mail.store.search.SearchKey
type
 
Constructor Summary
SearchKeyList(int type)
          Creates a new SearchKeyList.
 
Method Summary
 void addKey(SearchKey key)
          Adds a key to the group.
 java.util.Iterator getKeys()
          Returns the grouped keys.
 boolean match(MailMessage message)
          Matches the grouped keys and the message.
 java.lang.String toString()
          Returns the string represenation of the key.
 
Methods inherited from class SK.gnome.dwarf.mail.store.search.SearchKey
addError, clearErrors, getErrors, getType, hasError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AND

public static final int AND
This key type specifies that the grouped keys will be logically AND-ed.

See Also:
Constant Field Values

OR

public static final int OR
This key type specifies that the grouped keys will be logically OR-ed.

See Also:
Constant Field Values

keys

protected java.util.List keys
The list of grouped keys.

Constructor Detail

SearchKeyList

public SearchKeyList(int type)
Creates a new SearchKeyList.

Parameters:
type - the key type
Method Detail

addKey

public void addKey(SearchKey key)
Adds a key to the group.

Parameters:
key - the key to add

getKeys

public java.util.Iterator getKeys()
Returns the grouped keys.

Returns:
the keys

match

public boolean match(MailMessage message)
              throws MailException
Matches the grouped keys and the message.

Specified by:
match in class SearchKey
Parameters:
message - the searched message
Returns:
true if the given key criteria and message matches, false otherwise
Throws:
MailException - if an error occurs

toString

public java.lang.String toString()
Description copied from class: SearchKey
Returns the string represenation of the key.

Overrides:
toString in class SearchKey
Returns:
the key string


Copyright (c) 2004-2005, Gnome Ltd. All rights reserved.