All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.stanford.nlp.util.TypesafeMap Maven / Gradle / Ivy

Go to download

Stanford Parser processes raw text in English, Chinese, German, Arabic, and French, and extracts constituency parse trees.

There is a newer version: 3.9.2
Show newest version
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();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy