Package com.landawn.abacus.util
Class BiIterator<A,B>
java.lang.Object
com.landawn.abacus.util.BiIterator<A,B>
- Type Parameters:
A
-B
-
- Since:
- 1.2.10
- Author:
- Haiyang Li
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <A,
B> BiIterator<A, B> empty()
BiIterator<A,
B> filter
(BiPredicate<? super A, ? super B> predicate) u.Optional<Pair<A,
B>> first()
abstract <E extends Exception>
voidforEachRemaining
(Throwables.BiConsumer<? super A, ? super B, E> action) For each remaining.void
forEachRemaining
(Consumer<? super Pair<A, B>> action) Deprecated.static <A,
B> BiIterator<A, B> generate
(int fromIndex, int toIndex, IndexedConsumer<Pair<A, B>> output) static <A,
B> BiIterator<A, B> generate
(BooleanSupplier hasNext, Consumer<Pair<A, B>> output) static <A,
B> BiIterator<A, B> Returns an infiniteBiIterator
.u.Optional<Pair<A,
B>> last()
BiIterator<A,
B> limit
(long count) abstract <R> ObjIterator<R>
map
(BiFunction<? super A, ? super B, ? extends R> mapper) static <K,
V> BiIterator<K, V> static <K,
V> BiIterator<K, V> void
remove()
Deprecated.- UnsupportedOperationExceptionBiIterator<A,
B> skip
(long n) <R> Stream<R>
stream
(BiFunction<? super A, ? super B, ? extends R> mapper) toArray()
<T> T[]
toArray
(T[] a) Deprecated.<C extends Collection<T>>
CtoCollection
(Supplier<? extends C> supplier) ImmutableList<Pair<A,
B>> ImmutableSet<Pair<A,
B>> toList()
toSet()
static <T,
A, B> BiIterator<A, B> unzip
(Iterable<? extends T> iter, BiConsumer<? super T, Pair<A, B>> unzipFunc) static <T,
A, B> BiIterator<A, B> unzip
(Iterator<? extends T> iter, BiConsumer<? super T, Pair<A, B>> unzipFunc) static <A,
B> BiIterator<A, B> zip
(A[] a, B[] b) static <A,
B> BiIterator<A, B> zip
(A[] a, B[] b, A valueForNoneA, B valueForNoneB) static <A,
B> BiIterator<A, B> static <A,
B> BiIterator<A, B> static <A,
B> BiIterator<A, B> static <A,
B> BiIterator<A, B>
-
Constructor Details
-
BiIterator
public BiIterator()
-
-
Method Details
-
empty
- Type Parameters:
A
-B
-- Returns:
-
of
- Type Parameters:
K
- the key typeV
- the value type- Parameters:
map
-- Returns:
-
of
- Type Parameters:
K
- the key typeV
- the value type- Parameters:
iter
-- Returns:
-
generate
Returns an infiniteBiIterator
.- Type Parameters:
A
-B
-- Parameters:
output
- transfer the next values.- Returns:
-
generate
- Type Parameters:
A
-B
-- Parameters:
hasNext
-output
-- Returns:
-
generate
public static <A,B> BiIterator<A,B> generate(int fromIndex, int toIndex, IndexedConsumer<Pair<A, B>> output) - Type Parameters:
A
-B
-- Parameters:
fromIndex
-toIndex
-output
-- Returns:
-
zip
- Type Parameters:
A
-B
-- Parameters:
a
-b
-- Returns:
-
zip
- Type Parameters:
A
-B
-- Parameters:
a
-b
-valueForNoneA
-valueForNoneB
-- Returns:
-
zip
- Type Parameters:
A
-B
-- Parameters:
a
-b
-- Returns:
-
zip
public static <A,B> BiIterator<A,B> zip(Iterable<A> a, Iterable<B> b, A valueForNoneA, B valueForNoneB) - Type Parameters:
A
-B
-- Parameters:
a
-b
-valueForNoneA
-valueForNoneB
-- Returns:
-
zip
- Type Parameters:
A
-B
-- Parameters:
iterA
-iterB
-- Returns:
-
zip
public static <A,B> BiIterator<A,B> zip(Iterator<A> iterA, Iterator<B> iterB, A valueForNoneA, B valueForNoneB) - Type Parameters:
A
-B
-- Parameters:
iterA
-iterB
-valueForNoneA
-valueForNoneB
-- Returns:
-
unzip
public static <T,A, BiIterator<A,B> B> unzip(Iterable<? extends T> iter, BiConsumer<? super T, Pair<A, B>> unzipFunc) - Type Parameters:
T
-A
-B
-- Parameters:
iter
-unzipFunc
- output parameter.- Returns:
-
unzip
public static <T,A, BiIterator<A,B> B> unzip(Iterator<? extends T> iter, BiConsumer<? super T, Pair<A, B>> unzipFunc) - Type Parameters:
T
-A
-B
-- Parameters:
iter
-unzipFunc
- output parameter.- Returns:
-
forEachRemaining
public abstract <E extends Exception> void forEachRemaining(Throwables.BiConsumer<? super A, ? super B, throws EE> action) For each remaining.- Type Parameters:
E
-- Parameters:
action
-- Throws:
E
- the e
-
forEachRemaining
Deprecated.It's preferred to callforEachRemaining(Try.BiConsumer)
to avoid the create the unnecessaryPair
Objects.- Parameters:
action
-
-
skip
- Parameters:
n
-- Returns:
-
limit
- Parameters:
count
-- Returns:
-
filter
- Parameters:
predicate
-- Returns:
-
map
- Type Parameters:
R
-- Parameters:
mapper
-- Returns:
-
first
- Returns:
-
last
- Returns:
-
stream
- Type Parameters:
R
-- Parameters:
mapper
-- Returns:
-
toArray
- Returns:
-
toArray
Deprecated.- Type Parameters:
T
-- Parameters:
a
-- Returns:
-
toList
- Returns:
-
remove
Deprecated.- UnsupportedOperationException- Specified by:
remove
in interfaceIterator<T>
- Throws:
UnsupportedOperationException
-
toSet
- Returns:
-
toCollection
- Type Parameters:
C
-- Parameters:
supplier
-- Returns:
-
toImmutableList
- Returns:
-
toImmutableSet
- Returns:
-