CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation

com.tangosol.util
Class ConverterCollections.ConverterListIterator

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.util.ConverterCollections.ConverterListIterator
All Implemented Interfaces:
Iterator, ListIterator
Enclosing class:
ConverterCollections

public static class ConverterCollections.ConverterListIterator
extends Base
implements ListIterator

A Converter ListIterator views an underlying ListIterator through a Converter.


Field Summary
protected  Converter m_convDown
          The Converter from this ListIterator to the underlying ListIterator.
protected  Converter m_convUp
          The Converter from the underlying ListIterator to this ListIterator.
protected  ListIterator m_iter
          The underlying ListIterator.
 
Constructor Summary
ConverterCollections.ConverterListIterator(ListIterator iter, Converter convUp, Converter convDown)
          Constructor.
 
Method Summary
 void add(Object o)
          Inserts the specified element into the list.
 boolean hasNext()
          Returns true if this list iterator has more elements when traversing the list in the forward direction.
 boolean hasPrevious()
          Returns true if this list iterator has more elements when traversing the list in the reverse direction.
 Object next()
          Returns the next element in the list.
 int nextIndex()
          Returns the index of the element that would be returned by a subsequent call to next.
 Object previous()
          Returns the previous element in the list.
 int previousIndex()
          Returns the index of the element that would be returned by a subsequent call to previous.
 void remove()
          Removes from the list the last element that was returned by next or previous.
 void set(Object o)
          Replaces the last element returned by next or previous with the specified element.
 

Field Detail

m_iter

protected ListIterator m_iter
The underlying ListIterator.


m_convUp

protected Converter m_convUp
The Converter from the underlying ListIterator to this ListIterator.


m_convDown

protected Converter m_convDown
The Converter from this ListIterator to the underlying ListIterator.

Constructor Detail

ConverterCollections.ConverterListIterator

public ConverterCollections.ConverterListIterator(ListIterator iter,
                                                  Converter convUp,
                                                  Converter convDown)
Constructor.

Parameters:
iter - the underlying ListIterator
convUp - the Converter from the underlying ListIterator
convDown - the Converter to the underlying ListIterator
Method Detail

hasNext

public boolean hasNext()
Returns true if this list iterator has more elements when traversing the list in the forward direction. Obeys the general contract of ListIterator.hasNext.

Specified by:
hasNext in interface Iterator
Specified by:
hasNext in interface ListIterator
Returns:
true if the list iterator has more elements when traversing the list in the forward direction

next

public Object next()
Returns the next element in the list. Obeys the general contract of ListIterator.next.

Specified by:
next in interface Iterator
Specified by:
next in interface ListIterator
Returns:
the next element in the list

hasPrevious

public boolean hasPrevious()
Returns true if this list iterator has more elements when traversing the list in the reverse direction. Obeys the general contract of ListIterator.hasPrevious.

Specified by:
hasPrevious in interface ListIterator
Returns:
true if the list iterator has more elements when traversing the list in the reverse direction

previous

public Object previous()
Returns the previous element in the list. Obeys the general contract of ListIterator.previous.

Specified by:
previous in interface ListIterator
Returns:
the previous element in the list
Throws:
NoSuchElementException - if the iteration has no previous element

nextIndex

public int nextIndex()
Returns the index of the element that would be returned by a subsequent call to next. Obeys the general contract of ListIterator.nextIndex.

Specified by:
nextIndex in interface ListIterator
Returns:
the index of the element that would be returned by a subsequent call to next, or list size if list iterator is at end of list

previousIndex

public int previousIndex()
Returns the index of the element that would be returned by a subsequent call to previous. Obeys the general contract of ListIterator.previousIndex.

Specified by:
previousIndex in interface ListIterator
Returns:
the index of the element that would be returned by a subsequent call to previous, or -1 if list iterator is at beginning of list

remove

public void remove()
Removes from the list the last element that was returned by next or previous. Obeys the general contract of ListIterator.remove.

Specified by:
remove in interface Iterator
Specified by:
remove in interface ListIterator

set

public void set(Object o)
Replaces the last element returned by next or previous with the specified element. Obeys the general contract of ListIterator.set.

Specified by:
set in interface ListIterator
Parameters:
o - the element with which to replace the last element returned by next or previous

add

public void add(Object o)
Inserts the specified element into the list. Obeys the general contract of ListIterator.add.

Specified by:
add in interface ListIterator
Parameters:
o - the element to insert

CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation