/** 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.20 of Oct 1999 */ public class Condition { /*+--------------+ *| Fields | *+--------------+ */ /* Each "Condition" has three parts. */ // 1. A "header", such as "Name", "Date", or "MessageID". protected String header; // 2. An "operator", such as "<", "!=", or ">=". // XXX perhaps a class should be made for operator? protected String operator; // 3. A "target", such as "Joe", "9/9/99", or "[zangband]*" // XXX target needs to be able to accept wildcards..perhaps another class? protected String target; /*+--------------+ *| Constructors | *+--------------+ */ /** Null constructor */ public Condition() { } /** Full constructor */ public Condition(String head, String operate, String targ) { } /*+-----------+ *| Methods | *+-----------+ */ /** Extract the header */ public String getHeader() { return this.header; // SAMR } /** Extract the operator */ public String getOperator() { return this.operator; // SAMR } /** Extract the target */ public String getTarget() { return this.target; // SAMR } /** Set the header */ public String setHeader(String head) { String oldhead = this.header; // SAMR this.header = head; // SAMR return oldhead; // SAMR } /** Set the operator */ public String setOperator(String operat) { String oldop = this.operator; // SAMR this.operator = operat; // SAMR return oldop; // SAMR } /** Set the target */ public String setTarget(String targ) { String bullseye = this.target; // SAMR this.target = targ; // SAMR return bullseye; // SAMR } /** Determine the truth-value of a "condition". */ public boolean isRuleTrue() { return true; } } // class Condition