TUM CCSM Commons

edu.tum.cs.commons.collections
Class UnmodifiableListIterator<T>

java.lang.Object
  extended by edu.tum.cs.commons.collections.UnmodifiableIterator<T>
      extended by edu.tum.cs.commons.collections.UnmodifiableListIterator<T>
All Implemented Interfaces:
java.util.Iterator<T>, java.util.ListIterator<T>

public class UnmodifiableListIterator<T>
extends UnmodifiableIterator<T>
implements java.util.ListIterator<T>

This is a wrapper for a ListIterator prohibiting all calls which would modify its owning container. All prohibited methods throw an UnsupportedOperationException.

Version:
$Revision: 26283 $
Author:
Benjamin Hummel, $Author: juergens $
Rating:
GREEN Hash: 9BFBB340546768A49651FF141F51F985

Constructor Summary
UnmodifiableListIterator(java.util.ListIterator<T> i)
          Creates a new unmodifiable list iterator from another list iterator.
 
Method Summary
 void add(T o)
          Operation is not supported.
 boolean hasPrevious()
          
 int nextIndex()
          
 T previous()
          
 int previousIndex()
          
 void set(T o)
          Operation is not supported.
 
Methods inherited from class edu.tum.cs.commons.collections.UnmodifiableIterator
hasNext, next, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.ListIterator
hasNext, next, remove
 

Constructor Detail

UnmodifiableListIterator

public UnmodifiableListIterator(java.util.ListIterator<T> i)
Creates a new unmodifiable list iterator from another list iterator. All modifications to the underlying iterator will directly be visible in this wrapper.

Method Detail

hasPrevious

public boolean hasPrevious()

Specified by:
hasPrevious in interface java.util.ListIterator<T>

nextIndex

public int nextIndex()

Specified by:
nextIndex in interface java.util.ListIterator<T>

previous

public T previous()

Specified by:
previous in interface java.util.ListIterator<T>

previousIndex

public int previousIndex()

Specified by:
previousIndex in interface java.util.ListIterator<T>

add

public void add(T o)
Operation is not supported.

Specified by:
add in interface java.util.ListIterator<T>
Throws:
java.lang.UnsupportedOperationException

set

public void set(T o)
Operation is not supported.

Specified by:
set in interface java.util.ListIterator<T>
Throws:
java.lang.UnsupportedOperationException

TUM CCSM Commons

TUM CCSM Commons - 2.7