Package appeng.api.stacks
Class KeyCounter
java.lang.Object
appeng.api.stacks.KeyCounter
public final class KeyCounter
extends Object
implements Iterable<it.unimi.dsi.fastutil.objects.Object2LongMap.Entry<AEKey>>
Associates a generic value of type T with AE keys and makes key/value pairs searchable with fuzzy mode semantics.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddAll(KeyCounter other) voidclear()Collection<it.unimi.dsi.fastutil.objects.Object2LongMap.Entry<AEKey>> longit.unimi.dsi.fastutil.objects.Object2LongMap.Entry<AEKey> getFirstEntry(Class<T> keyClass) @Nullable AEKey<T extends AEKey>
TgetFirstKey(Class<T> keyClass) booleanisEmpty()iterator()keySet()longRemoves the given key from this counter, and returns the old value (or 0).voidSubtracts the given amount from the value associated with the given key.voidremoveAll(KeyCounter other) voidvoidvoidreset()voidintsize()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
KeyCounter
public KeyCounter()
-
-
Method Details
-
findFuzzy
public Collection<it.unimi.dsi.fastutil.objects.Object2LongMap.Entry<AEKey>> findFuzzy(AEKey key, FuzzyMode fuzzy) -
removeZeros
public void removeZeros() -
removeEmptySubmaps
public void removeEmptySubmaps() -
addAll
-
removeAll
-
add
-
remove
Subtracts the given amount from the value associated with the given key. -
remove
Removes the given key from this counter, and returns the old value (or 0). -
set
-
get
-
reset
public void reset() -
clear
public void clear() -
isEmpty
public boolean isEmpty() -
size
public int size() -
iterator
-
getFirstKey
-
getFirstKey
-
getFirstEntry
-
getFirstEntry
-
keySet
-