net.sourceforge.jsxe.util
Class ArrayListEnumeration
java.lang.Object
net.sourceforge.jsxe.util.ArrayListEnumeration
- All Implemented Interfaces:
- Enumeration, Iterator, ListIterator
- public class ArrayListEnumeration
- extends Object
- implements Enumeration, ListIterator
A utility class that allows enumaration or iteration over
an ArrayList. One can use ArrayList.iterator() or ArrayList.ListIterator()
but this class allows passing a single object around as an Enumaration or
Iterator.
- Version:
- $Id: ArrayListEnumeration.java 610 2005-04-15 20:01:09Z ian_lewis $
- Author:
- Ian Lewis (IanLewis@member.fsf.org)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ArrayListEnumeration
public ArrayListEnumeration(ArrayList list)
hasMoreElements
public boolean hasMoreElements()
- Specified by:
hasMoreElements
in interface Enumeration
nextElement
public Object nextElement()
throws NoSuchElementException
- Specified by:
nextElement
in interface Enumeration
- Throws:
NoSuchElementException
add
public void add(Object o)
- Specified by:
add
in interface ListIterator
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface ListIterator
hasPrevious
public boolean hasPrevious()
- Specified by:
hasPrevious
in interface ListIterator
next
public Object next()
throws NoSuchElementException
- Specified by:
next
in interface ListIterator
- Throws:
NoSuchElementException
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
remove
public void remove()
throws UnsupportedOperationException
- Specified by:
remove
in interface ListIterator
- Throws:
UnsupportedOperationException
set
public void set(Object o)
throws UnsupportedOperationException
- Specified by:
set
in interface ListIterator
- Throws:
UnsupportedOperationException