JUtil

net.cscott.jutil
Class LinearMap<K,V>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by net.cscott.jutil.LinearMap<K,V>
All Implemented Interfaces:
Map<K,V>

public class LinearMap<K,V>
extends AbstractMap<K,V>

LinearMap is a simplistic light-weight Map designed for use when the number of entries is small. It is backed by a LinearSet.

Version:
$Id: LinearMap.java,v 1.4 2006-10-30 19:58:06 cananian Exp $
Author:
Felix S. Klock II

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
LinearMap()
          Creates a LinearMap.
LinearMap(int capacity)
          Creates a LinearMap with specified capacity.
LinearMap(Map<K,V> map)
           
 
Method Summary
 Set<Map.Entry<K,V>> entrySet()
           
 V put(K key, V value)
           
 V remove(Object key)
           
 
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, putAll, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LinearMap

public LinearMap()
Creates a LinearMap.


LinearMap

public LinearMap(Map<K,V> map)

LinearMap

public LinearMap(int capacity)
Creates a LinearMap with specified capacity.

Method Detail

entrySet

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

put

public V put(K key,
             V value)
Specified by:
put in interface Map<K,V>
Overrides:
put in class AbstractMap<K,V>

remove

public V remove(Object key)
Specified by:
remove in interface Map<K,V>
Overrides:
remove in class AbstractMap<K,V>

JUtil

Copyright (c) 2006 C. Scott Ananian