common-util

local.tomas.util.collections
Class MappedListIterator<F,T>

java.lang.Object
  extended by local.tomas.util.collections.MappedIterator<F,T>
      extended by local.tomas.util.collections.MappedListIterator<F,T>
Type Parameters:
F - element type of base list
T - element type of this iterator
All Implemented Interfaces:
Iterator<T>, ListIterator<T>

public class MappedListIterator<F,T>
extends MappedIterator<F,T>
implements ListIterator<T>

Iterator over a mapped list. This iterator iterates over the elements of the base iterator mapped to T by the mapping used>

Author:
tomas.teubner

Field Summary
 
Fields inherited from class local.tomas.util.collections.MappedIterator
mapper
 
Constructor Summary
MappedListIterator(ListIterator<F> iterator, ObjectMapping<T> mapper)
          Construct mapped list iterator.
 
Method Summary
 void add(T o)
           
 boolean hasPrevious()
           
 int nextIndex()
           
 T previous()
           
 int previousIndex()
           
 void set(T o)
           
 
Methods inherited from class local.tomas.util.collections.MappedIterator
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

MappedListIterator

public MappedListIterator(ListIterator<F> iterator,
                          ObjectMapping<T> mapper)
Construct mapped list iterator.

Parameters:
iterator - base iterator
mapper - element mapping
Method Detail

hasPrevious

public boolean hasPrevious()
Specified by:
hasPrevious in interface ListIterator<T>

previous

public T previous()
Specified by:
previous in interface ListIterator<T>

nextIndex

public int nextIndex()
Specified by:
nextIndex in interface ListIterator<T>

previousIndex

public int previousIndex()
Specified by:
previousIndex in interface ListIterator<T>

set

public void set(T o)
Specified by:
set in interface ListIterator<T>
Throws:
UnsupportedOperationException - when invoked

add

public void add(T o)
Specified by:
add in interface ListIterator<T>
Throws:
UnsupportedOperationException - when invoked

common-util

Copyright © 2005-2007 Tomas Teubner. All Rights Reserved.