Class CoreIndex1<V,T>

java.lang.Object
io.permazen.core.AbstractCoreIndex<T>
io.permazen.core.CoreIndex1<V,T>
Type Parameters:
V - index value type
T - index target type
All Implemented Interfaces:
Index<T>, Index1<V,T>

public class CoreIndex1<V,T> extends AbstractCoreIndex<T> implements Index1<V,T>
Core API Index1 implementation representing an index on a single field.

Instances are immutable.

  • Method Details

    • filter

      public CoreIndex1<V,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<Tuple2<V,T>> asSet()
      Description copied from interface: Index1
      View this index as a NavigableSet of tuples.
      Specified by:
      asSet in interface Index<V>
      Specified by:
      asSet in interface Index1<V,T>
      Returns:
      NavigableSet of tuples containing indexed value and target value
    • asMap

      public NavigableMap<V,NavigableSet<T>> asMap()
      Description copied from interface: Index1
      View this index as a NavigableMap of target values keyed by indexed value.
      Specified by:
      asMap in interface Index<V>
      Specified by:
      asMap in interface Index1<V,T>
      Returns:
      NavigableMap from indexed value to the corresponding set of target objects
    • withValueBounds

      public CoreIndex1<V,T> withValueBounds(Bounds<V> bounds)
      Description copied from interface: Index1
      Impose Bounds that restrict the range of the indexed value.
      Specified by:
      withValueBounds in interface Index1<V,T>
      Parameters:
      bounds - bounds to impose on the indexed value
      Returns:
      a view of this index in which only values within bounds are visible
    • withTargetBounds

      public CoreIndex1<V,T> withTargetBounds(Bounds<T> bounds)
      Description copied from interface: Index1
      Impose Bounds that restrict the range of the target value.
      Specified by:
      withTargetBounds in interface Index1<V,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