org.jruby.util
Class GenericMap

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

public abstract class GenericMap
extends java.lang.Object
implements java.util.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 (krab@trifork.com)

Field Summary
protected  int size
           
 
Constructor Summary
GenericMap()
           
 
Method Summary
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
          return the element with the given key
protected abstract  java.util.Iterator entryIterator()
           
 java.util.Set entrySet()
           
 boolean equals(java.lang.Object other)
           
 int hashCode()
           
 boolean isEmpty()
           
protected  boolean keyEquals(java.lang.Object containedKey, java.lang.Object givenKey)
           
protected  int keyHash(java.lang.Object key)
           
protected  java.util.Iterator keyIterator()
           
 java.util.Set keySet()
           
 void putAll(java.util.Map other)
           
 int size()
           
protected  boolean valueEquals(java.lang.Object value1, java.lang.Object value2)
           
protected  int valueHash(java.lang.Object value)
           
protected  java.util.Iterator valueIterator()
           
 java.util.Collection values()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
clear, get, put, remove
 

Field Detail

size

protected int size
Constructor Detail

GenericMap

public GenericMap()
Method Detail

size

public int size()
Specified by:
size in interface java.util.Map

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Map

keyHash

protected int keyHash(java.lang.Object key)

keyEquals

protected boolean keyEquals(java.lang.Object containedKey,
                            java.lang.Object givenKey)

valueHash

protected int valueHash(java.lang.Object value)

valueEquals

protected boolean valueEquals(java.lang.Object value1,
                              java.lang.Object value2)

putAll

public void putAll(java.util.Map other)
Specified by:
putAll in interface java.util.Map

entryIterator

protected abstract java.util.Iterator entryIterator()

keyIterator

protected java.util.Iterator keyIterator()

valueIterator

protected java.util.Iterator valueIterator()

values

public java.util.Collection values()
Specified by:
values in interface java.util.Map

keySet

public java.util.Set keySet()
Specified by:
keySet in interface java.util.Map

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Map
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object other)
Specified by:
equals in interface java.util.Map
Overrides:
equals in class java.lang.Object

entrySet

public java.util.Set entrySet()
Specified by:
entrySet in interface java.util.Map

containsValue

public boolean containsValue(java.lang.Object value)
return the element with the given key

Specified by:
containsValue in interface java.util.Map

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map


Copyright © 2002-2007 JRuby Team. All Rights Reserved.