Class NumberedSet.InternalMap
java.lang.Object
com.github.tommyettinger.ds.ObjectIntMap<T>
com.github.tommyettinger.ds.ObjectIntOrderedMap<T>
com.github.tommyettinger.ds.NumberedSet.InternalMap
- All Implemented Interfaces:
Arrangeable, Ordered<T>, Iterable<ObjectIntMap.Entry<T>>
- Enclosing class:
NumberedSet<T>
-
Nested Class Summary
Nested classes/interfaces inherited from class ObjectIntOrderedMap
ObjectIntOrderedMap.OrderedMapEntries<K>, ObjectIntOrderedMap.OrderedMapKeys<K>, ObjectIntOrderedMap.OrderedMapValues<K>Nested classes/interfaces inherited from class ObjectIntMap
ObjectIntMap.Entries<K>, ObjectIntMap.Entry<K>, ObjectIntMap.EntryIterator<K>, ObjectIntMap.KeyIterator<K>, ObjectIntMap.Keys<K>, ObjectIntMap.MapIterator<K>, ObjectIntMap.ValueIterator<K>, ObjectIntMap.Values<K>Nested classes/interfaces inherited from interface Arrangeable
Arrangeable.ArrangeableList<T>Nested classes/interfaces inherited from interface Ordered
Ordered.OfBoolean, Ordered.OfByte, Ordered.OfChar, Ordered.OfDouble, Ordered.OfFloat, Ordered.OfInt, Ordered.OfLong, Ordered.OfShort -
Field Summary
Fields inherited from class ObjectIntOrderedMap
keysFields inherited from class ObjectIntMap
defaultValue, hashMultiplier, keyTable, loadFactor, mask, shift, size, threshold, valueTable -
Constructor Summary
ConstructorsConstructorDescriptionInternalMap(int initialCapacity) InternalMap(int initialCapacity, float loadFactor) InternalMap(ObjectIntMap<? extends T> map) InternalMap(ObjectIntOrderedMap<? extends T> map) InternalMap(Collection<? extends T> keys, PrimitiveCollection.OfInt values) InternalMap(T[] keys, int[] values) -
Method Summary
Modifier and TypeMethodDescriptionprotected intaddOrIndex(T t) protected booleanCompares the objects left and right, which are usually keys, for equality, returning true if they are considered equal.protected intReturns an index >= 0 and <=ObjectIntMap.maskfor the specifieditem, mixed.Methods inherited from class ObjectIntOrderedMap
alter, alterAt, appendTo, clear, clear, ensureCapacity, entrySet, getAndIncrement, getAt, iterator, keyAt, keySet, order, parse, parse, parse, put, put, putAll, putAll, putAll, putOrDefault, remove, removeAt, removeRange, setAt, sort, sort, sortByValue, truncate, values, with, with, with, with, with, with, withPrimitive, withPrimitive, withPrimitive, withPrimitive, withPrimitiveMethods inherited from class ObjectIntMap
appendTo, combine, combine, computeIfAbsent, containsKey, containsValue, equals, findKey, forEach, get, getDefaultValue, getHashMultiplier, getLoadFactor, getOrDefault, getTableSize, hashCode, isEmpty, locateKey, notEmpty, putAll, putAll, putAll, putAll, putAll, putIfAbsent, putLegible, putLegible, putLegible, putLegible, putPairs, putResize, remove, replace, replace, replaceAll, resize, setDefaultValue, setHashMultiplier, setLoadFactor, shrink, size, toString, toString, toString, toStringMethods inherited from interface Arrangeable
rearrange, shuffle, sizeMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface Ordered
getOrderType, random, random, reverse, selectRanked, selectRankedIndex, shuffle, swap
-
Constructor Details
-
InternalMap
public InternalMap() -
InternalMap
public InternalMap(int initialCapacity) -
InternalMap
public InternalMap(int initialCapacity, float loadFactor) -
InternalMap
-
InternalMap
-
InternalMap
-
InternalMap
-
-
Method Details
-
place
Description copied from class:ObjectIntMapReturns an index >= 0 and <=ObjectIntMap.maskfor the specifieditem, mixed.- Overrides:
placein classObjectIntMap<T>- Parameters:
item- a non-null Object; its hashCode() method should be used by most implementations- Returns:
- an index between 0 and
ObjectIntMap.mask(both inclusive)
-
equate
Description copied from class:ObjectIntMapCompares the objects left and right, which are usually keys, for equality, returning true if they are considered equal. This is used by the rest of this class to determine whether two keys are considered equal. Normally, this returnsleft.equals(right), but subclasses can override it to use reference equality, fuzzy equality, deep array equality, or any other custom definition of equality. Usually,ObjectIntMap.place(Object)is also overridden if this method is.- Overrides:
equatein classObjectIntMap<T>- Parameters:
left- must be non-null; typically a key being compared, but not necessarilyright- may be null; typically a key being compared, but can often be null for an empty key slot, or some other type- Returns:
- true if left and right are considered equal for the purposes of this class
-
addOrIndex
-