public class IndexImpl extends Object implements Index, Comparable<IndexImpl>
| Modifier and Type | Class and Description |
|---|---|
static class |
IndexImpl.ForeignKeyReference
Information about a foreign key reference defined in an index (when
referential integrity should be enforced).
|
Index.Column| Modifier and Type | Field and Description |
|---|---|
static byte |
FOREIGN_KEY_INDEX_TYPE
index type for foreign key indexes
|
protected static org.apache.commons.logging.Log |
LOG |
static byte |
PRIMARY_KEY_INDEX_TYPE
index type for primary key indexes
|
| Modifier | Constructor and Description |
|---|---|
protected |
IndexImpl(ByteBuffer tableBuffer,
List<IndexData> indexDatas,
JetFormat format) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(IndexImpl other) |
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.
|
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.
|
List<IndexData.ColumnDescriptor> |
getColumns() |
JetFormat |
getFormat() |
IndexData |
getIndexData() |
byte |
getIndexFlags() |
int |
getIndexNumber() |
String |
getName() |
PageChannel |
getPageChannel() |
IndexImpl.ForeignKeyReference |
getReference() |
IndexImpl |
getReferencedIndex() |
TableImpl |
getTable() |
int |
getUniqueEntryCount() |
int |
getUniqueEntryCountOffset() |
void |
initialize()
Forces initialization of this index (actual parsing of index pages).
|
boolean |
isForeignKey() |
boolean |
isInitialized()
Whether or not the complete index state has been read.
|
boolean |
isPrimaryKey() |
boolean |
isUnique()
Whether or not index entries must be unique.
|
CursorBuilder |
newCursor()
Convenience method for constructing a new CursorBuilder for this Index.
|
boolean |
shouldIgnoreNulls()
Whether or not
null values are actually recorded in the index. |
String |
toString() |
protected static void |
writeDefinitions(com.healthmarketscience.jackcess.impl.TableCreator creator,
ByteBuffer buffer)
Writes the logical index definitions into a table definition buffer.
|
protected static final org.apache.commons.logging.Log LOG
public static final byte PRIMARY_KEY_INDEX_TYPE
public static final byte FOREIGN_KEY_INDEX_TYPE
protected IndexImpl(ByteBuffer tableBuffer, List<IndexData> indexDatas, JetFormat format) throws IOException
IOExceptionpublic IndexData getIndexData()
public JetFormat getFormat()
public PageChannel getPageChannel()
public int getIndexNumber()
public byte getIndexFlags()
public int getUniqueEntryCount()
public int getUniqueEntryCountOffset()
public boolean isPrimaryKey()
isPrimaryKey in interface Indexpublic boolean isForeignKey()
isForeignKey in interface Indexpublic IndexImpl.ForeignKeyReference getReference()
public IndexImpl getReferencedIndex() throws IOException
getReferencedIndex in interface Indexnull.IOExceptionpublic boolean shouldIgnoreNulls()
Indexnull values are actually recorded in the index.shouldIgnoreNulls in interface Indexpublic boolean isUnique()
IndexSome notes about uniqueness:
null entries
invalid for a unique indexpublic List<IndexData.ColumnDescriptor> getColumns()
getColumns in interface Indexpublic CursorBuilder newCursor()
Indexpublic boolean isInitialized()
public void initialize()
throws IOException
IOExceptionpublic IndexData.EntryCursor cursor() throws IOException
Forces index initialization.
IOExceptionpublic 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 exclusiveIOExceptionpublic Object[] constructIndexRowFromEntry(Object... values)
IllegalArgumentException - if the wrong number of values are
providedpublic 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 int compareTo(IndexImpl other)
compareTo in interface Comparable<IndexImpl>protected static void writeDefinitions(com.healthmarketscience.jackcess.impl.TableCreator creator,
ByteBuffer buffer)
throws IOException
creator - description of the indexes to writebuffer - Buffer to write toIOExceptionCopyright © 2005–2016. All rights reserved.