com.levigo.util.base.glazedlists.matchers
Class SearchEngineTextMatcherEditor.Field<E>
java.lang.Object
com.levigo.util.base.glazedlists.matchers.SearchEngineTextMatcherEditor.Field<E>
- All Implemented Interfaces:
- Serializable
- Enclosing class:
- SearchEngineTextMatcherEditor<E>
public static final class SearchEngineTextMatcherEditor.Field<E>
- extends Object
- implements Serializable
A Field object contains information specific to a given field found
within the Objects being text matched. Specifically, a Field object
describes two distinct things:
- what the text is that identifies this Field when parsing the input text of
the
refilter
method
- what TextFilterator to use when extracting all values to text search
when matching an Object
For example, the input text "city:Toronto" indicates that the text
"Toronto" should only be matched against the values of the "city" field
within the Objects being searched. As such, a Field object with "city" as
its name and a TextFilterator that only returns the value of the "city"
field from the Objects being text matched must be present in the Set of
Field objects on the SearchEngineTextMatcherEditor
.
- See Also:
- Serialized Form
SearchEngineTextMatcherEditor.Field
public SearchEngineTextMatcherEditor.Field(String name,
TextFilterator<? super E> textFilterator)
- Creates a field with a name and
TextFilterator
.
- Parameters:
name
- uniquely identifies this Field relative to all other
registered Field objectstextFilterator
- extracts only the field values to be considered
when matching a given SearchTerm
getName
public String getName()
- Returns the text to be located which uniquely identifies this Field.
For example, if this method returns "city", then filter text of
"city:Toronto", when parsed, would construct a SearchTerm for
"Toronto" that reports this Field object from
SearchTerm.getField()
.
getTextFilterator
public TextFilterator<? super E> getTextFilterator()
- Returns the TextFilterator capable of extracting only the fields that
should be considered by SearchTerms using this Field. It is this
TextFilterator that contains the custom logic to return a much
smaller subset of the total text-searchable fields on the object.
Often the TextFilterators returned by this method only report the
value of a single field from the Object being matched.
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object