Class CursorableLinkedList.SubCursor
java.lang.Object
org.apache.commons.collections.list.AbstractLinkedList.LinkedListIterator
org.apache.commons.collections.list.CursorableLinkedList.Cursor
org.apache.commons.collections.list.CursorableLinkedList.SubCursor
- All Implemented Interfaces:
Iterator,ListIterator,OrderedIterator
- Enclosing class:
- CursorableLinkedList
A cursor for the sublist based on LinkedSubListIterator.
- Since:
- Commons Collections 3.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AbstractLinkedList.LinkedSubListThe parent listFields inherited from class org.apache.commons.collections.list.AbstractLinkedList.LinkedListIterator
current, expectedModCount, next, nextIndex, parent -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSubCursor(AbstractLinkedList.LinkedSubList sub, int index) Constructs a new cursor. -
Method Summary
Methods inherited from class org.apache.commons.collections.list.CursorableLinkedList.Cursor
checkModCount, close, nodeChanged, nodeInserted, nodeRemovedMethods inherited from class org.apache.commons.collections.list.AbstractLinkedList.LinkedListIterator
getLastNodeReturned, next, previous, previousIndex, setMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
sub
The parent list
-
-
Constructor Details
-
SubCursor
Constructs a new cursor.- Parameters:
index- the index to start from
-
-
Method Details
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceIterator- Specified by:
hasNextin interfaceListIterator- Overrides:
hasNextin classAbstractLinkedList.LinkedListIterator
-
hasPrevious
public boolean hasPrevious()Description copied from interface:OrderedIteratorChecks to see if there is a previous element that can be iterated to.- Specified by:
hasPreviousin interfaceListIterator- Specified by:
hasPreviousin interfaceOrderedIterator- Overrides:
hasPreviousin classAbstractLinkedList.LinkedListIterator- Returns:
trueif the iterator has a previous element
-
nextIndex
public int nextIndex()Description copied from class:CursorableLinkedList.CursorGets the index of the next element to be returned.- Specified by:
nextIndexin interfaceListIterator- Overrides:
nextIndexin classCursorableLinkedList.Cursor- Returns:
- the next index
-
add
Description copied from class:CursorableLinkedList.CursorAdds an object to the list. The object added here will be the new 'previous' in the iterator.- Specified by:
addin interfaceListIterator- Overrides:
addin classCursorableLinkedList.Cursor- Parameters:
obj- the object to add
-
remove
public void remove()Description copied from class:CursorableLinkedList.CursorRemoves 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:
removein interfaceIterator- Specified by:
removein interfaceListIterator- Overrides:
removein classCursorableLinkedList.Cursor
-