@Override public T next() { if (next == null) { throw new NoSuchElementException(); } current = next; index++; next = enumerator.nextObject(); return current; }
@Callback @BindSelector("allObjects") public static NSArray allObjects(NSEnumerator __self__, Selector __cmd__) { return __self__.allObjects(); }
Iterator(NSEnumerator<T> enumerator) { this.enumerator = enumerator; index = -1; current = null; next = enumerator.nextObject(); }
@Callback @BindSelector("nextObject") public static NSObject _nextObject(NSEnumerator __self__, Selector __cmd__) { return __self__._nextObject(); }