javax.mail.search
Class RecipientTerm

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

public final class RecipientTerm
extends AddressTerm

A comparison of recipient headers in a message.

Version:
1.4
Author:
Chris Burdess
See Also:
Serialized Form

Field Summary
protected  Message.RecipientType type
          The recipient type.
 
Fields inherited from class javax.mail.search.AddressTerm
address
 
Constructor Summary
RecipientTerm(Message.RecipientType type, Address address)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object other)
           
 Message.RecipientType getRecipientType()
          Returns the recipient type.
 int hashCode()
           
 boolean match(Message msg)
          Returns true only if the recipient address in the given message matches the address specified in this term.
 
Methods inherited from class javax.mail.search.AddressTerm
getAddress, match
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

protected Message.RecipientType type
The recipient type.

Constructor Detail

RecipientTerm

public RecipientTerm(Message.RecipientType type,
                     Address address)
Constructor.

Parameters:
type - the recipient type
address - the address to match
Method Detail

getRecipientType

public Message.RecipientType getRecipientType()
Returns the recipient type.


match

public boolean match(Message msg)
Returns true only if the recipient address in the given message matches the address specified in this term.

Specified by:
match in class SearchTerm

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class AddressTerm


© Copyright 2003, 2004 The Free Software Foundation, All rights reserved