Package net.ontopia.topicmaps.impl.utils
Class FulltextIndexManager
- java.lang.Object
-
- net.ontopia.topicmaps.impl.utils.AbstractIndex
-
- net.ontopia.topicmaps.impl.utils.BasicIndex
-
- net.ontopia.topicmaps.impl.utils.FulltextIndexManager
-
- All Implemented Interfaces:
IndexIF
,EventListenerIF
public class FulltextIndexManager extends BasicIndex
INTERNAL: The indexer manager will keep track of base names, variants and occurrences that are changed in the topic map. These fulltext index can later be synchronized through the synchronizeIndex method.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.ontopia.topicmaps.impl.utils.BasicIndex
BasicIndex.EventHandler<K,V>, BasicIndex.TypedPredicate
-
-
Field Summary
Fields Modifier and Type Field Description protected Collection<TMObjectIF>
added
protected Collection<TMObjectIF>
changed
protected Collection<String>
removed
-
Fields inherited from class net.ontopia.topicmaps.impl.utils.BasicIndex
handlers
-
-
Constructor Summary
Constructors Constructor Description FulltextIndexManager(InMemoryTopicMapStore store)
INTERNAL: Registers the fulltext index manager with the event system of the specified topic map store.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
needSynchronization()
INTERNAL: Returns true if index manager has seen changes to the topic map, so that the index must be updated.protected void
objectAdded(Object object)
protected void
objectChanged(Object object)
protected void
objectRemoved(Object object)
boolean
synchronizeIndex(IndexerIF indexer)
INTERNAL: Applies all changes made to the topic map to the specified fulltext indexer.-
Methods inherited from class net.ontopia.topicmaps.impl.utils.BasicIndex
getIndex, processEvent
-
-
-
-
Field Detail
-
added
protected Collection<TMObjectIF> added
-
removed
protected Collection<String> removed
-
changed
protected Collection<TMObjectIF> changed
-
-
Constructor Detail
-
FulltextIndexManager
public FulltextIndexManager(InMemoryTopicMapStore store)
INTERNAL: Registers the fulltext index manager with the event system of the specified topic map store.- Parameters:
store
-
-
-
Method Detail
-
needSynchronization
public boolean needSynchronization()
INTERNAL: Returns true if index manager has seen changes to the topic map, so that the index must be updated.- Returns:
- True if index must be updated.
-
synchronizeIndex
public boolean synchronizeIndex(IndexerIF indexer) throws IOException
INTERNAL: Applies all changes made to the topic map to the specified fulltext indexer.- Parameters:
indexer
- The fulltext indexer to synchronize against.- Returns:
- True if the index was modified.
- Throws:
IOException
-
objectAdded
protected void objectAdded(Object object)
-
objectRemoved
protected void objectRemoved(Object object)
-
objectChanged
protected void objectChanged(Object object)
-
-