javax.mail.search
Class AndTerm

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

public final class AndTerm
extends SearchTerm

Term that implements a logical AND across terms.

Version:
$Rev: 467553 $ $Date: 2006-10-25 00:01:51 -0400 (Wed, 25 Oct 2006) $
See Also:
Serialized Form

Field Summary
protected  SearchTerm[] terms
          Terms to which the AND operator should be applied.
 
Constructor Summary
AndTerm(SearchTerm[] terms)
          Constructor for performing and AND across an arbitraty number of terms.
AndTerm(SearchTerm a, SearchTerm b)
          Constructor for performing a binary AND.
 
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 java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

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

getTerms

public SearchTerm[] getTerms()
Return the terms.

Returns:
the terms

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.

Specified by:
match in class SearchTerm
Parameters:
message - the Message to apply the terms to
Returns:
true if all terms match

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2003-2009 The Apache Software Foundation. All Rights Reserved.