Typo Iteratable

This commit is contained in:
thatsIch 2014-09-21 01:25:44 +02:00
parent d979ae8ffd
commit 03e376c428
2 changed files with 58 additions and 58 deletions

View file

@ -156,7 +156,7 @@ public class Grid implements IGrid
@Override
public IReadOnlyCollection<IGridNode> getNodes()
{
return new NodeIteratable( Machines );
return new NodeIterable( Machines );
}
@Override

View file

@ -1,57 +1,57 @@
package appeng.me;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import appeng.api.networking.IGridNode;
import appeng.api.util.IReadOnlyCollection;
public class NodeIteratable<T> implements IReadOnlyCollection<T>
{
final private HashMap<Class, Set<IGridNode>> Machines;
public NodeIteratable(HashMap<Class, Set<IGridNode>> Machines) {
this.Machines = Machines;
}
@Override
public Iterator<T> iterator()
{
return new NodeIterator( Machines );
}
@Override
public int size()
{
int size = 0;
for (Set<IGridNode> o : Machines.values())
size += o.size();
return size;
}
@Override
public boolean isEmpty()
{
for (Set<IGridNode> o : Machines.values())
if ( !o.isEmpty() )
return false;
return true;
}
@Override
public boolean contains(Object node)
{
Class c = ((IGridNode) node).getMachine().getClass();
Set<IGridNode> p = Machines.get( c );
if ( p != null )
return p.contains( node );
return false;
}
}
package appeng.me;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import appeng.api.networking.IGridNode;
import appeng.api.util.IReadOnlyCollection;
public class NodeIterable<T> implements IReadOnlyCollection<T>
{
final private HashMap<Class, Set<IGridNode>> Machines;
public NodeIterable(HashMap<Class, Set<IGridNode>> Machines) {
this.Machines = Machines;
}
@Override
public Iterator<T> iterator()
{
return new NodeIterator( Machines );
}
@Override
public int size()
{
int size = 0;
for (Set<IGridNode> o : Machines.values())
size += o.size();
return size;
}
@Override
public boolean isEmpty()
{
for (Set<IGridNode> o : Machines.values())
if ( !o.isEmpty() )
return false;
return true;
}
@Override
public boolean contains(Object node)
{
Class c = ((IGridNode) node).getMachine().getClass();
Set<IGridNode> p = Machines.get( c );
if ( p != null )
return p.contains( node );
return false;
}
}