Class CoreIndex2<V1,V2,T>

java.lang.Object
io.permazen.core.AbstractCoreIndex<T>
io.permazen.core.CoreIndex2<V1,V2,T>
Type Parameters:
V1 - first index value type
V2 - second index value type
T - index target type
All Implemented Interfaces:
Index<T>, Index2<V1,V2,T>

public class CoreIndex2<V1,V2,T> extends AbstractCoreIndex<T> implements Index2<V1,V2,T>
Core API Index2 implementation representing a composite index on two fields.

Instances are immutable.

  • Method Details

    • filter

      public CoreIndex2<V1,V2,T> filter(int index, KeyFilter filter)
      Description copied from class: AbstractCoreIndex
      Apply key filtering to field values at the specified index. This method works cummulatively: the new instance filters to the intersection of the given key filter and any existing key filter on that field.
      Specified by:
      filter in class AbstractCoreIndex<T>
      Parameters:
      index - zero-based object type field offset
      filter - key filtering to apply
      Returns:
      filtered view of this instance
    • asSet

      public NavigableSet<Tuple3<V1,V2,T>> asSet()
      Description copied from interface: Index2
      View this index as a NavigableSet of tuples.
      Specified by:
      asSet in interface Index<V1>
      Specified by:
      asSet in interface Index2<V1,V2,T>
      Returns:
      NavigableSet of tuples containing indexed values and target value
    • asMap

      public NavigableMap<Tuple2<V1,V2>,NavigableSet<T>> asMap()
      Description copied from interface: Index2
      View this index as a NavigableMap of target values keyed by indexed value tuples.
      Specified by:
      asMap in interface Index<V1>
      Specified by:
      asMap in interface Index2<V1,V2,T>
      Returns:
      NavigableMap from indexed value tuple to the corresponding set of target objects
    • asMapOfIndex1

      public NavigableMap<V1,Index1<V2,T>> asMapOfIndex1()
      Description copied from interface: Index2
      View this index as a NavigableMap of Index1s keyed by the first value.
      Specified by:
      asMapOfIndex1 in interface Index2<V1,V2,T>
      Returns:
      NavigableMap from first value to Index1
    • asIndex1

      public CoreIndex1<V1,V2> asIndex1()
      Description copied from interface: Index2
      Get the prefix of this instance that only includes the first two indexed fields.
      Specified by:
      asIndex1 in interface Index2<V1,V2,T>
      Returns:
      prefix of this index
    • withValue1Bounds

      public CoreIndex2<V1,V2,T> withValue1Bounds(Bounds<V1> bounds)
      Description copied from interface: Index2
      Impose Bounds that restrict the range of the first indexed value.
      Specified by:
      withValue1Bounds in interface Index2<V1,V2,T>
      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

      public CoreIndex2<V1,V2,T> withValue2Bounds(Bounds<V2> bounds)
      Description copied from interface: Index2
      Impose Bounds that restrict the range of the second indexed value.
      Specified by:
      withValue2Bounds in interface Index2<V1,V2,T>
      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

      public CoreIndex2<V1,V2,T> withTargetBounds(Bounds<T> bounds)
      Description copied from interface: Index2
      Impose Bounds that restrict the range of the target value.
      Specified by:
      withTargetBounds in interface Index2<V1,V2,T>
      Parameters:
      bounds - bounds to impose on the target value
      Returns:
      a view of this index in which only target values within bounds are visible