|
||||||||||
| 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. |
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 | |
|---|---|
static IndexData.Entry |
FIRST_ENTRY
special entry which is less than any other entry |
static IndexData.Entry |
LAST_ENTRY
special entry which is greater than any other entry |
static 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 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 |
| Method Summary | |
|---|---|
void |
addRow(Object[] row,
RowId rowId)
Adds a row to this index |
Object[] |
constructIndexRow(Map<String,?> row)
Constructs an array of values appropriate for this index from the given column values. |
Object[] |
constructIndexRow(String colName,
Object value)
Constructs an array of values appropriate for this index from the given column value. |
Object[] |
constructIndexRowFromEntry(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,
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(Object[] startRow,
boolean startInclusive,
Object[] endRow,
boolean endInclusive)
Gets a new cursor for this index, narrowed to the range defined by the given startRow and endRow. |
void |
deleteRow(Object[] row,
RowId rowId)
Removes a row from this index |
List<IndexData.ColumnDescriptor> |
getColumns()
Returns the Columns for this index (unmodifiable) |
JetFormat |
getFormat()
|
int |
getIndexDataNumber()
|
List<Index> |
getIndexes()
|
byte |
getIndexFlags()
|
int |
getOwnedPageCount()
Returns the number of database pages owned by this index data. |
PageChannel |
getPageChannel()
|
Index |
getPrimaryIndex()
|
Table |
getTable()
|
int |
getUniqueEntryCount()
|
int |
getUniqueEntryCountOffset()
|
void |
initialize()
Forces initialization of this index (actual parsing of index pages). |
boolean |
isInitialized()
Whether or not the complete index state has been read. |
boolean |
isUnique()
Whether or not index entries must be unique. |
void |
read(ByteBuffer tableBuffer,
List<Column> availableColumns)
Read the rest of the index info from a tableBuffer |
boolean |
shouldIgnoreNulls()
Whether or not null values are actually recorded in the index. |
String |
toString()
|
void |
update()
Writes the current index state to the database. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final IndexData.Entry FIRST_ENTRY
public static final IndexData.Entry LAST_ENTRY
public static final Object MAX_VALUE
public static final Object MIN_VALUE
| Method Detail |
|---|
public static IndexData create(Table table,
ByteBuffer tableBuffer,
int number,
JetFormat format)
throws IOException
IOExceptionpublic Table getTable()
public JetFormat getFormat()
public PageChannel getPageChannel()
public Index getPrimaryIndex()
public List<Index> getIndexes()
public byte getIndexFlags()
public int getIndexDataNumber()
public int getUniqueEntryCount()
public int getUniqueEntryCountOffset()
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 List<IndexData.ColumnDescriptor> getColumns()
public boolean isInitialized()
public int getOwnedPageCount()
public void initialize()
throws IOException
IOException
public void update()
throws IOException
Forces index initialization.
IOException
public void read(ByteBuffer tableBuffer,
List<Column> availableColumns)
throws IOException
tableBuffer - table definition buffer to read from initial infoavailableColumns - Columns that this index may use
IOException
public void addRow(Object[] row,
RowId rowId)
throws IOException
Forces index initialization.
row - Row to addrowId - rowId of the row to be added
IOException
public void deleteRow(Object[] row,
RowId rowId)
throws IOException
Forces index initialization.
row - Row to removerowId - rowId of the row to be removed
IOException
public IndexData.EntryCursor cursor()
throws IOException
Forces index initialization.
IOException
public IndexData.EntryCursor cursor(Object[] startRow,
boolean startInclusive,
Object[] endRow,
boolean endInclusive)
throws 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
IOExceptionpublic Object[] constructIndexRowFromEntry(Object... values)
IllegalArgumentException - if the wrong number of values are
provided
public Object[] constructIndexRow(String colName,
Object value)
null if not all
columns for this index were providedpublic Object[] constructIndexRow(Map<String,?> row)
null if not all
columns for this index were providedpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||