Top Description Fields Constructors Methods
jakarta.mail.search

public abstract Class StringTerm

extends SearchTerm
Class Inheritance
Known Direct Subclasses
jakarta.mail.search.SubjectTerm, jakarta.mail.search.AddressStringTerm, jakarta.mail.search.BodyTerm, jakarta.mail.search.HeaderTerm, jakarta.mail.search.MessageIDTerm

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

Field Summary

Modifier and TypeField and Description
protected boolean
ignoreCase

Ignore case when comparing?

protected String
pattern

The pattern.

private static final long

Constructor Summary

AccessConstructor and Description
protected
StringTerm(String
the pattern
pattern
)

Construct a StringTerm with the given pattern.

protected
StringTerm(String
the pattern
pattern
,
boolean
should we ignore case?
ignoreCase
)

Construct a StringTerm with the given pattern and ignoreCase flag.

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Equality comparison.
public boolean

Returns:

true if we should ignore case
getIgnoreCase
()

Return true if we should ignore case when matching.

public String

Returns:

the string to match
getPattern
()

Return the string to match with.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Compute a hashCode for this object.
protected boolean
Inherited from jakarta.mail.search.SearchTerm:
match

Field Detail

ignoreCaseback to summary
protected boolean ignoreCase

Ignore case when comparing?

patternback to summary
protected String pattern

The pattern.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides jakarta.mail.search.SearchTerm.serialVersionUID.

Constructor Detail

StringTermback to summary
protected StringTerm(String pattern)

Construct a StringTerm with the given pattern. Case will be ignored.

Parameters
pattern:String

the pattern

StringTermback to summary
protected StringTerm(String pattern, boolean ignoreCase)

Construct a StringTerm with the given pattern and ignoreCase flag.

Parameters
pattern:String

the pattern

ignoreCase:boolean

should we ignore case?

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Equality comparison.

Parameters
obj:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getIgnoreCaseback to summary
public boolean getIgnoreCase()

Return true if we should ignore case when matching.

Returns:boolean

true if we should ignore case

getPatternback to summary
public String getPattern()

Return the string to match with.

Returns:String

the string to match

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Compute a hashCode for this object.

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object.

Annotations
@Override
matchback to summary
protected boolean match(String s)