@API(value=MAINTAINED) public class IndexEntry extends Object
IndexEntry
carries around the key and value read from an index (as the name would imply).
Further, if the key and value were produced by applying an index key expression to a record, this will carry
around additional information about the nulls contained in the expression.Constructor and Description |
---|
IndexEntry(Index index,
Key.Evaluated key) |
IndexEntry(Index index,
Key.Evaluated key,
Key.Evaluated value) |
IndexEntry(Index index,
Tuple key,
Tuple value) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Index |
getIndex()
Get the index associated with this entry.
|
Tuple |
getKey()
Get the key portion of the index entry.
|
Key.Evaluated.NullStandin |
getKeyNullType(int idx)
Get the type of null stored in a given key index location.
|
int |
getKeySize() |
Object |
getKeyValue(int idx)
Get a tuple element of the key tuple.
|
Tuple |
getPrimaryKey()
Get the primary key of the record associated with this entry.
|
Tuple |
getValue()
Get the value portion of the index entry.
|
int |
hashCode() |
boolean |
keyContainsNonUniqueNull()
Returns true if the key expression contains a NULL value that is not a
Key.Evaluated.NullStandin.NULL_UNIQUE value. |
IndexEntry |
subKey(int startIdx,
int endIdx)
Produces a new
IndexEntry whose key is a subset of this IndexEntry . |
String |
toString() |
void |
validateInIndex(Index index)
Validate that this entry is associated with the given index.
|
@API(value=INTERNAL) public IndexEntry(@Nonnull Index index, @Nonnull Key.Evaluated key, @Nonnull Key.Evaluated value)
@Nonnull public Index getIndex()
@Nonnull public Tuple getKey()
getPrimaryKey()
@Nonnull public Tuple getValue()
public int getKeySize()
@Nonnull public Tuple getPrimaryKey()
@Nullable public Object getKeyValue(int idx)
idx
- the index of the desired elementidx
@API(value=INTERNAL) public void validateInIndex(@Nonnull Index index)
index
- the index this entry should be a member ofpublic boolean keyContainsNonUniqueNull()
Key.Evaluated.NullStandin.NULL_UNIQUE
value.
Calling this method on a IndexEntry
that was created directly from tuples will result in an
exception.true
if the key contains a non-unique null value@Nonnull public Key.Evaluated.NullStandin getKeyNullType(int idx)
IndexEntry
that was created directly from tuples, or if the value at idx
is not null, will result in an exception.idx
- the index of a null elementidx
@Nonnull public IndexEntry subKey(int startIdx, int endIdx)
IndexEntry
whose key is a subset of this IndexEntry
.startIdx
- the starting offset of the key to use for the new valueendIdx
- the ending offset (exclusive) of the key to use for the new valuestartIdx
and endIdx