javax.mail.search

Class AndTerm

public final class AndTerm extends SearchTerm

Term that implements a logical AND across terms.
Field Summary
protected SearchTerm[]terms
Terms to which the AND operator should be applied.
Constructor Summary
AndTerm(SearchTerm a, SearchTerm b)
Constructor for performing a binary AND.
AndTerm(SearchTerm[] terms)
Constructor for performing and AND across an arbitraty number of terms.
Method Summary
booleanequals(Object other)
SearchTerm[]getTerms()
Return the terms.
inthashCode()
booleanmatch(Message message)
Match by applying the terms, in order, to the Message and performing an AND operation to the result.

Field Detail

terms

protected SearchTerm[] terms
Terms to which the AND operator should be applied.

Constructor Detail

AndTerm

public AndTerm(SearchTerm a, SearchTerm b)
Constructor for performing a binary AND.

Parameters: a the first term b the second ter,

AndTerm

public AndTerm(SearchTerm[] terms)
Constructor for performing and AND across an arbitraty number of terms.

Parameters: terms the terms to AND together

Method Detail

equals

public boolean equals(Object other)

getTerms

public SearchTerm[] getTerms()
Return the terms.

Returns: the terms

hashCode

public int hashCode()

match

public boolean match(Message message)
Match by applying the terms, in order, to the Message and performing an AND operation to the result. Comparision will stop immediately if one of the terms returns false.

Parameters: message the Message to apply the terms to

Returns: true if all terms match