Basic reformat, hit once, hope never again

This commit is contained in:
thatsIch
2015-04-03 08:54:31 +02:00
parent 4ff1631f89
commit d34c988c88
886 changed files with 31400 additions and 30990 deletions
+13 -11
View File
@@ -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.
}
}