Package io.permazen.index
Interface Index2<V1,V2,T>
- Type Parameters:
V1
- first indexed value typeV2
- second indexed value typeT
- index target type
- All Superinterfaces:
Index<T>
- All Known Implementing Classes:
CoreIndex2
An index on two fields.
Indexes are read-only and "live", always reflecting the current transaction state.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionasIndex1()
Get the prefix of this instance that only includes the first two indexed fields.asMap()
View this index as aNavigableMap
of target values keyed by indexed value tuples.NavigableMap<V1,
Index1<V2, T>> View this index as aNavigableMap
ofIndex1
s keyed by the first value.NavigableSet<Tuple3<V1,
V2, 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.withValue1Bounds
(Bounds<V1> bounds) ImposeBounds
that restrict the range of the first indexed value.withValue2Bounds
(Bounds<V2> bounds) ImposeBounds
that restrict the range of the second 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<V1>
- Returns:
- the number of indexed fields
-
asSet
NavigableSet<Tuple3<V1,V2, asSet()T>> View this index as aNavigableSet
of tuples.- Specified by:
asSet
in interfaceIndex<V1>
- Returns:
NavigableSet
of tuples containing indexed values and target value
-
asMap
NavigableMap<Tuple2<V1,V2>, asMap()NavigableSet<T>> View this index as aNavigableMap
of target values keyed by indexed value tuples.- Specified by:
asMap
in interfaceIndex<V1>
- Returns:
NavigableMap
from indexed value tuple to the corresponding set of target objects
-
asMapOfIndex1
NavigableMap<V1,Index1<V2, asMapOfIndex1()T>> View this index as aNavigableMap
ofIndex1
s keyed by the first value.- Returns:
NavigableMap
from first value toIndex1
-
asIndex1
Get the prefix of this instance that only includes the first two indexed fields.- Returns:
- prefix of this index
-
withValue1Bounds
ImposeBounds
that restrict the range of the first indexed value.- Parameters:
bounds
- bounds to impose on the first indexed value- Returns:
- a view of this index in which only first values within
bounds
are visible
-
withValue2Bounds
ImposeBounds
that restrict the range of the second indexed value.- Parameters:
bounds
- bounds to impose on the second indexed value- Returns:
- a view of this index in which only second 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
-