|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Required methods for the Map ADT.
| Field Summary | |
static Object |
NO_SUCH_ELEMENT
Constant representing a key that is not in this. |
| 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. |
| Field Detail |
public static final Object NO_SUCH_ELEMENT
| Method Detail |
public void insertItem(Object aKey,
Object anElement)
aKey - key for the elementanElement - element to be insertedpublic Object lookupElement(Object aKey)
aKey - key for element to retrievepublic Object removeElement(Object aKey)
aKey - key for element to removepublic int size()
public boolean isEmpty()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||