javax.mail.search

Class HeaderTerm

Implemented Interfaces:
Serializable

public final class HeaderTerm
extends StringTerm

This class implements comparisons for Message headers. The comparison is case-insensitive.
Version:
1.3
Author:
Chris Burdess

Field Summary

protected String
headerName
The name of the header.

Fields inherited from class javax.mail.search.StringTerm

ignoreCase, pattern

Constructor Summary

HeaderTerm(String headerName, String pattern)
Constructor.

Method Summary

boolean
equals(Object other)
Equality comparison.
String
getHeaderName()
Return the name of the header to compare with.
int
hashCode()
Compute a hashCode for this object.
boolean
match(Message msg)
The header match method.

Methods inherited from class javax.mail.search.StringTerm

equals, getIgnoreCase, getPattern, hashCode, match

Methods inherited from class javax.mail.search.SearchTerm

match

Field Details

headerName

protected String headerName
The name of the header.

Constructor Details

HeaderTerm

public HeaderTerm(String headerName,
                  String pattern)
Constructor.
Parameters:
headerName - The name of the header
pattern - The pattern to search for

Method Details

equals

public boolean equals(Object other)
Equality comparison.
Overrides:
equals in interface StringTerm

getHeaderName

public String getHeaderName()
Return the name of the header to compare with.

hashCode

public int hashCode()
Compute a hashCode for this object.
Overrides:
hashCode in interface StringTerm

match

public boolean match(Message msg)
The header match method.
Overrides:
match in interface SearchTerm
Parameters:
msg - The match is applied to this Message's header
Returns:
true if the match succeeds, otherwise false

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