Package com.github.tommyettinger.ds
Class NumberedSet.InternalMap
java.lang.Object
com.github.tommyettinger.ds.ObjectIntMap<K>
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 com.github.tommyettinger.ds.ObjectIntOrderedMap
ObjectIntOrderedMap.OrderedMapEntries<K>, ObjectIntOrderedMap.OrderedMapKeys<K>, ObjectIntOrderedMap.OrderedMapValues<K>Nested classes/interfaces inherited from class com.github.tommyettinger.ds.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 com.github.tommyettinger.ds.Arrangeable
Arrangeable.ArrangeableList<T>Nested classes/interfaces inherited from interface com.github.tommyettinger.ds.Ordered
Ordered.OfBoolean, Ordered.OfByte, Ordered.OfChar, Ordered.OfDouble, Ordered.OfFloat, Ordered.OfInt, Ordered.OfLong, Ordered.OfShort -
Field Summary
Fields inherited from class com.github.tommyettinger.ds.ObjectIntOrderedMap
keysFields inherited from class com.github.tommyettinger.ds.ObjectIntMap
defaultValue, entries1, entries2, hashMultiplier, keys1, keys2, keyTable, loadFactor, mask, shift, size, threshold, values1, values2, 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 com.github.tommyettinger.ds.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 com.github.tommyettinger.ds.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 class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.github.tommyettinger.ds.Arrangeable
rearrange, shuffle, sizeMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface com.github.tommyettinger.ds.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
-