javax.mail.search
Class AndTerm

java.lang.Object
  extended by javax.mail.search.SearchTerm
      extended by javax.mail.search.AndTerm
All Implemented Interfaces:
java.io.Serializable

public final class AndTerm
extends SearchTerm

A logical AND of a number of search terms.

See Also:
Serialized Form

Field Summary
protected  SearchTerm[] terms
          The target terms.
 
Constructor Summary
AndTerm(SearchTerm[] t)
          Constructor with multiple terms.
AndTerm(SearchTerm t1, SearchTerm t2)
          Constructor with two terms.
 
Method Summary
 boolean equals(java.lang.Object other)
           
 SearchTerm[] getTerms()
          Returns the search terms.
 int hashCode()
           
 boolean match(Message message)
          Returns true only if all the terms match the specified message.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

terms

protected SearchTerm[] terms
The target terms.

Constructor Detail

AndTerm

public AndTerm(SearchTerm t1,
               SearchTerm t2)
Constructor with two terms.

Parameters:
t1 - the first term
t2 - the second term

AndTerm

public AndTerm(SearchTerm[] t)
Constructor with multiple terms.

Parameters:
t - the terms
Method Detail

getTerms

public SearchTerm[] getTerms()
Returns the search terms.


match

public boolean match(Message message)
Returns true only if all the terms match the specified message.

Specified by:
match in class SearchTerm

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object