prefuse.data.search
Class RegexSearchTupleSet

java.lang.Object
  extended by prefuse.data.tuple.AbstractTupleSet
      extended by prefuse.data.tuple.DefaultTupleSet
          extended by prefuse.data.search.SearchTupleSet
              extended by prefuse.data.search.RegexSearchTupleSet
All Implemented Interfaces:
EventConstants, TupleSet

public class RegexSearchTupleSet
extends SearchTupleSet

SearchTupleSet implementation that treats the query as a regular expression to match against all indexed Tuple data fields. The regular expression engine provided by the standard Java libraries (java.util.regex.Pattern) is used; please refer to the documentation for that class for more about the regular expression syntax.

Author:
jeffrey heer
See Also:
SearchQueryBinding

Field Summary
 
Fields inherited from class prefuse.data.tuple.DefaultTupleSet
m_tuples
 
Fields inherited from interface prefuse.data.event.EventConstants
ALL_COLUMNS, DELETE, INSERT, UPDATE
 
Fields inherited from interface prefuse.data.tuple.TupleSet
EMPTY_ARRAY
 
Constructor Summary
RegexSearchTupleSet()
          Create a new, case-insensitive regular expression search tuple set.
RegexSearchTupleSet(boolean caseSensitive)
          Create a new regular expression search tuple set.
 
Method Summary
 void clear()
          Removes all search hits and clears out the index.
 java.lang.String getQuery()
          Returns the current search query, if any.
 void index(Tuple t, java.lang.String field)
          Index an individual Tuple field, so that it can be searched for.
 boolean isUnindexSupported()
          Returns true, as unidexing is supported by this class.
 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.
 void unindex(Tuple t, java.lang.String field)
          Un-index an individual Tuple field, so that it can no longer be searched for.
 
Methods inherited from class prefuse.data.search.SearchTupleSet
addTuple, index, removeTuple
 
Methods inherited from class prefuse.data.tuple.DefaultTupleSet
addInternal, clearInternal, containsTuple, getTupleCount, removeInternal, setTuple, toArray, tuples
 
Methods inherited from class prefuse.data.tuple.AbstractTupleSet
addColumn, addColumn, addColumn, addColumn, addColumns, addPropertyChangeListener, addPropertyChangeListener, addTupleSetListener, fireTupleEvent, fireTupleEvent, fireTupleEvent, getClientProperty, isAddColumnSupported, putClientProperty, removePropertyChangeListener, removePropertyChangeListener, removeTupleSetListener, tuples, tuples
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegexSearchTupleSet

public RegexSearchTupleSet()
Create a new, case-insensitive regular expression search tuple set.


RegexSearchTupleSet

public RegexSearchTupleSet(boolean caseSensitive)
Create a new regular expression search tuple set.

Parameters:
caseSensitive - true to make the indexing case sensitive, false otherwise.
Method Detail

getQuery

public java.lang.String getQuery()
Description copied from class: SearchTupleSet
Returns the current search query, if any.

Specified by:
getQuery in class SearchTupleSet
Returns:
the currently active search query
See Also:
SearchTupleSet.getQuery()

search

public void search(java.lang.String query)
Description copied from class: SearchTupleSet
Searches the indexed fields of this TupleSet for matching strings, adding the Tuple instances for each search match to the TupleSet. The details of how the query is matched to indexed fields is left to subclasses.

Specified by:
search in class SearchTupleSet
Parameters:
query - the query string to search for. Indexed fields with matching text will be added to the TupleSet.
See Also:
SearchTupleSet.search(java.lang.String)

index

public void index(Tuple t,
                  java.lang.String field)
Description copied from class: SearchTupleSet
Index an individual Tuple field, so that it can be searched for.

Specified by:
index in class SearchTupleSet
Parameters:
t - the Tuple
field - the data field to index
See Also:
SearchTupleSet.index(prefuse.data.Tuple, java.lang.String)

unindex

public void unindex(Tuple t,
                    java.lang.String field)
Description copied from class: SearchTupleSet
Un-index an individual Tuple field, so that it can no longer be searched for.

Specified by:
unindex in class SearchTupleSet
Parameters:
t - the Tuple
field - the data field to unindex
See Also:
SearchTupleSet.unindex(prefuse.data.Tuple, java.lang.String)

isUnindexSupported

public boolean isUnindexSupported()
Returns true, as unidexing is supported by this class.

Specified by:
isUnindexSupported in class SearchTupleSet
Returns:
true if unindex is supported, false otherwise.
See Also:
SearchTupleSet.isUnindexSupported()

clear

public void clear()
Removes all search hits and clears out the index.

Specified by:
clear in interface TupleSet
Overrides:
clear in class DefaultTupleSet
See Also:
TupleSet.clear()


Copyright © 2007 Regents of the University of California