unbbayes.util
Class ArrayMap<K,V>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by unbbayes.util.ArrayMap<K,V>
All Implemented Interfaces:
Serializable, Map<K,V>

public class ArrayMap<K,V>
extends AbstractMap<K,V>
implements Serializable

Version:
3 de Abril de 2002 /** Classe que implementa um Map baseado em ArrayList.
Author:
Paulo Fernando Barbosa Duarte
See Also:
Serialized Form

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
ArrayMap()
           
 
Method Summary
 void clear()
          Apaga todos os elementos do ArrayMap.
 Set<Map.Entry<K,V>> entrySet()
           
 V get(Object key)
          Recupera do ArrayMap o valor associado a uma chave.
 ArrayList<K> getKeys()
          Retorna um ArrayList das chaves.
 V put(K key, V value)
          Insere no ArrayMap um par chave/valor.
 V remove(Object key)
          Apaga um elemento do ArrayMap.
 int size()
          Retorna o nÔøΩmero de pares chave/valor.
 
Methods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArrayMap

public ArrayMap()
Method Detail

put

public V put(K key,
             V value)
Insere no ArrayMap um par chave/valor.

Specified by:
put in interface Map<K,V>
Overrides:
put in class AbstractMap<K,V>
Parameters:
key - chave a ser inserida.
value - valor a ser inserida.
Returns:
null se key nÔøΩo foi anteriormente inserida, senÔøΩo o valor anterior.

get

public V get(Object key)
Recupera do ArrayMap o valor associado a uma chave.

Specified by:
get in interface Map<K,V>
Overrides:
get in class AbstractMap<K,V>
Parameters:
key - chave qual se deseja recuperar o valor.
Returns:
valor associado a key.

getKeys

public ArrayList<K> getKeys()
Retorna um ArrayList das chaves.

Returns:
array de chaves.

size

public int size()
Retorna o nÔøΩmero de pares chave/valor.

Specified by:
size in interface Map<K,V>
Overrides:
size in class AbstractMap<K,V>
Returns:
nÔøΩmero de pares chave/valor.

remove

public V remove(Object key)
Apaga um elemento do ArrayMap.

Specified by:
remove in interface Map<K,V>
Overrides:
remove in class AbstractMap<K,V>
Parameters:
key -
Returns:
antigo valor associado a key.

clear

public void clear()
Apaga todos os elementos do ArrayMap.

Specified by:
clear in interface Map<K,V>
Overrides:
clear in class AbstractMap<K,V>

entrySet

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


Copyright © 2001-2010 University of Brasilia - UnB. All Rights Reserved.