Package io.permazen.index
Interface Index1<V,T>
- Type Parameters:
V
- indexed value typeT
- index target type
- All Superinterfaces:
Index<T>
- All Known Implementing Classes:
CoreIndex1
An index on a single field.
Indexes are read-only and "live", always reflecting the current transaction state.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionasMap()
View this index as aNavigableMap
of target values keyed by indexed value.NavigableSet<Tuple2<V,
T>> asSet()
View this index as aNavigableSet
of tuples.default int
Get the number of fields in this index.withTargetBounds
(Bounds<T> bounds) ImposeBounds
that restrict the range of the target value.withValueBounds
(Bounds<V> bounds) ImposeBounds
that restrict the range of the indexed value.
-
Method Details
-
numberOfFields
default int numberOfFields()Description copied from interface:Index
Get the number of fields in this index.- Specified by:
numberOfFields
in interfaceIndex<V>
- Returns:
- the number of indexed fields
-
asSet
NavigableSet<Tuple2<V,T>> asSet()View this index as aNavigableSet
of tuples.- Specified by:
asSet
in interfaceIndex<V>
- Returns:
NavigableSet
of tuples containing indexed value and target value
-
asMap
NavigableMap<V,NavigableSet<T>> asMap()View this index as aNavigableMap
of target values keyed by indexed value.- Specified by:
asMap
in interfaceIndex<V>
- Returns:
NavigableMap
from indexed value to the corresponding set of target objects
-
withValueBounds
ImposeBounds
that restrict the range of the indexed value.- Parameters:
bounds
- bounds to impose on the indexed value- Returns:
- a view of this index in which only values within
bounds
are visible
-
withTargetBounds
ImposeBounds
that restrict the range of the target value.- Parameters:
bounds
- bounds to impose on the target value- Returns:
- a view of this index in which only target values within
bounds
are visible
-