com.edustructures.util
Class LinkedListMap<K,V>

java.lang.Object
  extended by com.edustructures.util.LinkedListMap<K,V>
Type Parameters:
K - The Type of the key for this Map
V - The Type of the value for this Map
All Implemented Interfaces:
java.util.Map<K,V>

public class LinkedListMap<K,V>
extends java.lang.Object
implements java.util.Map<K,V>

A fast and very light-weight Map implementation for very small collections of items (less than 10)

This implementation is much more lightweight than a HashMap in that it uses less objects. It is also very fast for small lists because it uses a linked list lookup rather than a bucket-based approach. This list is not synchronized.


Constructor Summary
LinkedListMap()
           
 
Method Summary
 void clear()
           
 boolean containsKey(java.lang.Object arg0)
           
 boolean containsValue(java.lang.Object arg0)
           
 java.util.Set<java.util.Map.Entry<K,V>> entrySet()
           
 V get(java.lang.Object arg0)
           
 boolean isEmpty()
           
 java.util.Set<K> keySet()
           
 V put(K arg0, V arg1)
           
 void putAll(java.util.Map<? extends K,? extends V> arg0)
           
 V remove(java.lang.Object arg0)
           
 int size()
           
 java.util.Collection<V> values()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

LinkedListMap

public LinkedListMap()
Method Detail

size

public int size()
Specified by:
size in interface java.util.Map<K,V>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Map<K,V>

containsKey

public boolean containsKey(java.lang.Object arg0)
Specified by:
containsKey in interface java.util.Map<K,V>

containsValue

public boolean containsValue(java.lang.Object arg0)
Specified by:
containsValue in interface java.util.Map<K,V>

get

public V get(java.lang.Object arg0)
Specified by:
get in interface java.util.Map<K,V>

put

public V put(K arg0,
             V arg1)
Specified by:
put in interface java.util.Map<K,V>

remove

public V remove(java.lang.Object arg0)
Specified by:
remove in interface java.util.Map<K,V>

putAll

public void putAll(java.util.Map<? extends K,? extends V> arg0)
Specified by:
putAll in interface java.util.Map<K,V>

clear

public void clear()
Specified by:
clear in interface java.util.Map<K,V>

keySet

public java.util.Set<K> keySet()
Specified by:
keySet in interface java.util.Map<K,V>

values

public java.util.Collection<V> values()
Specified by:
values in interface java.util.Map<K,V>

entrySet

public java.util.Set<java.util.Map.Entry<K,V>> entrySet()
Specified by:
entrySet in interface java.util.Map<K,V>


Copyright © 2001-2007 Edustructures LLC. All Rights Reserved. SIFWorks® and ADK® are registered trademarks of Edustructures LLC. SIF™ and Schools Interoperability Framework are trademarks of the Schools Interoperability Framework Association.