com.sun.enterprise.module.common_impl
Class AdapterIterator<T,U>

java.lang.Object
  extended by com.sun.enterprise.module.common_impl.AdapterIterator<T,U>
All Implemented Interfaces:
Iterator<T>

public abstract class AdapterIterator<T,U>
extends Object
implements Iterator<T>

Iterator implementation that works as a filter to another iterator.

Author:
Kohsuke Kawaguchi

Constructor Summary
AdapterIterator(Iterator<? extends U> core)
           
 
Method Summary
protected abstract  T adapt(U u)
           
 boolean hasNext()
           
 T next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdapterIterator

public AdapterIterator(Iterator<? extends U> core)
Method Detail

next

public T next()
Specified by:
next in interface Iterator<T>

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<T>

remove

public void remove()
Specified by:
remove in interface Iterator<T>

adapt

protected abstract T adapt(U u)
Returns:
null to filter out this object. Non-null object will be returned from the iterator to the caller.


Copyright © 2013 Oracle Corporation. All Rights Reserved.