Typo Iteratable
This commit is contained in:
parent
d979ae8ffd
commit
03e376c428
2 changed files with 58 additions and 58 deletions
|
@ -156,7 +156,7 @@ public class Grid implements IGrid
|
|||
@Override
|
||||
public IReadOnlyCollection<IGridNode> getNodes()
|
||||
{
|
||||
return new NodeIteratable( Machines );
|
||||
return new NodeIterable( Machines );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue