edu.stanford.nlp.international.process
Class StringMap

java.lang.Object
  extended by edu.stanford.nlp.international.process.StringMap
All Implemented Interfaces:
Iterable<String>

public class StringMap
extends Object
implements Iterable<String>

A map from strings to strings that provides type-checking and limited access control.

Author:
Spence Green

Constructor Summary
StringMap()
           
 
Method Summary
 boolean contains(String param)
          Indicates whether the map contains the specified key or not.
 String get(String param)
          Returns the value associated with the specified key, or null if the key does not exist.
 Iterator<String> iterator()
          Returns an iterator over the key set.
 Set<String> keySet()
          Returns an unmodifiable set of keys.
static void main(String[] args)
           
 void put(String param, String value)
          Adds a key to the map with an associated value.
 String remove(String param)
          Removes the value associated with the specified key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringMap

public StringMap()
Method Detail

contains

public boolean contains(String param)
Indicates whether the map contains the specified key or not.

Parameters:
param - The query key
Returns:
True if the map contains param. False otherwise.

get

public String get(String param)
Returns the value associated with the specified key, or null if the key does not exist.

Parameters:
param - The query key
Returns:
The value associated with param, if it exists. Returns null otherwise.

remove

public String remove(String param)
Removes the value associated with the specified key. This method silently ignores keys not present in the map.

Parameters:
param - The query key
Returns:
The value removed from the map, or null if the key does not exist.

put

public void put(String param,
                String value)
Adds a key to the map with an associated value. If the key already exists in the map, then the value is updated with value.

Parameters:
param - The key to add
value - The value associated with the key

keySet

public Set<String> keySet()
Returns an unmodifiable set of keys.

Returns:
The set of keys

iterator

public Iterator<String> iterator()
Returns an iterator over the key set.

Specified by:
iterator in interface Iterable<String>

main

public static void main(String[] args)


Stanford NLP Group