javax.mail.search

Class AndTerm

Implemented Interfaces:
Serializable

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

boolean
equals(Object other)
SearchTerm[]
getTerms()
Return the terms.
int
hashCode()
boolean
match(Message message)
Match by applying the terms, in order, to the Message and performing an AND operation to the result.

Methods inherited from class javax.mail.search.SearchTerm

match

Field Details

terms

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

Constructor Details

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 Details

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.
Overrides:
match in interface SearchTerm
Parameters:
message - the Message to apply the terms to
Returns:
true if all terms match