SkipIterator.java
1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.granite.security.user.util;
import java.util.Iterator;
public class SkipIterator<T>
implements Iterator<T> {
private final Iterator<T> iterator;
private int pos;
public static <T> SkipIterator<T> create(Iterator<T> iterator) {
return new SkipIterator<T>(iterator);
}
public SkipIterator(Iterator<T> iterator) {
this.iterator = iterator;
}
public long skip(long skipNum) {
long c = 0;
while (c < skipNum && this.iterator.hasNext()) {
this.iterator.next();
++c;
++this.pos;
}
return c;
}
public long getPosition() {
return this.pos;
}
@Override
public boolean hasNext() {
return this.iterator.hasNext();
}
@Override
public T next() {
++this.pos;
return this.iterator.next();
}
@Override
public void remove() {
this.iterator.remove();
}
}