Example usage for javax.mail.search ComparisonTerm NE

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

Introduction

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

Prototype

int NE

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

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;/*from w  w w .j a  v  a  2  s.  c om*/
        } 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);
}