T
- the type that this is an index forV
- the type of the value used for indexing@ThreadSafe public abstract class IndexDefinition<T,V> extends Object
IndexedSet
.
For example, if an indexed set stores inodes, and we want to be able to look them up by their
"id" field, we would define an index like so:
public class IndexDefinition() {
Constructor and Description |
---|
IndexDefinition(boolean isUnique)
Constructs a new
IndexDefinition instance. |
Modifier and Type | Method and Description |
---|---|
abstract V |
getFieldValue(T o)
Gets the value of the field that serves as index.
|
boolean |
isUnique() |
public IndexDefinition(boolean isUnique)
IndexDefinition
instance.isUnique
- whether the index is unique. A unique index is an index where each index value
only maps to one object; A non-unique index is an index where an index value
can map to one or more objects.Copyright © 2023. All Rights Reserved.