
/** Class condition
 *
 * Specifies a "condition", such as "name greater than 'Joe'" or "date not equal to 9/9/99".
 * Used in applying the mail filtering rules.
 *
 * @author Chris Kern
 * @author Erin Nichols
 * @author Joe Simonson
 * @version 0.22 of Oct 1999
 */

public interface Condition {

    /*+-----------+
     *|  Methods  |
     *+-----------+
     */

    /** Extract the header */
    public String getHeader();

    /** Extract the operator */
    public String getOperator(); 
    
    /** Extract the target */
    public String getTarget();
    
    /** Set the header */
    public void setHeader(String head);
    
    /** Set the operator */
    public void setOperator(String operat); 
    
    /** Set the target */
    public void setTarget(String targ);


    /** Purpose        - Determine the truth-value of a "condition" for a message.
     * Parameters      - the MailMessage to be looked at
     * Preconditions   - message must be a valid MailMessage
     * Postconditions  - Nothing is changed.
     * Produces        - True or false
     * Problems        - none
     */
    public boolean isRuleTrue(MailMessage message);

    /** Purpose       - Applies this rule to a list of messages 
     * Parameters     - The list of messages the rule should be applied to
     * Preconditions  - listOfMessages is a valid MessageInfoList
     * Postconditions - The list is sorted per the rule
     * Produces       - nothing
     * Problems       - none 
     */
    public void sortList(MessageInfoListStub listOfMessages);


    /** Purpose       - Returns a new message list created by the rule application 
     * Parameters     - none
     * Preconditions  - none
     * Postconditions - A messageInfoList is created
     * Produces       - A list of messages sorted by the rule
     * Problems       - none
     */
    public MessageInfoListStub returnList();


} // class Condition

