|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.healthmarketscience.jackcess.impl.IndexImpl
public class IndexImpl
Access table (logical) index. Logical indexes are backed for IndexData, where one or more logical indexes could be backed by the same data.
| Nested Class Summary | |
|---|---|
static class |
IndexImpl.ForeignKeyReference
Information about a foreign key reference defined in an index (when referential integrity should be enforced). |
| Nested classes/interfaces inherited from interface com.healthmarketscience.jackcess.Index |
|---|
Index.Column |
| Field Summary | |
|---|---|
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 |
| Constructor Summary | |
|---|---|
protected |
IndexImpl(ByteBuffer tableBuffer,
List<IndexData> indexDatas,
JetFormat format)
|
| Method Summary | |
|---|---|
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. |
Object[] |
constructPartialIndexRow(Object filler,
Map<String,?> row)
Constructs an array of values appropriate for this index from the given column values, possibly only using a subset of the given values. |
Object[] |
constructPartialIndexRow(Object filler,
String colName,
Object value)
Constructs an array of values appropriate for this index from the given column value, which must be the first column of the index. |
Object[] |
constructPartialIndexRowFromEntry(Object filler,
Object... values)
Constructs an array of values appropriate for this index from the given column values, possibly only providing a prefix subset of the index columns (at least one value must be provided). |
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. |
int |
getColumnCount()
|
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 |
isRequired()
Whether or not values are required for index columns. |
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 |
writeDefinition(TableMutator mutator,
IndexBuilder idx,
ByteBuffer buffer)
|
protected static void |
writeDefinitions(TableCreator creator,
ByteBuffer buffer)
Writes the logical index 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 byte PRIMARY_KEY_INDEX_TYPE
public static final byte FOREIGN_KEY_INDEX_TYPE
| Constructor Detail |
|---|
protected IndexImpl(ByteBuffer tableBuffer,
List<IndexData> indexDatas,
JetFormat format)
throws IOException
IOException| Method Detail |
|---|
public IndexData getIndexData()
public TableImpl getTable()
getTable in interface Indexpublic JetFormat getFormat()
public PageChannel getPageChannel()
public int getIndexNumber()
public byte getIndexFlags()
public int getUniqueEntryCount()
public int getUniqueEntryCountOffset()
public String getName()
getName in interface Indexpublic 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 index
isUnique in interface Indexpublic boolean isRequired()
Index
isRequired in interface Indexpublic List<IndexData.ColumnDescriptor> getColumns()
getColumns in interface Indexpublic int getColumnCount()
getColumnCount in interface Indexpublic CursorBuilder newCursor()
Index
newCursor in interface Indexpublic boolean isInitialized()
public void initialize()
throws IOException
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[] constructPartialIndexRowFromEntry(Object filler,
Object... values)
IllegalArgumentException - if at least one value is not provided
public Object[] constructIndexRow(String colName,
Object value)
null if not all
columns for this index were provided
public Object[] constructPartialIndexRow(Object filler,
String colName,
Object value)
null if no prefix
list of columns for this index were providedpublic Object[] constructIndexRow(Map<String,?> row)
null if not all
columns for this index were provided
public Object[] constructPartialIndexRow(Object filler,
Map<String,?> row)
null if no prefix
list of columns for this index were providedpublic String toString()
toString in class Objectpublic int compareTo(IndexImpl other)
compareTo in interface Comparable<IndexImpl>
protected static void writeDefinitions(TableCreator creator,
ByteBuffer buffer)
throws IOException
creator - description of the indexes to writebuffer - Buffer to write to
IOException
protected static void writeDefinition(TableMutator mutator,
IndexBuilder idx,
ByteBuffer buffer)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||