Package org.jruby.util
Class GenericMap
java.lang.Object
org.jruby.util.GenericMap
- All Implemented Interfaces:
Map
- Direct Known Subclasses:
WeakIdentityHashMap
A
GenericMap is simply an abstract java.util.Map
implementation for which subclasses really only need to implement
the method entryIterator.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class(package private) class(package private) class(package private) class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(Object key) booleancontainsValue(Object value) return the element with the given keyprotected abstract IteratorentrySet()booleaninthashCode()booleanisEmpty()protected booleanprotected intprotected IteratorkeySet()voidintsize()private static Object[]I don't quite understand why we need to replace this method from AbstractCollection, but it has been observed that toArray returns the *reverse* order of elements.protected booleanvalueEquals(Object value1, Object value2) protected intprotected Iteratorvalues()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, forEach, get, getOrDefault, merge, put, putIfAbsent, remove, remove, replace, replace, replaceAll
-
Field Details
-
size
protected int size
-
-
Constructor Details
-
GenericMap
public GenericMap()
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
keyHash
-
keyEquals
-
valueHash
-
valueEquals
-
putAll
-
entryIterator
-
keyIterator
-
valueIterator
-
toArray
I don't quite understand why we need to replace this method from AbstractCollection, but it has been observed that toArray returns the *reverse* order of elements. --Kresten -
values
-
keySet
-
hashCode
public int hashCode() -
equals
-
entrySet
-
containsValue
return the element with the given key- Specified by:
containsValuein interfaceMap
-
containsKey
- Specified by:
containsKeyin interfaceMap
-