public final class IntMap<E> extends Object
Constructor and Description |
---|
IntMap()
initializes the map
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
clear the map (removes everything inside)
|
boolean |
containsKey(int key)
predicate to check if the key is associated to any value
|
E |
get(int key)
get the value associated with the key, or null
|
boolean |
isEmpty()
predicate to check if the map is empty
|
E |
put(int key,
E value)
associates key with value
|
boolean |
remove(int key)
remove the association key/value (if any)
|
int |
size() |
public boolean containsKey(int key)
key
- the keypublic E get(int key)
key
- the keypublic E put(int key, E value)
key
- the keyvalue
- the valuepublic boolean remove(int key)
key
- the key to remove from the Mappublic int size()
public boolean isEmpty()
public void clear()
Copyright © 2022. All rights reserved.