|
Elexis: Das führende OpenSource-Arztpraxisprogamm im deutschsprachigen Raum Java doc für Elexis version 2.1.7.dev vom 01.09.2013 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.healthmarketscience.jackcess.IndexData
public abstract class IndexData
Access table index data. This is the actual data which backs a logical Index, where one or more logical indexes can be backed by the same index data.
Nested Class Summary | |
---|---|
static class |
IndexData.ColumnDescriptor
Information about the columns in an index. |
protected static class |
IndexData.DataPage
Object used to maintain state about an Index page. |
static class |
IndexData.Entry
A single leaf entry in an index (points to a single row) |
class |
IndexData.EntryCursor
Utility class to traverse the entries in the Index. |
static class |
IndexData.EntryType
type attributes for Entries which simplify comparisons |
Field Summary | |
---|---|
protected static byte[] |
EMPTY_PREFIX
|
static IndexData.Entry |
FIRST_ENTRY
special entry which is less than any other entry |
protected static int |
INVALID_INDEX_PAGE_NUMBER
|
static IndexData.Entry |
LAST_ENTRY
special entry which is greater than any other entry |
protected static org.apache.commons.logging.Log |
LOG
|
static java.lang.Object |
MAX_VALUE
special object which will always be greater than any other value, when searching for an index entry range in a multi-value index |
static java.lang.Object |
MIN_VALUE
special object which will always be greater than any other value, when searching for an index entry range in a multi-value index |
Constructor Summary | |
---|---|
protected |
IndexData(Table table,
int number,
int uniqueEntryCount,
int uniqueEntryCountOffset)
|
Method Summary | |
---|---|
void |
addRow(java.lang.Object[] row,
RowId rowId)
Adds a row to this index Forces index initialization. |
java.lang.Object[] |
constructIndexRow(java.util.Map<java.lang.String,?> row)
Constructs an array of values appropriate for this index from the given column values. |
java.lang.Object[] |
constructIndexRow(java.lang.String colName,
java.lang.Object value)
Constructs an array of values appropriate for this index from the given column value. |
java.lang.Object[] |
constructIndexRowFromEntry(java.lang.Object... values)
Constructs an array of values appropriate for this index from the given column values, expected to match the columns for this index. |
static IndexData |
create(Table table,
java.nio.ByteBuffer tableBuffer,
int number,
JetFormat format)
Creates an IndexData appropriate for the given table, using information from the given table definition buffer. |
IndexData.EntryCursor |
cursor()
Gets a new cursor for this index. |
IndexData.EntryCursor |
cursor(java.lang.Object[] startRow,
boolean startInclusive,
java.lang.Object[] endRow,
boolean endInclusive)
Gets a new cursor for this index, narrowed to the range defined by the given startRow and endRow. |
void |
deleteRow(java.lang.Object[] row,
RowId rowId)
Removes a row from this index Forces index initialization. |
protected abstract IndexData.DataPage |
findDataPage(IndexData.Entry entry)
Finds the data page for the given entry. |
java.util.List<IndexData.ColumnDescriptor> |
getColumns()
Returns the Columns for this index (unmodifiable) |
protected abstract IndexData.DataPage |
getDataPage(int pageNumber)
Gets the data page for the pageNumber. |
protected int |
getEntryCount()
Returns the number of index entries in the index. |
JetFormat |
getFormat()
|
int |
getIndexDataNumber()
|
java.util.List<Index> |
getIndexes()
|
byte |
getIndexFlags()
|
protected int |
getMaxPageEntrySize()
|
int |
getOwnedPageCount()
Returns the number of database pages owned by this index data. |
PageChannel |
getPageChannel()
|
Index |
getPrimaryIndex()
|
protected int |
getRootPageNumber()
|
Table |
getTable()
|
int |
getUniqueEntryCount()
|
int |
getUniqueEntryCountOffset()
|
void |
initialize()
Forces initialization of this index (actual parsing of index pages). normally, the index will not be initialized until the entries are actually needed. |
protected boolean |
isBackingPrimaryKey()
|
boolean |
isInitialized()
Whether or not the complete index state has been read. |
protected boolean |
isReadOnly()
|
boolean |
isUnique()
Whether or not index entries must be unique. |
protected static int |
missingIndexToInsertionPoint(int idx)
Returns the valid insertion point for an index indicating a missing entry. |
void |
read(java.nio.ByteBuffer tableBuffer,
java.util.List<Column> availableColumns)
Read the rest of the index info from a tableBuffer |
protected void |
readDataPage(IndexData.DataPage dataPage)
Reads an index page, populating the correct collection based on the page type (node or leaf). |
protected abstract void |
readIndexEntries()
Reads the actual index entries. |
protected void |
setReadOnly()
|
boolean |
shouldIgnoreNulls()
Whether or not null values are actually recorded in the index. |
java.lang.String |
toString()
|
void |
update()
Writes the current index state to the database. |
protected abstract void |
updateImpl()
Writes the current index state to the database. |
protected static void |
writeDataPage(java.nio.ByteBuffer buffer,
IndexData.DataPage dataPage,
int tdefPageNumber,
JetFormat format)
Writes the data page info to the given buffer. |
protected void |
writeDataPage(IndexData.DataPage dataPage)
Write the given index page out to a buffer |
protected static void |
writeDefinitions(com.healthmarketscience.jackcess.TableCreator creator,
java.nio.ByteBuffer buffer)
Writes the index definitions into a table definition buffer. |
protected static void |
writeRowCountDefinitions(com.healthmarketscience.jackcess.TableCreator creator,
java.nio.ByteBuffer buffer)
Writes the index row count definitions into a table definition buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.commons.logging.Log LOG
public static final IndexData.Entry FIRST_ENTRY
public static final IndexData.Entry LAST_ENTRY
public static final java.lang.Object MAX_VALUE
public static final java.lang.Object MIN_VALUE
protected static final int INVALID_INDEX_PAGE_NUMBER
protected static final byte[] EMPTY_PREFIX
Constructor Detail |
---|
protected IndexData(Table table, int number, int uniqueEntryCount, int uniqueEntryCountOffset)
Method Detail |
---|
public static IndexData create(Table table, java.nio.ByteBuffer tableBuffer, int number, JetFormat format) throws java.io.IOException
java.io.IOException
public Table getTable()
public JetFormat getFormat()
public PageChannel getPageChannel()
public Index getPrimaryIndex()
public java.util.List<Index> getIndexes()
public byte getIndexFlags()
public int getIndexDataNumber()
public int getUniqueEntryCount()
public int getUniqueEntryCountOffset()
protected boolean isBackingPrimaryKey()
public boolean shouldIgnoreNulls()
null
values are actually recorded in the index.
public boolean isUnique()
Some notes about uniqueness:
null
entries invalid for a unique index
public java.util.List<IndexData.ColumnDescriptor> getColumns()
public boolean isInitialized()
protected int getRootPageNumber()
protected void setReadOnly()
protected boolean isReadOnly()
protected int getMaxPageEntrySize()
public int getOwnedPageCount()
protected int getEntryCount() throws java.io.IOException
Forces index initialization.
java.io.IOException
public void initialize() throws java.io.IOException
java.io.IOException
public void update() throws java.io.IOException
Forces index initialization.
java.io.IOException
public void read(java.nio.ByteBuffer tableBuffer, java.util.List<Column> availableColumns) throws java.io.IOException
tableBuffer
- table definition buffer to read from initial infoavailableColumns
- Columns that this index may use
java.io.IOException
protected static void writeRowCountDefinitions(com.healthmarketscience.jackcess.TableCreator creator, java.nio.ByteBuffer buffer)
buffer
- Buffer to write toindexes
- List of IndexBuilders to write definitions forprotected static void writeDefinitions(com.healthmarketscience.jackcess.TableCreator creator, java.nio.ByteBuffer buffer) throws java.io.IOException
buffer
- Buffer to write toindexes
- List of IndexBuilders to write definitions for
java.io.IOException
public void addRow(java.lang.Object[] row, RowId rowId) throws java.io.IOException
Forces index initialization.
row
- Row to addrowId
- rowId of the row to be added
java.io.IOException
public void deleteRow(java.lang.Object[] row, RowId rowId) throws java.io.IOException
Forces index initialization.
row
- Row to removerowId
- rowId of the row to be removed
java.io.IOException
public IndexData.EntryCursor cursor() throws java.io.IOException
Forces index initialization.
java.io.IOException
public IndexData.EntryCursor cursor(java.lang.Object[] startRow, boolean startInclusive, java.lang.Object[] endRow, boolean endInclusive) throws java.io.IOException
Forces index initialization.
startRow
- the first row of data for the cursor, or null
for the first entrystartInclusive
- whether or not startRow is inclusive or exclusiveendRow
- the last row of data for the cursor, or null
for the last entryendInclusive
- whether or not endRow is inclusive or exclusive
java.io.IOException
protected static int missingIndexToInsertionPoint(int idx)
public java.lang.Object[] constructIndexRowFromEntry(java.lang.Object... values)
java.lang.IllegalArgumentException
- if the wrong number of values are providedpublic java.lang.Object[] constructIndexRow(java.lang.String colName, java.lang.Object value)
null
if not all columns for this
index were providedpublic java.lang.Object[] constructIndexRow(java.util.Map<java.lang.String,?> row)
null
if not all columns for this
index were providedpublic java.lang.String toString()
toString
in class java.lang.Object
protected void writeDataPage(IndexData.DataPage dataPage) throws java.io.IOException
java.io.IOException
protected static void writeDataPage(java.nio.ByteBuffer buffer, IndexData.DataPage dataPage, int tdefPageNumber, JetFormat format) throws java.io.IOException
java.io.IOException
protected void readDataPage(IndexData.DataPage dataPage) throws java.io.IOException
java.io.IOException
protected abstract void updateImpl() throws java.io.IOException
java.io.IOException
protected abstract void readIndexEntries() throws java.io.IOException
java.io.IOException
protected abstract IndexData.DataPage findDataPage(IndexData.Entry entry) throws java.io.IOException
java.io.IOException
protected abstract IndexData.DataPage getDataPage(int pageNumber) throws java.io.IOException
java.io.IOException
|
Elexis: Das führende OpenSource-Arztpraxisprogamm im deutschsprachigen Raum Java doc für Elexis version 2.1.7.dev vom 01.09.2013 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |