Applied-Energistics-2-tiler.../util/prioitylist/FuzzyPriorityList.java
2013-12-27 16:59:59 -06:00

38 lines
725 B
Java

package appeng.util.prioitylist;
import java.util.Collection;
import appeng.api.config.FuzzyMode;
import appeng.api.storage.data.IAEStack;
import appeng.api.storage.data.IItemList;
public class FuzzyPriorityList<T extends IAEStack<T>> implements IPartitionList<T>
{
final IItemList<T> list;
final FuzzyMode mode;
public FuzzyPriorityList(IItemList<T> in, FuzzyMode mode) {
list = in;
this.mode = mode;
}
public boolean isListed(T input)
{
Collection<T> out = list.findFuzzy( input, mode );
return out != null && !out.isEmpty();
}
@Override
public boolean isEmpty()
{
return list.isEmpty();
}
@Override
public Iterable<T> getItems()
{
return list;
}
}