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 TypeMethodDescriptionvoid
void
addAll
(KeyCounter other) void
clear()
Collection
<it.unimi.dsi.fastutil.objects.Object2LongMap.Entry<AEKey>> long
it.unimi.dsi.fastutil.objects.Object2LongMap.Entry
<AEKey> getFirstEntry
(Class<T> keyClass) @Nullable AEKey
<T extends AEKey>
TgetFirstKey
(Class<T> keyClass) boolean
isEmpty()
iterator()
keySet()
long
Removes the given key from this counter, and returns the old value (or 0).void
Subtracts the given amount from the value associated with the given key.void
removeAll
(KeyCounter other) void
void
void
reset()
void
int
size()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
-