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 TypeMethodDescriptionint
nextIndex
(int index) Finds the next index in the range afterindex
.int
previousEqualIndex
(int index) Finds the previous index in the range beforeindex
, or returnsindex
itself if it's a valid index.int
previousIndex
(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
index
or -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
index
or -1 if none exists.
-
previousEqualIndex
int previousEqualIndex(int index) Finds the previous index in the range beforeindex
, or returnsindex
itself 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
index
or -1 if none exists.
-