Package com.landawn.abacus.util
Class ObjIterator<T>
java.lang.Object
com.landawn.abacus.util.ObjIterator<T>
- Type Parameters:
T
-
- Direct Known Subclasses:
LineIterator
,ObjIteratorEx
- Since:
- 0.9
- Author:
- Haiyang Li
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ObjIterator<T>
Lazy evaluation.static <T> ObjIterator<T>
empty()
<E extends Exception>
voidforeachIndexed
(Throwables.IndexedConsumer<? super T, E> action) <E extends Exception>
voidforeachRemaining
(Throwables.Consumer<? super T, E> action) static <T> ObjIterator<T>
Lazy evaluation.static <T> ObjIterator<T>
generate
(BooleanSupplier hasNext, Supplier<? extends T> supplier) static <T> ObjIterator<T>
Returns an infiniteObjIterator
.indexed()
indexed
(long startIndex) static <T> ObjIterator<T>
just
(T val) <U> ObjIterator<U>
static <T> ObjIterator<T>
static <T> ObjIterator<T>
of
(Collection<? extends T> iterable) static <T> ObjIterator<T>
static <T> ObjIterator<T>
of
(T... a) static <T> ObjIterator<T>
of
(T[] a, int fromIndex, int toIndex) void
remove()
Deprecated.- UnsupportedOperationExceptionstream()
Object[]
toArray()
<A> A[]
toArray
(A[] a) <C extends Collection<T>>
CtoCollection
(Supplier<? extends C> supplier) toList()
toSet()
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next
-
Constructor Details
-
ObjIterator
public ObjIterator()
-
-
Method Details
-
empty
- Type Parameters:
T
-- Returns:
-
just
- Type Parameters:
T
-- Parameters:
val
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
a
-fromIndex
-toIndex
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
iter
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
iterable
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
iterable
-- Returns:
-
from
Lazy evaluation.- Type Parameters:
T
-- Parameters:
arraySupplier
-- Returns:
-
defer
Lazy evaluation.- Type Parameters:
T
-- Parameters:
iteratorSupplier
-- Returns:
-
generate
Returns an infiniteObjIterator
.- Type Parameters:
T
-- Parameters:
supplier
-- Returns:
-
generate
- Type Parameters:
T
-- Parameters:
hasNext
-supplier
-- Returns:
-
toArray
-
toArray
public <A> A[] toArray(A[] a) -
toList
-
filter
-
map
-
stream
-
indexed
-
indexed
-
foreachRemaining
public <E extends Exception> void foreachRemaining(Throwables.Consumer<? super T, E> action) throws E- Type Parameters:
E
-- Parameters:
action
-- Throws:
E
- the e
-
foreachIndexed
public <E extends Exception> void foreachIndexed(Throwables.IndexedConsumer<? super T, E> action) throws E- Type Parameters:
E
-- Parameters:
action
-- Throws:
E
- the e
-
remove
Deprecated.- UnsupportedOperationException- Specified by:
remove
in interfaceIterator<T>
- Throws:
UnsupportedOperationException
-
toSet
-
toCollection
- Type Parameters:
C
-- Parameters:
supplier
-- Returns:
-
toImmutableList
-
toImmutableSet
-