org.norther.tammi.acorn.util
Class UnmodifiableListIterator

java.lang.Object
  extended by org.norther.tammi.acorn.util.UnmodifiableIterator
      extended by org.norther.tammi.acorn.util.UnmodifiableListIterator
All Implemented Interfaces:
Enumeration, Iterator, ListIterator

public class UnmodifiableListIterator
extends UnmodifiableIterator
implements ListIterator

An unmodifiable list iterator wrapper filtering out additions and removals.

Author:
Ilkka Priha

Constructor Summary
UnmodifiableListIterator()
          Constructs an empty iterator.
UnmodifiableListIterator(List l)
          Constructs a new iterator for a list.
UnmodifiableListIterator(ListIterator i)
          Constructs a new iterator.
UnmodifiableListIterator(Object[] a)
          Constructs a new iterator for an array.
 
Method Summary
 void add(Object o)
           
protected  ListIterator getListIterator()
          Gets the list iterator adaptee.
 boolean hasPrevious()
           
 int nextIndex()
           
 Object previous()
           
 int previousIndex()
           
 void set(Object o)
           
 
Methods inherited from class org.norther.tammi.acorn.util.UnmodifiableIterator
equals, getIterator, hashCode, hasMoreElements, hasNext, next, nextElement, remove
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.ListIterator
hasNext, next, remove
 

Constructor Detail

UnmodifiableListIterator

public UnmodifiableListIterator()
Constructs an empty iterator.


UnmodifiableListIterator

public UnmodifiableListIterator(ListIterator i)
Constructs a new iterator.

Parameters:
i - the wrapped iterator.

UnmodifiableListIterator

public UnmodifiableListIterator(List l)
Constructs a new iterator for a list.

Parameters:
l - a list to wrap.

UnmodifiableListIterator

public UnmodifiableListIterator(Object[] a)
Constructs a new iterator for an array.

Parameters:
a - an array to wrap.
Method Detail

add

public void add(Object o)
Specified by:
add in interface ListIterator

hasPrevious

public boolean hasPrevious()
Specified by:
hasPrevious in interface ListIterator

nextIndex

public int nextIndex()
Specified by:
nextIndex in interface ListIterator

previous

public Object previous()
Specified by:
previous in interface ListIterator

previousIndex

public int previousIndex()
Specified by:
previousIndex in interface ListIterator

set

public void set(Object o)
Specified by:
set in interface ListIterator

getListIterator

protected ListIterator getListIterator()
Gets the list iterator adaptee.

Returns:
the wrapped list iterator.


Copyright © 2004 The Norther Organization. All rights reserved.