net.ranides.assira.collection
Class SingleIterator<T>
java.lang.Object
net.ranides.assira.collection.SingleIterator<T>
- Type Parameters:
T -
- All Implemented Interfaces:
- Iterator<T>, ListIterator<T>
public class SingleIterator<T>
- extends Object
- implements ListIterator<T>
Implementacja iteratora, który umożliwia przeglądanie 1-elementowego zbioru.
- Author:
- ranides
|
Constructor Summary |
SingleIterator(T value)
Tworzy iterator pozwalającej przeglądać 1-elementowy zbiór zawierający
podaną wartość. |
SingleIterator
public SingleIterator(T value)
- Tworzy iterator pozwalającej przeglądać 1-elementowy zbiór zawierający
podaną wartość.
- Parameters:
value -
inverse
public SingleIterator<T> inverse()
- ListIterator umożliwia dwukierunkowe przeglądanie zbioru.
Metoda
inverse przesuwa "bieżącą pozycję" na drugi koniec zbioru.
- Returns:
hasNext
public boolean hasNext()
- Specified by:
hasNext in interface Iterator<T>- Specified by:
hasNext in interface ListIterator<T>
next
public T next()
- Specified by:
next in interface Iterator<T>- Specified by:
next in interface ListIterator<T>
hasPrevious
public boolean hasPrevious()
- Specified by:
hasPrevious in interface ListIterator<T>
previous
public T previous()
- Specified by:
previous in interface ListIterator<T>
nextIndex
public int nextIndex()
- Specified by:
nextIndex in interface ListIterator<T>
previousIndex
public int previousIndex()
- Specified by:
previousIndex in interface ListIterator<T>
add
public void add(T value)
- Specified by:
add in interface ListIterator<T>
remove
public void remove()
- Specified by:
remove in interface Iterator<T>- Specified by:
remove in interface ListIterator<T>
set
public void set(T value)
- Specified by:
set in interface ListIterator<T>
Copyright © 2013. All Rights Reserved.