edu.stanford.nlp.util.TypesafeMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stanford-parser Show documentation
Show all versions of stanford-parser Show documentation
Stanford Parser processes raw text in English, Chinese, German, Arabic, and French, and extracts constituency parse trees.
package edu.stanford.nlp.util;
import java.util.Set;
/**
* Type signature for a class that supports the basic operations required
* of a typesafe heterogeneous map.
*
* @author dramage
*/
public interface TypesafeMap {
/**
* Base type of keys for the map. The classes that implement Key are
* the keys themselves - not instances of those classes.
*
* @param The type of the value associated with this key.
*/
interface Key { }
/**
* Returns the value associated with the given key or null if
* none is provided.
*/
VALUE get(Class> key);
/**
* Associates the given value with the given type for future calls
* to get. Returns the value removed or null if no value was present.
*/
VALUE set(Class> key, VALUE value);
/**
* Removes the given key from the map, returning the value removed.
*/
VALUE remove(Class> key);
/**
* Collection of keys currently held in this map. Some implementations may
* have the returned set be immutable.
*/
Set> keySet();
//public Set>> keySet();
/**
* Returns true if contains the given key.
*/
boolean containsKey(Class> key);
/**
* Returns the number of keys in the map.
*/
int size();
}