javax.mail.search

Class StringTerm

public abstract class StringTerm extends SearchTerm

A Term that provides matching criteria for Strings.
Field Summary
protected booleanignoreCase
If true, case should be ignored during matching.
protected Stringpattern
The pattern associated with this term.
Constructor Summary
protected StringTerm(String pattern)
Constructor specifying a pattern.
protected StringTerm(String pattern, boolean ignoreCase)
Constructor specifying pattern and case sensitivity.
Method Summary
booleanequals(Object other)
booleangetIgnoreCase()
Indicate if case should be ignored when matching.
StringgetPattern()
Return the pattern associated with this term.
inthashCode()
protected booleanmatch(String match)
Determine if the pattern associated with this term is a substring of the supplied String.

Field Detail

ignoreCase

protected boolean ignoreCase
If true, case should be ignored during matching.

pattern

protected String pattern
The pattern associated with this term.

Constructor Detail

StringTerm

protected StringTerm(String pattern)
Constructor specifying a pattern. Defaults to case insensitive matching.

Parameters: pattern the pattern for this term

StringTerm

protected StringTerm(String pattern, boolean ignoreCase)
Constructor specifying pattern and case sensitivity.

Parameters: pattern the pattern for this term ignoreCase if true, case should be ignored during matching

Method Detail

equals

public boolean equals(Object other)

getIgnoreCase

public boolean getIgnoreCase()
Indicate if case should be ignored when matching.

Returns: if true, case should be ignored during matching

getPattern

public String getPattern()
Return the pattern associated with this term.

Returns: the pattern associated with this term

hashCode

public int hashCode()

match

protected boolean match(String match)
Determine if the pattern associated with this term is a substring of the supplied String. If ignoreCase is true then case will be ignored.

Parameters: match the String to compare to

Returns: true if this patter is a substring of the supplied String