net.sf.staccatocommons.iterators
Class UnmodifiableIterator<T>

java.lang.Object
  extended by net.sf.staccatocommons.iterators.AbstractUnmodifiableIterator<T>
      extended by net.sf.staccatocommons.iterators.UnmodifiableIterator<T>
Type Parameters:
T -
All Implemented Interfaces:
Iterator<T>

public final class UnmodifiableIterator<T>
extends AbstractUnmodifiableIterator<T>

Author:
flbulgarelli

Constructor Summary
UnmodifiableIterator(Iterator<? extends T> iter)
          Creates a new UnmodifiableIterator
 
Method Summary
static
<A> Iterator<A>
from(Iterator<? extends A> iter)
          Answers an Iterator view of the given iter that does not support AbstractUnmodifiableIterator.remove()
 boolean hasNext()
           
 T next()
           
 String toString()
           
 
Methods inherited from class net.sf.staccatocommons.iterators.AbstractUnmodifiableIterator
remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnmodifiableIterator

public UnmodifiableIterator(Iterator<? extends T> iter)
Creates a new UnmodifiableIterator

Method Detail

hasNext

public boolean hasNext()

next

public T next()

from

@NonNull
public static <A> Iterator<A> from(Iterator<? extends A> iter)
Answers an Iterator view of the given iter that does not support AbstractUnmodifiableIterator.remove()

Type Parameters:
A -
Parameters:
element -
Returns:
a new UnmodifiableIterator

toString

public String toString()
Overrides:
toString in class Object


Get Staccatocommons at SourceForge.net. Fast, secure and Free Open Source software downloads