-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nextCircularListIndex to KiwiLists (#1240)
This method handles the simple calculation of getting the next index of a circular list (or array), wrapping around to the beginning when at the end. It also provides input validation on the list size and index. I am adding this because, rather unbelievably, I was not able to find something like it in any "standard" utility libraries (Google Guava, Apache Commons Lang or Collections), etc. Maybe one exists, but I could not find it. The closest I found was the CircularFifoQueue in Apache Commons Collections.
- Loading branch information
1 parent
d1a2871
commit 61c043a
Showing
2 changed files
with
121 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters