public class ObjectLinkedList.ValueIterator extends AbstractIterator<ObjectCursor<KType>>
ObjectLinkedList.iterator()s.
Important: NEVER USE java.util.Iterator methods directly, only use the specialized methods instead !Iterator.hasNext()andIterator.next()are only for enhanced-loop support, using them directly will lead to unpredictable results !
| Modifier and Type | Field and Description |
|---|---|
ObjectCursor<KType> |
cursor |
| Constructor and Description |
|---|
ValueIterator() |
| Modifier and Type | Method and Description |
|---|---|
ObjectLinkedList.ValueIterator |
delete()
Delete the current iterator position, and moves to the next valid
element after this removal, with respect to the forward iteration.
|
protected ObjectCursor<KType> |
fetch()
Fetch next element.
|
KType |
getNext()
Get the next element value with respect to the forward iteration,
without moving the iterator.
|
KType |
getPrevious()
Get the previous element value with respect to the forward iteration,
|
ObjectLinkedList.ValueIterator |
gotoHead()
Reset the iterator to the "head", returning itself for chaining.
|
ObjectLinkedList.ValueIterator |
gotoNext()
Analog to
AbstractIterator.next(), move the iterator to the next element, with respect to the forward iteration,
returning itself for chaining. |
ObjectLinkedList.ValueIterator |
gotoPrevious()
Move the iterator to the previous element, with respect to the forward iteration,
returning itself for chaining.
|
ObjectLinkedList.ValueIterator |
gotoTail()
Reset the iterator to the "tail", returning itself for chaining.
|
boolean |
hasAfter()
Analog to
AbstractIterator.hasNext(), returns true if there is an element after the current position,
with respect to the forward iteration. |
boolean |
hasBefore()
Inverse of
hasAfter(), i.e. returns true if there is an element before the current position,
with respect to the forward iteration. |
void |
insertAfter(KType e1)
Insert e1 after the iterator position, without moving the iterator.
|
void |
insertBefore(KType e1)
Insert e1 before the iterator position, without moving the iterator.
|
KType |
removeNext()
Removes the next element, without moving the iterator.
|
KType |
removePrevious()
Removes the previous element, without moving the iterator.
|
void |
set(KType e1)
Set e1 to the current iterator (position), without moving the iterator.
|
done, hasNext, next, release, removepublic final ObjectCursor<KType> cursor
protected ObjectCursor<KType> fetch()
AbstractIteratorAbstractIterator.done() when all elements have been
fetched.fetch in class AbstractIterator<ObjectCursor<KType>>public boolean hasAfter()
AbstractIterator.hasNext(), returns true if there is an element after the current position,
with respect to the forward iteration. Always false if the list is empty. (i.e no next element)hasBefore()public boolean hasBefore()
hasAfter(), i.e. returns true if there is an element before the current position,
with respect to the forward iteration. Always false if the list is empty. (i.e no previous element)hasAfter()public ObjectLinkedList.ValueIterator gotoHead()
public ObjectLinkedList.ValueIterator gotoTail()
public ObjectLinkedList.ValueIterator gotoNext()
AbstractIterator.next(), move the iterator to the next element, with respect to the forward iteration,
returning itself for chaining.public ObjectLinkedList.ValueIterator gotoPrevious()
public KType getNext()
java.util.NoSuchElementException - if no such element exists.public KType getPrevious()
java.util.NoSuchElementException - if no such element exists.public KType removeNext()
java.util.NoSuchElementException - if no such element exists.
(because there is no element left after)public KType removePrevious()
java.util.NoSuchElementException - if no such element exists.
(because there is no element left before)public void insertBefore(KType e1)
java.lang.IndexOutOfBoundsException - if insertion is impossible, because we are pointing
at head.public void insertAfter(KType e1)
java.lang.IndexOutOfBoundsException - if insertion is impossible, because we are pointing
at tail.public void set(KType e1)
java.lang.IndexOutOfBoundsException - if set is impossible, because we are pointing
either at head or tail.public ObjectLinkedList.ValueIterator delete()
java.lang.IndexOutOfBoundsException - if delete is impossible, because we are pointing
either at head or tail.Copyright © 2017. All rights reserved.