public abstract class SearchTupleSet extends DefaultTupleSet
Abstract base class for TupleSet implementations that support text search. These sets provide search engine functionality -- Tuple data fields can be indexed and then searched over using text queries, the results of which populate the TupleSet. A range of search techniques are provided by subclasses of this class.
NOTE: The addTuple(Tuple) and
removeTuple(Tuple), methods are not supported by this
implementation or its derived classes. Calling these methods will result
in thrown exceptions. Instead, membership is determined by the search
matches found using the search method, which
searches over the terms indexed using the index(Iterator, String)
and index(Tuple, String) methods.
SearchQueryBindingm_tuplesALL_COLUMNS, DELETE, INSERT, UPDATEEMPTY_ARRAY| Constructor and Description |
|---|
SearchTupleSet() |
| Modifier and Type | Method and Description |
|---|---|
Tuple |
addTuple(Tuple t)
This method is not supported by this implementation.
|
abstract java.lang.String |
getQuery()
Returns the current search query, if any.
|
void |
index(java.util.Iterator tuples,
java.lang.String field)
Indexes the data values for the given field name for
each Tuple in the provided Iterator.
|
abstract void |
index(Tuple t,
java.lang.String field)
Index an individual Tuple field, so that it can be searched for.
|
abstract boolean |
isUnindexSupported()
Indicates if this TupleSearchSet supports the unindex operation.
|
boolean |
removeTuple(Tuple t)
This method is not supported by this implementation.
|
abstract void |
search(java.lang.String query)
Searches the indexed fields of this TupleSet for matching
strings, adding the Tuple instances for each search match
to the TupleSet.
|
abstract void |
unindex(Tuple t,
java.lang.String field)
Un-index an individual Tuple field, so that it can no longer be
searched for.
|
addInternal, clear, 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 abstract java.lang.String getQuery()
public abstract void search(java.lang.String query)
query - the query string to search for. Indexed fields
with matching text will be added to the TupleSet.public void index(java.util.Iterator tuples,
java.lang.String field)
tuples - an Iterator over Tuple instances to indexfield - the name of the attribute to indexjava.lang.ClassCastException - is a non-Tuple instance is
encountered in the iteration.public abstract void index(Tuple t, java.lang.String field)
t - the Tuplefield - the data field to indexpublic abstract void unindex(Tuple t, java.lang.String field)
t - the Tuplefield - the data field to unindexisUnindexSupported()public abstract boolean isUnindexSupported()
unindex(Tuple, String)public Tuple addTuple(Tuple t)
search or
clear methods.addTuple in interface TupleSetaddTuple in class DefaultTupleSett - the Tuple addTupleSet.addTuple(prefuse.data.Tuple)public boolean removeTuple(Tuple t)
search or
clear methods.removeTuple in interface TupleSetremoveTuple in class DefaultTupleSett - the Tuple to removeTupleSet.removeTuple(prefuse.data.Tuple)