OLD | NEW |
1 part of swarmlib; | |
2 | |
3 /** | 1 /** |
4 * An iterator that allows the user to move forward and backward though | 2 * An iterator that allows the user to move forward and backward though |
5 * a set of items. (Bi-directional) | 3 * a set of items. (Bi-directional) |
6 */ | 4 */ |
7 class BiIterator<E> { | 5 class BiIterator<E> { |
8 | 6 |
9 /** | 7 /** |
10 * Provides forward and backward iterator functionality to keep track | 8 * Provides forward and backward iterator functionality to keep track |
11 * which item is currently selected. | 9 * which item is currently selected. |
12 */ | 10 */ |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 */ | 58 */ |
61 void jumpToValue(E val) { | 59 void jumpToValue(E val) { |
62 for (int i = 0; i < list.length; i++) { | 60 for (int i = 0; i < list.length; i++) { |
63 if (list[i] === val) { | 61 if (list[i] === val) { |
64 currentIndex.value = i; | 62 currentIndex.value = i; |
65 break; | 63 break; |
66 } | 64 } |
67 } | 65 } |
68 } | 66 } |
69 } | 67 } |
OLD | NEW |