I don't use that library, but it looks like what you are looking for is modulo: http://processing.org/reference/modulo.html
Use it like this:
- int index = 0;
- // A sample list in alphabetic order to show modulo working below
- String[] example = {
- "Apple", "Banana", "Cranberry", "Durian", "Entawak"
- };
- void setup() {
- size(100, 100);
- }
- void draw() {
- int loopedIndex = (index % example.length);
- println(index+", "+example[loopedIndex]);
- index++;
- }