Class GenericMap

java.lang.Object
org.jruby.util.GenericMap
All Implemented Interfaces:
Map
Direct Known Subclasses:
WeakIdentityHashMap

public abstract class GenericMap extends Object implements Map
A GenericMap is simply an abstract java.util.Map implementation for which subclasses really only need to implement the method entryIterator.
Author:
Kresten Krab Thorup ([email protected])
  • Field Details

    • size

      protected int size
  • Constructor Details

    • GenericMap

      public GenericMap()
  • Method Details

    • size

      public int size()
      Specified by:
      size in interface Map
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Map
    • keyHash

      protected int keyHash(Object key)
    • keyEquals

      protected boolean keyEquals(Object containedKey, Object givenKey)
    • valueHash

      protected int valueHash(Object value)
    • valueEquals

      protected boolean valueEquals(Object value1, Object value2)
    • putAll

      public void putAll(Map other)
      Specified by:
      putAll in interface Map
    • entryIterator

      protected abstract Iterator entryIterator()
    • keyIterator

      protected Iterator keyIterator()
    • valueIterator

      protected Iterator valueIterator()
    • values

      public Collection values()
      Specified by:
      values in interface Map
    • keySet

      public Set keySet()
      Specified by:
      keySet in interface Map
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Map
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object other)
      Specified by:
      equals in interface Map
      Overrides:
      equals in class Object
    • entrySet

      public Set entrySet()
      Specified by:
      entrySet in interface Map
    • containsValue

      public boolean containsValue(Object value)
      return the element with the given key
      Specified by:
      containsValue in interface Map
    • containsKey

      public boolean containsKey(Object key)
      Specified by:
      containsKey in interface Map