cfa.vo.iris.utils
Class AbstractIterator
java.lang.Object
cfa.vo.iris.utils.AbstractIterator
- All Implemented Interfaces:
- Iterator
public abstract class AbstractIterator
- extends Object
- implements Iterator
Abstract class for wrapping iterators coming from other implementations.
The reason of this class is to provide a convenient way of creating iterators that fire events
when the remove() method is called.
Extended classes only need to implement the fireEvent method according to their
semantics and use cases.
- Author:
- olaurino
Method Summary |
protected abstract void |
fireEvent()
When a client calls the remove() method this callback method is invoked for
firing the appropriate event. |
boolean |
hasNext()
|
Object |
next()
|
void |
remove()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractIterator
public AbstractIterator(Iterator it)
- This class delegates its methods to a wrapped iterator.
- Parameters:
it
- The iterator that has to be wrapped.
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface Iterator
next
public Object next()
- Specified by:
next
in interface Iterator
remove
public void remove()
- Specified by:
remove
in interface Iterator
fireEvent
protected abstract void fireEvent()
- When a client calls the remove() method this callback method is invoked for
firing the appropriate event.
Copyright © 2013. All rights reserved.