Example usage for javax.mail.search ComparisonTerm LE

List of usage examples for javax.mail.search ComparisonTerm LE

Introduction

In this page you can find the example usage for javax.mail.search ComparisonTerm LE.

Prototype

int LE

To view the source code for javax.mail.search ComparisonTerm LE.

Click Source Link

Usage

From source file:org.exist.xquery.modules.mail.MessageListFunctions.java

private int parseComparisonAttribute(Node terms) throws XPathException {
    int cp = ComparisonTerm.EQ;

    String comp = ((Element) terms).getAttribute("comparison");

    if (comp != null && comp.length() > 0) {
        if (comp.equalsIgnoreCase("eq")) {
            cp = ComparisonTerm.EQ;/*w w  w  .  java2  s . c  o  m*/
        } else if (comp.equalsIgnoreCase("ge")) {
            cp = ComparisonTerm.GE;
        } else if (comp.equalsIgnoreCase("gt")) {
            cp = ComparisonTerm.GT;
        } else if (comp.equalsIgnoreCase("le")) {
            cp = ComparisonTerm.LE;
        } else if (comp.equalsIgnoreCase("lt")) {
            cp = ComparisonTerm.LT;
        } else if (comp.equalsIgnoreCase("ne")) {
            cp = ComparisonTerm.NE;
        } else {
            throw (new XPathException(this, "Invalid comparison: " + comp + ", for term with type: "
                    + ((Element) terms).getAttribute("type")));
        }
    } else {
        throw (new XPathException(this, "comparison attribute must be specified for term with type: "
                + ((Element) terms).getAttribute("type")));
    }

    return (cp);
}