Class CursorableLinkedList.SubCursor<E>
java.lang.Object
org.apache.commons.collections4.list.AbstractLinkedList.LinkedListIterator<E>
org.apache.commons.collections4.list.CursorableLinkedList.Cursor<E>
org.apache.commons.collections4.list.CursorableLinkedList.SubCursor<E>
- Type Parameters:
E
- the type of elements in this cursor.
- All Implemented Interfaces:
Iterator<E>
,ListIterator<E>
,OrderedIterator<E>
- Enclosing class:
- CursorableLinkedList<E>
A cursor for the sublist based on LinkedSubListIterator.
- Since:
- 3.2
-
Field Summary
Modifier and TypeFieldDescriptionprotected final AbstractLinkedList.LinkedSubList<E>
The parent listFields inherited from class org.apache.commons.collections4.list.AbstractLinkedList.LinkedListIterator
current, expectedModCount, next, nextIndex, parent
-
Constructor Summary
ModifierConstructorDescriptionprotected
SubCursor
(AbstractLinkedList.LinkedSubList<E> sub, int index) Constructs a new cursor. -
Method Summary
Methods inherited from class org.apache.commons.collections4.list.CursorableLinkedList.Cursor
checkModCount, close, nodeChanged, nodeInserted, nodeRemoved
Methods inherited from class org.apache.commons.collections4.list.AbstractLinkedList.LinkedListIterator
getLastNodeReturned, next, previous, previousIndex, set
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
-
Field Details
-
sub
The parent list
-
-
Constructor Details
-
SubCursor
Constructs a new cursor.- Parameters:
sub
- the sub listindex
- the index to start from
-
-
Method Details
-
add
Description copied from class:CursorableLinkedList.Cursor
Adds an object to the list. The object added here will be the new 'previous' in the iterator.- Specified by:
add
in interfaceListIterator<E>
- Overrides:
add
in classCursorableLinkedList.Cursor<E>
- Parameters:
obj
- the object to add
-
hasNext
- Specified by:
hasNext
in interfaceIterator<E>
- Specified by:
hasNext
in interfaceListIterator<E>
- Overrides:
hasNext
in classAbstractLinkedList.LinkedListIterator<E>
-
hasPrevious
Description copied from interface:OrderedIterator
Checks to see if there is a previous element that can be iterated to.- Specified by:
hasPrevious
in interfaceListIterator<E>
- Specified by:
hasPrevious
in interfaceOrderedIterator<E>
- Overrides:
hasPrevious
in classAbstractLinkedList.LinkedListIterator<E>
- Returns:
true
if the iterator has a previous element
-
nextIndex
Description copied from class:CursorableLinkedList.Cursor
Gets the index of the next element to be returned.- Specified by:
nextIndex
in interfaceListIterator<E>
- Overrides:
nextIndex
in classCursorableLinkedList.Cursor<E>
- Returns:
- the next index
-
remove
Description copied from class:CursorableLinkedList.Cursor
Removes the item last returned by this iterator.There may have been subsequent alterations to the list since you obtained this item, however you can still remove it. You can even remove it if the item is no longer in the main list. However, you can't call this method on the same iterator more than once without calling next() or previous().
- Specified by:
remove
in interfaceIterator<E>
- Specified by:
remove
in interfaceListIterator<E>
- Overrides:
remove
in classCursorableLinkedList.Cursor<E>
-