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

java.lang.Object
  extended bySK.gnome.dwarf.mail.store.search.SearchKey
      extended bySK.gnome.dwarf.mail.store.search.SizeKey

public class SizeKey
extends SearchKey

This key matches the given size and the actual message size.


Field Summary
static int LARGER
          This key type specifies that the values larger than the given size will be matched.
protected  long size
          The matched size.
static int SMALLER
          This key type specifies that the values smaller than the given size will be matched.
 
Fields inherited from class SK.gnome.dwarf.mail.store.search.SearchKey
type
 
Constructor Summary
SizeKey(int type, long size)
          Creates a new SizeKey.
 
Method Summary
 long getSize()
          Returns the matches size.
 boolean match(MailMessage message)
          Matches the given size and the actual message size.
 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

SMALLER

public static final int SMALLER
This key type specifies that the values smaller than the given size will be matched.

See Also:
Constant Field Values

LARGER

public static final int LARGER
This key type specifies that the values larger than the given size will be matched.

See Also:
Constant Field Values

size

protected long size
The matched size.

Constructor Detail

SizeKey

public SizeKey(int type,
               long size)
Creates a new SizeKey.

Parameters:
type - the key type
size - the mathed size
Method Detail

getSize

public long getSize()
Returns the matches size.

Returns:
the matched size

match

public boolean match(MailMessage message)
              throws MailException
Matches the given size and the actual message size.

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.