Interface Structure1D.IndexMapper<T>

All Known Subinterfaces:
CalendarDate.Resolution
All Known Implementing Classes:
CalendarDateDuration, CalendarDateUnit, Structure1D.BasicMapper, Structure2D.RowColumnMapper, StructureAnyD.ReferenceMapper
Enclosing interface:
Structure1D

public static interface Structure1D.IndexMapper<T>
  • Method Summary

    Modifier and Type
    Method
    Description
    default T
    next(T key)
    This default implementation assumes that the index is incremented by 1 when incrementing the key to the next value.
    default T
    previous(T key)
    This default implementation assumes that the index is decremented by 1 when decrementing the key to the previous value.
    long
    toIndex(T key)
    For each key (any instance of that type) there is a corresponding index value – 1 or more key instances will be mapped to each index value.
    toKey(long index)
    In most cases it should be safe to assume that the input index value is valid (matching what would be created by toIndex(Object)).
  • Method Details

    • next

      default T next(T key)
      This default implementation assumes that the index is incremented by 1 when incrementing the key to the next value.
      Parameters:
      key - The value to increment
      Returns:
      The next (incremented) value
    • previous

      default T previous(T key)
      This default implementation assumes that the index is decremented by 1 when decrementing the key to the previous value.
      Parameters:
      key - The value to decrement
      Returns:
      The previous (decremented) value
    • toIndex

      long toIndex(T key)
      For each key (any instance of that type) there is a corresponding index value – 1 or more key instances will be mapped to each index value.
    • toKey

      T toKey(long index)
      In most cases it should be safe to assume that the input index value is valid (matching what would be created by toIndex(Object)).