javax.mail.search

Class StringTerm

Implemented Interfaces:
Serializable
Known Direct Subclasses:
AddressStringTerm, BodyTerm, HeaderTerm, MessageIDTerm, SubjectTerm

public abstract class StringTerm
extends SearchTerm

This class implements the match method for Strings. The current implementation provides only for substring matching. We could add comparisons(like strcmp ...).

Field Summary

protected boolean
ignoreCase
Ignore case when comparing?
protected String
pattern
The pattern.

Constructor Summary

StringTerm(String pattern)
StringTerm(String pattern, boolean ignoreCase)

Method Summary

boolean
equals(Object other)
Equality comparison.
boolean
getIgnoreCase()
Return true if we should ignore case when matching.
String
getPattern()
Return the string to match with.
int
hashCode()
Compute a hashCode for this object.
protected boolean
match(String s)

Methods inherited from class javax.mail.search.SearchTerm

match

Field Details

ignoreCase

protected boolean ignoreCase
Ignore case when comparing?


pattern

protected String pattern
The pattern.

Constructor Details

StringTerm

protected StringTerm(String pattern)


StringTerm

protected StringTerm(String pattern,
                     boolean ignoreCase)

Method Details

equals

public boolean equals(Object other)
Equality comparison.


getIgnoreCase

public boolean getIgnoreCase()
Return true if we should ignore case when matching.


getPattern

public String getPattern()
Return the string to match with.


hashCode

public int hashCode()
Compute a hashCode for this object.


match

protected boolean match(String s)