javax.mail.search
Class HeaderTerm

java.lang.Object
  extended byjavax.mail.search.SearchTerm
      extended byjavax.mail.search.StringTerm
          extended byjavax.mail.search.HeaderTerm
All Implemented Interfaces:
java.io.Serializable

public final class HeaderTerm
extends StringTerm

A case-insensitive string comparison of message header values.

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

Field Summary
protected  java.lang.String headerName
          The header name.
 
Fields inherited from class javax.mail.search.StringTerm
ignoreCase, pattern
 
Constructor Summary
HeaderTerm(java.lang.String headerName, java.lang.String pattern)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object other)
           
 java.lang.String getHeaderName()
          Returns the name of the header to compare with.
 int hashCode()
           
 boolean match(Message msg)
          Returns true if the header in the specified message matches the pattern specified in this term.
 
Methods inherited from class javax.mail.search.StringTerm
getIgnoreCase, getPattern, match
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

headerName

protected java.lang.String headerName
The header name.

Constructor Detail

HeaderTerm

public HeaderTerm(java.lang.String headerName,
                  java.lang.String pattern)
Constructor.

Parameters:
headerName - the header name
pattern - the pattern to search for
Method Detail

getHeaderName

public java.lang.String getHeaderName()
Returns the name of the header to compare with.


match

public boolean match(Message msg)
Returns true if the header in the specified message matches the pattern specified in this term.

Specified by:
match in class SearchTerm

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class StringTerm


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