es.rediris.papi.filter
Class StringListHashMap

java.lang.Object
  extended by es.rediris.papi.filter.StringListHashMap

public class StringListHashMap
extends Object

StringListHashMap has the similar behavior than a HashMaps, but the objects stores are multivaluable strings. This class manages the posibility of more than one value for a key and stores the value in a list of string

Author:
arcturus 06/08/2007

Constructor Summary
StringListHashMap()
          Constructor, creates a new instance of this object and initialices the hasmap
 
Method Summary
 boolean containsKey(String key)
          Wrapper function for the containsKey method in the HashMap
 String[] get(String key)
           
 Object put(String key, String value)
          Store a pair key,value.
 Object put(String key, String[] values)
           
 int size()
          Return the size of keys stored
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringListHashMap

public StringListHashMap()
Constructor, creates a new instance of this object and initialices the hasmap

Method Detail

get

public String[] get(String key)
Parameters:
key - The identifier
Returns:
Array of Strings with the values for the specific key or null if the ke is not inside the map

put

public Object put(String key,
                  String value)
Store a pair key,value. If there is values for that key this new value is added to the this. If the key does not exist the value stored is a list whit an unique element.

Parameters:
key - The key identifier
value - The string value to store
Returns:
The result of inserting the list of string values

put

public Object put(String key,
                  String[] values)

containsKey

public boolean containsKey(String key)
Wrapper function for the containsKey method in the HashMap

Parameters:
key - The identifier
Returns:
Boolean, true if that key exists, false otherwise

size

public int size()
Return the size of keys stored

Returns:
int number of keys stored