Interface IndexRangeSeek
- All Superinterfaces:
IndexRange
A range of discrete integers, where one can always find the succeeding or preceding index.
It can be navigated to find where indexes are with nextIndex(int), previousIndex(int)
etc.
- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionintnextIndex(int index) Finds the next index in the range afterindex.intpreviousEqualIndex(int index) Finds the previous index in the range beforeindex, or returnsindexitself if it's a valid index.intpreviousIndex(int index) Finds the previous index in the range beforeindex.Methods inherited from interface org.anchoranalysis.core.index.range.IndexRange
getMaximumIndex, getMinimumIndex
-
Method Details
-
nextIndex
int nextIndex(int index) Finds the next index in the range afterindex.- Parameters:
index- the base index, for which a next index is to be found.- Returns:
- the next index after
indexor -1 if none exists.
-
previousIndex
int previousIndex(int index) Finds the previous index in the range beforeindex.- Parameters:
index- the base index, for which a previous index is to be found.- Returns:
- the previous index before
indexor -1 if none exists.
-
previousEqualIndex
int previousEqualIndex(int index) Finds the previous index in the range beforeindex, or returnsindexitself if it's a valid index.- Parameters:
index- the base index, for which a previous (or equal) index is to be found.- Returns:
- {code index} itself it is a valid index, or the previous index before
indexor -1 if none exists.
-