public class PrefixSearchTupleSet extends SearchTupleSet
SearchTupleSet implementation supporting word prefix searches over indexed
Tuple data fields. This class uses a Trie data structure
to find search results quickly; however, only prefix matches will be
identified as valid search matches. Multi-term search queries will result
in the union of the results for the individual query terms. That is, Tuples
that match any one of the terms will be included in the results.
For more advanced search capabilities, see
KeywordSearchTupleSet or RegexSearchTupleSet.
SearchQueryBindingm_tuplesALL_COLUMNS, DELETE, INSERT, UPDATEEMPTY_ARRAY| Constructor and Description |
|---|
PrefixSearchTupleSet()
Creates a new KeywordSearchFocusSet that is not case sensitive.
|
PrefixSearchTupleSet(boolean caseSensitive)
Creates a new KeywordSearchFocusSet with the indicated case sensitivity.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all search hits and clears out the index.
|
java.lang.String |
getDelimiterString()
Returns the delimiter string used to divide data values and
queries into separate words.
|
java.lang.String |
getQuery()
Returns the current search query, if any.
|
void |
index(Tuple t,
java.lang.String field)
Indexes the given field of the provided Tuple instance.
|
boolean |
isUnindexSupported()
Returns true, as unidexing is supported by this class.
|
void |
search(java.lang.String query)
Searches the indexed Tuple fields for matching string prefixes,
adding the Tuple instances for each search match to this TupleSet.
|
void |
setDelimiterString(java.lang.String delim)
Sets the delimiter string used to divide data values and
queries into separate words.
|
void |
unindex(Tuple t,
java.lang.String field)
Un-index an individual Tuple field, so that it can no longer be
searched for.
|
addTuple, index, removeTupleaddInternal, clearInternal, containsTuple, getTupleCount, removeInternal, setTuple, toArray, tuplesaddColumn, addColumn, addColumn, addColumn, addColumns, addPropertyChangeListener, addPropertyChangeListener, addTupleSetListener, fireTupleEvent, fireTupleEvent, fireTupleEvent, getClientProperty, isAddColumnSupported, putClientProperty, removePropertyChangeListener, removePropertyChangeListener, removeTupleSetListener, tuples, tuplespublic PrefixSearchTupleSet()
public PrefixSearchTupleSet(boolean caseSensitive)
caseSensitive - true if the search routines should be case
sensitive, false otherwise.public java.lang.String getDelimiterString()
StringTokenizer instance that will tokenize the text.StringTokenizerpublic void setDelimiterString(java.lang.String delim)
delim - the delimiter string to use. This is passed as an argument
to a StringTokenizer instance that will tokenize the
text.StringTokenizerpublic java.lang.String getQuery()
SearchTupleSetgetQuery in class SearchTupleSetSearchTupleSet.getQuery()public void search(java.lang.String query)
search in class SearchTupleSetquery - the query string to search for.setDelimiterString(String)public void index(Tuple t, java.lang.String field)
index in class SearchTupleSett - the Tuplefield - the data field to indexSearchTupleSet.index(prefuse.data.Tuple, java.lang.String)public boolean isUnindexSupported()
isUnindexSupported in class SearchTupleSetSearchTupleSet.isUnindexSupported()public void unindex(Tuple t, java.lang.String field)
SearchTupleSetunindex in class SearchTupleSett - the Tuplefield - the data field to unindexSearchTupleSet.unindex(prefuse.data.Tuple, java.lang.String)public void clear()
clear in interface TupleSetclear in class DefaultTupleSetTupleSet.clear()