edu.stanford.nlp.international.process
Class StringMap

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

public class StringMap
extends java.lang.Object
implements java.lang.Iterable<java.lang.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(java.lang.String param)
          Indicates whether the map contains the specified key or not.
 java.lang.String get(java.lang.String param)
          Returns the value associated with the specified key, or null if the key does not exist.
 java.util.Iterator<java.lang.String> iterator()
          Returns an iterator over the key set.
 java.util.Set<java.lang.String> keySet()
          Returns an unmodifiable set of keys.
static void main(java.lang.String[] args)
           
 void put(java.lang.String param, java.lang.String value)
          Adds a key to the map with an associated value.
 java.lang.String remove(java.lang.String param)
          Removes the value associated with the specified key.
 java.util.Set<java.lang.String> values()
          Set of the values in the map.
 
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(java.lang.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 java.lang.String get(java.lang.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 java.lang.String remove(java.lang.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(java.lang.String param,
                java.lang.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 java.util.Set<java.lang.String> keySet()
Returns an unmodifiable set of keys.

Returns:
The set of keys

iterator

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

Specified by:
iterator in interface java.lang.Iterable<java.lang.String>

values

public java.util.Set<java.lang.String> values()
Set of the values in the map.


main

public static void main(java.lang.String[] args)


Stanford NLP Group