com.ds.fw.types.collections
Class FwReverseIterator

java.lang.Object
  |
  +--com.ds.fw.types.collections.FwReverseIterator
All Implemented Interfaces:
java.util.Iterator

public class FwReverseIterator
extends java.lang.Object
implements java.util.Iterator

I am used to iterate through a list in reverse order. I do not implement the remove() method or any of the "fail-fast" functionality of the standard ArrayList.iterator().


Field Summary
 int _index
          The current index of the _list.
 java.util.List _list
          A List object handle, initialized through the creation process.
 
Constructor Summary
FwReverseIterator(java.util.List v)
          Initializes the class members.
 
Method Summary
 boolean hasNext()
          Checks if the beginning of the list is reached.
 java.lang.Object next()
          Returns the next element in the list.
 void remove()
          Not implemented.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_list

public java.util.List _list
A List object handle, initialized through the creation process.


_index

public int _index
The current index of the _list.

Constructor Detail

FwReverseIterator

public FwReverseIterator(java.util.List v)
Initializes the class members.

Parameters:
v - a List object
Method Detail

hasNext

public boolean hasNext()
Checks if the beginning of the list is reached.

Specified by:
hasNext in interface java.util.Iterator
Returns:
if there is next element

next

public java.lang.Object next()
Returns the next element in the list. If the begin of the list is reached the NoSuchElementException is thrown.

Specified by:
next in interface java.util.Iterator
Returns:
the next element in the list.

remove

public void remove()
Not implemented. This method throws a UnsupportedOperationException.

Specified by:
remove in interface java.util.Iterator