jfun.yan.element
Class MapStore<K,T>

java.lang.Object
  extended by jfun.yan.element.MapStore<K,T>
All Implemented Interfaces:
ElementStore<T>

public class MapStore<K,T>
extends java.lang.Object
implements ElementStore<T>

This implementation stores component instances into a java.util.Map object.

Author:
Ben Yu Nov 12, 2005 2:30:31 PM

Constructor Summary
MapStore(K[] keys, java.util.Map<K,T> store)
          Create a MapStore object.
 
Method Summary
 void checkElement(int ind, java.lang.Class type)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.Object[] getKeys()
          Get the keys used to save component instances into map.
 java.util.Map<K,T> getMap()
          Get the map storing the component instances.
 int hashCode()
           
 void storeElement(int ind, T obj)
          Store an element.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapStore

public MapStore(K[] keys,
                java.util.Map<K,T> store)
Create a MapStore object.

Parameters:
keys - the keys used to save component instances into the map.
store - the map object.
Method Detail

storeElement

public void storeElement(int ind,
                         T obj)
Description copied from interface: ElementStore
Store an element.

Specified by:
storeElement in interface ElementStore<T>
Parameters:
ind - the element index.
obj - the element value.

checkElement

public void checkElement(int ind,
                         java.lang.Class type)

getKeys

public java.lang.Object[] getKeys()
Get the keys used to save component instances into map.


getMap

public java.util.Map<K,T> getMap()
Get the map storing the component instances.


equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object