|
org.openidex.util/3 3.11 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openidex.search.SearchGroup
public abstract class SearchGroup
Class which groups individual search types. It provides several services to provide search on them. The services are scanning node system to provide search object for group of search types -> efficient search.
Nested Class Summary | |
---|---|
static interface |
SearchGroup.Factory
Factory which creates SearchGroup . |
static class |
SearchGroup.Registry
Registry which registers search group factories ( SearchGroup.Factory ) for search object types. |
Field Summary | |
---|---|
static String |
PROP_FOUND
Property name which is fired when performing search and searched object passed criteria. |
static String |
PROP_RESULT
Property name which is fired for in for the case original node 's has
changed the way result was changed based on set criteria. |
protected Set |
resultObjects
Set of objects which passed the search criteria (searchtypes). |
protected Set |
searchRoots
Set of nodes on which sub-system to search. |
protected SearchType[] |
searchTypes
search types added to this search group |
protected boolean |
stopped
Flag indicating the search should be stopped. |
Constructor Summary | |
---|---|
SearchGroup()
|
Method Summary | |
---|---|
protected void |
add(SearchType searchType)
Adds a search type to this search group. |
void |
addPropertyChangeListener(PropertyChangeListener l)
Adds property change listener. |
static SearchGroup[] |
createSearchGroups(SearchType[] items)
Creates a search group for each type of object searchable by all the specified search types. |
protected abstract void |
doSearch()
Provides actual search. |
protected void |
firePropertyChange(String name,
Object oldValue,
Object newValue)
Fires property change event. |
abstract Node |
getNodeForFoundObject(Object object)
Gets node for found object. |
Set |
getResultObjects()
Getter for result object property. |
Node[] |
getSearchRoots()
Gets search root nodes. |
SearchType[] |
getSearchTypes()
Returns list of search types. |
protected void |
prepareSearch()
Prepares search. |
protected void |
processSearchObject(Object searchObject)
Provides search on one search object instance. |
void |
removePropertyChangeListener(PropertyChangeListener l)
Removes property change listener. |
void |
search()
Does search. |
void |
setSearchRootNodes(Node[] roots)
Sets roots of nodes in which its interested to search. |
void |
stopSearch()
Stops searching. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROP_FOUND
public static final String PROP_RESULT
node
's has
changed the way result
was changed based on set criteria.
Interested listeners should then get the event with values
null
there wasn't before for the node -> new value has to be non-null
for the latter case.
protected SearchType[] searchTypes
protected final Set searchRoots
protected final Set resultObjects
protected volatile boolean stopped
Constructor Detail |
---|
public SearchGroup()
Method Detail |
---|
protected void add(SearchType searchType)
searchType
- search type to be addedpublic SearchType[] getSearchTypes()
add(org.openidex.search.SearchType)
public void setSearchRootNodes(Node[] roots)
public Node[] getSearchRoots()
public final void stopSearch()
public void search()
protected void prepareSearch()
protected abstract void doSearch()
searchRoots
, extract search objects from them, add them
to the search object set, test over all search type items in this group,
in case if satisfied all it should fire PROP_FOUND
property change and add
the object to resultObjects
set.
The method implemenatation should call processSearchObject(java.lang.Object)
method for each
search object in the node systems.
protected void processSearchObject(Object searchObject)
PROP_FOUND
about successful
match to interested property change listeners.
searchObject
- object to provide actuall test on it. The actual instance
has to be of type returned by all SearchKey.getSearchObjectType
returned by SearchType
of this SearchGroup
public abstract Node getNodeForFoundObject(Object object)
public Set getResultObjects()
public void addPropertyChangeListener(PropertyChangeListener l)
public void removePropertyChangeListener(PropertyChangeListener l)
protected void firePropertyChange(String name, Object oldValue, Object newValue)
public static SearchGroup[] createSearchGroups(SearchType[] items)
At first, a set of object types common to all search types
(i.e. Class
s representing object types, common
to all search types) is computed. Then a search group is created
for each of the Class
s.
search
- types to create search groups for
SearchType.getSearchTypeClasses()
|
org.openidex.util/3 3.11 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |