diff options
Diffstat (limited to 'src/main/java/gregtech/api/objects')
| -rw-r--r-- | src/main/java/gregtech/api/objects/iterators/ArrayIterator.java | 24 | ||||
| -rw-r--r-- | src/main/java/gregtech/api/objects/iterators/NonNullIterator.java | 36 |
2 files changed, 0 insertions, 60 deletions
diff --git a/src/main/java/gregtech/api/objects/iterators/ArrayIterator.java b/src/main/java/gregtech/api/objects/iterators/ArrayIterator.java deleted file mode 100644 index 267a132ad5..0000000000 --- a/src/main/java/gregtech/api/objects/iterators/ArrayIterator.java +++ /dev/null @@ -1,24 +0,0 @@ -package gregtech.api.objects.iterators; - -import java.util.Iterator; - -public class ArrayIterator<T> implements Iterator<T> { - private final T[] arr; - private int offset; - - public ArrayIterator(T[] arr) { - this.arr = arr; - } - - @Override - public boolean hasNext() { - return offset != arr.length; - } - - @Override - public T next() { - T out = arr[offset]; - offset++; - return out; - } -} diff --git a/src/main/java/gregtech/api/objects/iterators/NonNullIterator.java b/src/main/java/gregtech/api/objects/iterators/NonNullIterator.java deleted file mode 100644 index 22dd33ba2b..0000000000 --- a/src/main/java/gregtech/api/objects/iterators/NonNullIterator.java +++ /dev/null @@ -1,36 +0,0 @@ -package gregtech.api.objects.iterators; - -import java.util.Iterator; - -public class NonNullIterator<T> implements Iterator<T> { - private final Iterator<T> internal; - private T last = null; - - public NonNullIterator(Iterator<T> in) { - this.internal = in; - } - - @Override - public boolean hasNext() { - while (last == null) { - if (internal.hasNext()) { - last = internal.next(); - } else { - return false; - } - } - - return true; - } - - @Override - public T next() { - while (last == null) { - last = internal.next(); - } - - T temp = last; - last = null; - return temp; - } -} |
