ca.odell.glazedlists.matchers

Class SearchEngineTextMatcherEditor.Field<E>

Enclosing Class:
SearchEngineTextMatcherEditor<E>
Implemented Interfaces:
Serializable

public static final class SearchEngineTextMatcherEditor.Field<E>
extends java.lang.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:
  1. what the text is that identifies this Field when parsing the input text of the refilter method
  2. 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.

Constructor Summary

Field(String name, E> textFilterator)
Creates a field with a name and TextFilterator.

Method Summary

boolean
equals(Object o)
String
getName()
Returns the text to be located which uniquely identifies this Field.
int
hashCode()
TextFilterator
super E> getTextFilterator()
Returns the TextFilterator capable of extracting only the fields that should be considered by SearchTerms using this Field.

Constructor Details

Field

public Field(String name,
             E> textFilterator)
Parameters:
name - uniquely identifies this Field relative to all other registered Field objects
textFilterator - extracts only the field values to be considered when matching a given SearchTerm

Method Details

equals

public boolean equals(Object o)

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().

hashCode

public int hashCode()

super E> getTextFilterator

public TextFilterator 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.

Glazed Lists, Copyright © 2003 publicobject.com, O'Dell Engineering.
Documentation build by pbuilder at 2009-07-14 22:05