Package org.cactoos.list
Class JoinedListIterator<T>
- java.lang.Object
-
- org.cactoos.list.JoinedListIterator<T>
-
- Type Parameters:
T
- Items type
- All Implemented Interfaces:
Iterator<T>
,ListIterator<T>
public final class JoinedListIterator<T> extends Object implements ListIterator<T>
A fewListIterator
joined together.There is no thread-safety guarantee.
- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description JoinedListIterator(List<? extends ListIterator<? extends T>> items)
Ctor.JoinedListIterator(ListIterator<? extends T>... items)
Ctor.JoinedListIterator(ListIterator<? extends T> items, T item)
Ctor.JoinedListIterator(T item, ListIterator<? extends T> items)
Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(T elt)
boolean
hasNext()
boolean
hasPrevious()
T
next()
int
nextIndex()
T
previous()
int
previousIndex()
void
remove()
void
set(T elt)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
JoinedListIterator
@SafeVarargs public JoinedListIterator(ListIterator<? extends T>... items)
Ctor.- Parameters:
items
- Items to concatenate
-
JoinedListIterator
public JoinedListIterator(T item, ListIterator<? extends T> items)
Ctor.- Parameters:
item
- First itemitems
- ListIterator
-
JoinedListIterator
public JoinedListIterator(ListIterator<? extends T> items, T item)
Ctor.- Parameters:
items
- ListIteratorsitem
- End item
-
JoinedListIterator
public JoinedListIterator(List<? extends ListIterator<? extends T>> items)
Ctor.- Parameters:
items
- Items to concatenate
-
-
Method Detail
-
hasNext
public boolean hasNext()
-
next
public T next()
-
hasPrevious
public boolean hasPrevious()
- Specified by:
hasPrevious
in interfaceListIterator<T>
-
previous
public T previous()
- Specified by:
previous
in interfaceListIterator<T>
-
nextIndex
public int nextIndex()
- Specified by:
nextIndex
in interfaceListIterator<T>
-
previousIndex
public int previousIndex()
- Specified by:
previousIndex
in interfaceListIterator<T>
-
remove
public void remove()
-
set
public void set(T elt)
- Specified by:
set
in interfaceListIterator<T>
-
add
public void add(T elt)
- Specified by:
add
in interfaceListIterator<T>
-
-