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

java.lang.Object
  extended bySK.gnome.dwarf.mail.store.search.SequenceSet

public class SequenceSet
extends java.lang.Object

This class represents a set of message number sequences.

The message number sequence is:

Examples of valid sequences:

Note that the sequences may use message UIDs instead of the message numbers. This can be set via the corresponding object constructor argument.


Constructor Summary
protected SequenceSet(MailFolder folder, boolean uid)
          Creates a new empty SequenceSet.
  SequenceSet(MailFolder folder, boolean uid, java.lang.String set)
          Creates a new SequenceSet with the given sequence set.
 
Method Summary
protected  void init(java.lang.String set)
          Initializes the sequence set with the given initial values.
 boolean match(MailMessage message)
          Matches the given sequence set and the message UID or number.
 java.lang.String toString()
          Returns a string representation of this sequence set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SequenceSet

public SequenceSet(MailFolder folder,
                   boolean uid,
                   java.lang.String set)
            throws MailException
Creates a new SequenceSet with the given sequence set.

This method calls init(String) with the value of given set argument.

Parameters:
folder - the mail folder
uid - whether this is a sequence of message UIDs instead of message numbers
set - the string representation of the sequence set
Throws:
MailException - if an error occured

SequenceSet

protected SequenceSet(MailFolder folder,
                      boolean uid)
               throws MailException
Creates a new empty SequenceSet.

The set must be initialized by calling the init(String) method prior to using its message matching method.

Parameters:
folder - the mail folder
uid - whether this is a sequence of message UIDs instead of message numbers
Throws:
MailException - if an error occured
Method Detail

match

public boolean match(MailMessage message)
Matches the given sequence set and the message UID or number.

Parameters:
message - the searched message
Returns:
true if the message UID or number is within this sequence set

toString

public java.lang.String toString()
Returns a string representation of this sequence set.


init

protected void init(java.lang.String set)
             throws MailException
Initializes the sequence set with the given initial values.

The set argument must contain a comma-separated list of one or more sequences.

Parameters:
set - the string representation of the sequence set
Throws:
MailException - if an error occured


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