de.upb.hni.vmagic.util
Class ForwardingListIterator<E>

java.lang.Object
  extended by de.upb.hni.vmagic.util.ForwardingListIterator<E>
Type Parameters:
E - the type of the list elements
All Implemented Interfaces:
java.util.Iterator<E>, java.util.ListIterator<E>

public class ForwardingListIterator<E>
extends java.lang.Object
implements java.util.ListIterator<E>

Forwarding implementation of the ListIterator interface.


Constructor Summary
ForwardingListIterator(java.util.ListIterator<E> iterator)
          Creates a forwarding list iterator.
 
Method Summary
 void add(E e)
          Adds an element to the current location.
 boolean hasNext()
          Returns if a next element exists.
 boolean hasPrevious()
          Returns if a previous element exist.
 E next()
          Returns the next element.
 int nextIndex()
          Returns the next index.
 E previous()
          Returns the previous element.
 int previousIndex()
          Returns the previous index.
 void remove()
          Removes the current element.
 void set(E e)
          Sets the current element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForwardingListIterator

public ForwardingListIterator(java.util.ListIterator<E> iterator)
Creates a forwarding list iterator.

Parameters:
iterator - the base iterator
Method Detail

hasNext

public boolean hasNext()
Returns if a next element exists.

Specified by:
hasNext in interface java.util.Iterator<E>
Specified by:
hasNext in interface java.util.ListIterator<E>
Returns:
true, if a next element exists

next

public E next()
Returns the next element.

Specified by:
next in interface java.util.Iterator<E>
Specified by:
next in interface java.util.ListIterator<E>
Returns:
the next element

hasPrevious

public boolean hasPrevious()
Returns if a previous element exist.

Specified by:
hasPrevious in interface java.util.ListIterator<E>
Returns:
true, if a previous element exists

previous

public E previous()
Returns the previous element.

Specified by:
previous in interface java.util.ListIterator<E>
Returns:
the previous element

nextIndex

public int nextIndex()
Returns the next index.

Specified by:
nextIndex in interface java.util.ListIterator<E>
Returns:
the next index

previousIndex

public int previousIndex()
Returns the previous index.

Specified by:
previousIndex in interface java.util.ListIterator<E>
Returns:
the previous index

remove

public void remove()
Removes the current element.

Specified by:
remove in interface java.util.Iterator<E>
Specified by:
remove in interface java.util.ListIterator<E>

set

public void set(E e)
Sets the current element.

Specified by:
set in interface java.util.ListIterator<E>
Parameters:
e - the new value

add

public void add(E e)
Adds an element to the current location.

Specified by:
add in interface java.util.ListIterator<E>
Parameters:
e - the element