|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--JavaMap
IMap implementation using a Java Hashtable to store items.
Field Summary | |
protected Hashtable |
items
Hashtable used to store items in this. |
Fields inherited from interface IMap |
NO_SUCH_ELEMENT |
Constructor Summary | |
JavaMap()
Constructs an empty Java map. |
Method Summary | |
void |
insertItem(Object aKey,
Object anElement)
Inserts an item into this that associates the given key with the given element, increasing the size of this by 1 if the given key is not already in this. |
boolean |
isEmpty()
Returns whether or not this is empty. |
Object |
lookupElement(Object aKey)
Returns the element associated with the given key, or NO_SUCH_ELEMENT if the key is not in this. |
Object |
removeElement(Object aKey)
Removes and returns the element in this that is associated with the given key, reducing the size of this by 1, or returns NO_SUCH_ELEMENT and does not change the size if the key is not in this. |
int |
size()
Returns the number of items in this. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Hashtable items
Constructor Detail |
public JavaMap()
Method Detail |
public void insertItem(Object aKey, Object anElement)
insertItem
in interface IMap
aKey
- key for the elementanElement
- element to be insertedpublic Object lookupElement(Object aKey)
lookupElement
in interface IMap
aKey
- key for element to retrievepublic Object removeElement(Object aKey)
removeElement
in interface IMap
aKey
- key for element to removepublic int size()
size
in interface IMap
public boolean isEmpty()
isEmpty
in interface IMap
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |