Package org.ojalgo.structure
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 TypeMethodDescriptiondefault T
This default implementation assumes that the index is incremented by 1 when incrementing the key to the next value.default T
This default implementation assumes that the index is decremented by 1 when decrementing the key to the previous value.long
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 bytoIndex(Object)
).
-
Method Details
-
next
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
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
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
In most cases it should be safe to assume that the input index value is valid (matching what would be created bytoIndex(Object)
).
-