ecologylab.generic
Class HashMappableArrayList<K,V extends Mappable<K>>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by ecologylab.generic.HashMapArrayList<K,V>
              extended by ecologylab.generic.HashMappableArrayList<K,V>
Type Parameters:
K -
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<K,V>

public class HashMappableArrayList<K,V extends Mappable<K>>
extends HashMapArrayList<K,V>

A HashMap with an ArrayList backing store, for speedy linear and hashed access. Each Value also implements Mappable, and so functions as a key. This means that we can implement Collection, because it guides us, for example, in performing a hashed put() when a linear add() is called.

Author:
andruid
See Also:
Serialized Form

Field Summary
 
Fields inherited from class ecologylab.generic.HashMapArrayList
arrayList
 
Constructor Summary
HashMappableArrayList()
           
HashMappableArrayList(int arg0)
           
HashMappableArrayList(int arg0, float arg1)
           
HashMappableArrayList(java.util.Map arg0)
           
 
Method Summary
 boolean add(V v)
          Add element to HashMap and to ArrayList, unless same element was already in HashMap.
 boolean addAll(java.util.Collection collection)
           
 boolean contains(V v)
           
 boolean containsAll(java.util.Collection c)
           
 boolean removeAll(java.util.Collection c)
           
 boolean retainAll(java.util.Collection c)
           
 java.lang.Object[] toArray()
           
 java.lang.Object[] toArray(java.lang.Object[] a)
           
 
Methods inherited from class ecologylab.generic.HashMapArrayList
clear, get, iterator, put, recycle, remove, values
 
Methods inherited from class java.util.HashMap
clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, putAll, size
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

HashMappableArrayList

public HashMappableArrayList()

HashMappableArrayList

public HashMappableArrayList(int arg0)
Parameters:
arg0 -

HashMappableArrayList

public HashMappableArrayList(java.util.Map arg0)
Parameters:
arg0 -

HashMappableArrayList

public HashMappableArrayList(int arg0,
                             float arg1)
Parameters:
arg0 -
arg1 -
Method Detail

add

public boolean add(V v)
Add element to HashMap and to ArrayList, unless same element was already in HashMap.

Parameters:
v -
Returns:

addAll

public boolean addAll(java.util.Collection collection)

contains

public boolean contains(V v)

containsAll

public boolean containsAll(java.util.Collection c)

removeAll

public boolean removeAll(java.util.Collection c)

retainAll

public boolean retainAll(java.util.Collection c)

toArray

public java.lang.Object[] toArray()

toArray

public java.lang.Object[] toArray(java.lang.Object[] a)