Basic reformat, hit once, hope never again
This commit is contained in:
+13
-11
@@ -18,11 +18,13 @@
|
||||
|
||||
package appeng.me.cache.helpers;
|
||||
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
|
||||
import appeng.parts.p2p.PartP2PTunnel;
|
||||
|
||||
|
||||
public class TunnelIterator<T extends PartP2PTunnel> implements Iterator<T>
|
||||
{
|
||||
|
||||
@@ -30,22 +32,23 @@ public class TunnelIterator<T extends PartP2PTunnel> implements Iterator<T>
|
||||
final Class targetType;
|
||||
T Next;
|
||||
|
||||
private void findNext()
|
||||
public TunnelIterator( Collection<T> tunnelSources, Class clz )
|
||||
{
|
||||
while (this.Next == null && this.wrapped.hasNext())
|
||||
{
|
||||
this.Next = this.wrapped.next();
|
||||
if ( !this.targetType.isInstance( this.Next ) )
|
||||
this.Next = null;
|
||||
}
|
||||
}
|
||||
|
||||
public TunnelIterator(Collection<T> tunnelSources, Class clz) {
|
||||
this.wrapped = tunnelSources.iterator();
|
||||
this.targetType = clz;
|
||||
this.findNext();
|
||||
}
|
||||
|
||||
private void findNext()
|
||||
{
|
||||
while( this.Next == null && this.wrapped.hasNext() )
|
||||
{
|
||||
this.Next = this.wrapped.next();
|
||||
if( !this.targetType.isInstance( this.Next ) )
|
||||
this.Next = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasNext()
|
||||
{
|
||||
@@ -66,5 +69,4 @@ public class TunnelIterator<T extends PartP2PTunnel> implements Iterator<T>
|
||||
{
|
||||
// no.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user