public interface IndexContainer
IndexContainer
is usually passed to a Index
instance at construction time to allow it to get
its data.
An index container can be in two modes, access
or edit
mode.
In access mode, Index
instances can fetch and read the data stored in the index container, but the index and index
container structure can not be changed. In edit mode, the index container structure can be
changed: indexes can be added and deleted; but it is not allowed for Index
instances to access the data.
Modifier and Type | Method and Description |
---|---|
boolean |
canAccess()
Return if the index container is in
access mode. |
boolean |
canEdit()
Return if the index container is in
edit mode. |
void |
close()
Close this index container.
|
void |
createIndex(int indexType,
ByteBuffer data)
Add index data for a particular index type to the container.
|
void |
deleteIndex(int indexType)
Delete the index data of a particular index type from the container.
|
void |
endEditing()
Switch the index container from
edit mode to access mode. |
ByteOrder |
getIndexByteOrder()
Return the byte order used by this index container for
ByteBuffers . |
ByteBuffer |
getIndexData(int indexType)
Fetch the index data for a particular index type for read access.
|
boolean |
hasIndex(int indexType)
Test if the index data of the particular index type is stored in this container.
|
boolean hasIndex(int indexType)
ByteOrder getIndexByteOrder()
ByteBuffers
.
Indexes
and IndexBuilders
should use this byte order
to guarantee that the index file is portable. ByteBuffers
returned by
getIndexData
are set to the byte order returned by this method.ByteBuffer getIndexData(int indexType) throws IndexException, IllegalStateException
Index
instances will call this method to get at their data.close
is called.IllegalStateException
- if the index container is not in access
mode.IndexException
void close()
getIndexData
are invalid.void createIndex(int indexType, ByteBuffer data) throws IndexException, IllegalStateException
edit
mode.indexType
- Index type of the data added.data
- Buffer containing the index data. The format of the data stored in the buffer
is dependent on the index used, not on the index container.IndexException
- if index data of the selected type already exists or an error
occurrs while storing the data.IllegalStateException
- if the index container is not in edit
mode.void deleteIndex(int indexType) throws IndexException, IllegalStateException
indexType
- Index type of the data to delete.IndexException
- if an error occurrs while deleting the data.IllegalStateException
- if the index container is not in edit
mode.void endEditing() throws IndexException, IllegalStateException
edit
mode to access
mode.IndexException
IllegalStateException
boolean canAccess()
access
mode.boolean canEdit()
edit
mode.Copyright © 2001-2013 the JGloss developers. All Rights Reserved.