org.tm4j.topicmap.index
Interface Index

All Known Subinterfaces:
AssociationTypesIndex, BaseNameDataIndex, ConfigurableIndex, FullTextIndex, MemberTypesIndex, OccurrenceDataIndex, OccurrenceLocatorIndex, OccurrenceTypesIndex, ThemesIndex, TopicTypesIndex, VariantDataIndex, VariantLocatorIndex
All Known Implementing Classes:
LuceneIndexBase

public interface Index

The basic interface which must be supported by all index implementations. A typical implementation will support this interface plus additional operations to access the index itself. For example a TopicTypesIndex would implement this interface plus getTopicByType(Topic t) or something similar.

This interface simply provides methods to open and close the index and to force it to rebuild itself (unless it is an index which automatically stays in-sync with the topic map data.


Method Summary
 void close()
          This method may cause the index to be dropped and any memory used to be freed.
 boolean isOpen()
          Determines whether or not the index is accessible.
 void open()
          This method may cause the index to be initialised.
 void reindex()
          This method may cause the index to be regenerated.
 

Method Detail

open

public void open()
          throws IndexException
This method may cause the index to be initialised. Indexes which are automatically initialised on the loading of their IndexProvider are not required to perform any operation in this method, but should still support it as a no-op.

Throws:
IndexException - If some internal error prevents the index from being opened.

isOpen

public boolean isOpen()
Determines whether or not the index is accessible.

Returns:
True if the index is accessible, false otherwise.

reindex

public void reindex()
             throws IndexException
This method may cause the index to be regenerated. Indexes which automatically update are not required to perform any operation in response to this method, but should still support it as a no-op. Indexes which do not automatically update must either regenerate themselves or throw an IndexException or an UnsupportedOperationException.

Throws:
IndexException - If some internal error prevents the index from being regenerated.
java.lang.UnsupportedOperationException - If the index does not support reindexing.

close

public void close()
           throws IndexException
This method may cause the index to be dropped and any memory used to be freed. After a call to this method, any subsequent call to the same interface must fail.

Throws:
IndexException