public class EnumOrderedMap<K extends java.lang.Enum<?>,V> extends OrderedMap<K,V>
OrderedMap
, such as retrieval of
random keys or values with OrderedMap.randomKey(IRNG)
and OrderedMap.randomValue(IRNG)
, iteration in insertion order
instead of always using enum declaration order (order can be shuffled with OrderedMap.shuffle(IRNG)
or reordered with
OrderedMap.reorder(int...)
), and a little more. The implementation is nearly trivial due to how OrderedMap allows
customization of hashing strategy with its IHasher option, and this class always uses a specific custom IHasher to
hash Enum values by their ordinal. This IHasher is shared with EnumOrderedSet
.
OrderedMap.KeyIterator, OrderedMap.KeySet, OrderedMap.MapEntrySet, OrderedMap.ValueCollection, OrderedMap.ValueIterator
containsNullKey, DEFAULT_INITIAL_SIZE, DEFAULT_LOAD_FACTOR, defRetValue, entries, f, FAST_LOAD_FACTOR, hasher, key, keys, mask, maxFill, n, order, size, value, values, VERY_FAST_LOAD_FACTOR
Constructor and Description |
---|
EnumOrderedMap() |
EnumOrderedMap(java.lang.Class<K> enumClass) |
EnumOrderedMap(K enumObject) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
toString() |
alter, alterAt, alterAtCarefully, alterCarefully, arraySize, clear, clone, comparator, containsKey, containsValue, defaultReturnValue, defaultReturnValue, ensureCapacity, entryAt, entrySet, equals, firstKey, fixOrder, fixOrder, get, getAndMoveToFirst, getAndMoveToLast, getAt, getMany, getOrDefault, hash64, hashCode, headMap, indexOf, isEmpty, keyAt, keysAsOrderedSet, keySet, lastKey, makeMap, makeMap, maxFill, objectUnwrap, objectUnwrap, positionOf, put, putAll, putAll, putAndMoveToFirst, putAndMoveToLast, putAt, putIfAbsent, putPairs, randomEntry, randomKey, randomValue, rehash, remove, remove, removeAt, removeEntry, removeFirst, removeLast, removeNullEntry, reorder, replace, replace, reverse, setAt, shiftKeys, shuffle, size, sort, sort, sortByValue, sortByValue, subMap, swap, swapIndices, tailMap, trim, trim, unwrap, unwrap, values, valuesAsList
public EnumOrderedMap()
public EnumOrderedMap(java.lang.Class<K> enumClass)
public EnumOrderedMap(K enumObject)
public java.lang.String toString()
toString
in class OrderedMap<K extends java.lang.Enum<?>,V>
Copyright © Eben Howard 2012–2022. All rights reserved.