org.apache.stanbol.entityhub.servicesapi.util
Class TypeSafeIterator<T>

java.lang.Object
  extended by org.apache.stanbol.entityhub.servicesapi.util.AdaptingIterator<Object,T>
      extended by org.apache.stanbol.entityhub.servicesapi.util.TypeSafeIterator<T>
Type Parameters:
T - the type of elements returned by this iterator
All Implemented Interfaces:
Iterator<T>

public class TypeSafeIterator<T>
extends AdaptingIterator<Object,T>
implements Iterator<T>

Filters elements of the base Iterator base on the generic type of this one

Author:
Rupert Westenthaler

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.stanbol.entityhub.servicesapi.util.AdaptingIterator
AdaptingIterator.Adapter<T,A>
 
Constructor Summary
TypeSafeIterator(Iterator<?> it, Class<T> type)
          Constructs an iterator that selects only elements of the parsed iterator that are assignable to the parse type
 
Method Summary
 
Methods inherited from class org.apache.stanbol.entityhub.servicesapi.util.AdaptingIterator
hasNext, next, prepareNext, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 

Constructor Detail

TypeSafeIterator

public TypeSafeIterator(Iterator<?> it,
                        Class<T> type)
Constructs an iterator that selects only elements of the parsed iterator that are assignable to the parse type

Parameters:
it - the base iterator
type - the type all elements of this Iterator need to be assignable to.


Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.