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
|
static byte |
PRIMARY_KEY_INDEX_TYPE
index type for primary key indexes
|
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.
|
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() |
public static final byte PRIMARY_KEY_INDEX_TYPE
public static final byte FOREIGN_KEY_INDEX_TYPE
public 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 Index
public boolean isForeignKey()
isForeignKey
in interface Index
public IndexImpl.ForeignKeyReference getReference()
public IndexImpl getReferencedIndex() throws IOException
getReferencedIndex
in interface Index
null
.IOException
public boolean shouldIgnoreNulls()
Index
null
values are actually recorded in the index.shouldIgnoreNulls
in interface Index
public boolean isUnique()
Index
Some notes about uniqueness:
null
entries
invalid for a unique indexpublic boolean isRequired()
Index
isRequired
in interface Index
public List<IndexData.ColumnDescriptor> getColumns()
getColumns
in interface Index
public int getColumnCount()
getColumnCount
in interface Index
public CursorBuilder newCursor()
Index
public 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 exclusiveIOException
public Object[] constructIndexRowFromEntry(Object... values)
IllegalArgumentException
- if the wrong number of values are
providedpublic Object[] constructPartialIndexRowFromEntry(Object filler, Object... values)
IllegalArgumentException
- if at least one value is not providedpublic Object[] constructIndexRow(String colName, Object value)
null
if not all
columns for this index were providedpublic 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 providedpublic Object[] constructPartialIndexRow(Object filler, Map<String,?> row)
null
if no prefix
list of columns for this index were providedpublic int compareTo(IndexImpl other)
compareTo
in interface Comparable<IndexImpl>
Copyright © 2005–2024 OpenHMS. All rights reserved.