| 246 | |
| 247 | |
| 248 | int Set::getNth(const uint8_t n) |
| 249 | { |
| 250 | if (n == 0) return -1; |
| 251 | if (n == 1) return first(); |
| 252 | _current = first(); |
| 253 | int i = 1; |
| 254 | while ((_current > -1) && (i < n)) |
| 255 | { |
| 256 | _current = next(); |
| 257 | i++; |
| 258 | } |
| 259 | return _current; |
| 260 | } |
| 261 | |
| 262 | |
| 263 | int Set::findPrev(const uint8_t p, uint8_t q) |