edu.stanford.nlp.util
Class Numberer

java.lang.Object
  |
  +--edu.stanford.nlp.util.Numberer
All Implemented Interfaces:
Serializable

public class Numberer
extends Object
implements Serializable

Gives a unique integer serial numbers to a family of objects, identified by a name space.

Author:
Dan Klein
See Also:
Serialized Form

Constructor Summary
Numberer()
           
 
Method Summary
static Numberer getGlobalNumberer(String type)
           
static Map getNumberers()
           
 boolean hasSeen(Object o)
           
 void lock()
           
 int number(Object o)
           
static int number(String type, Object o)
           
 Object object(int n)
           
static Object object(String type, int n)
           
static void setNumberers(Map numbs)
           
 String toString()
           
 int total()
           
static int translate(String sourceType, String targetType, int n)
          For an Object o that occurs in Numberers of type sourceType and targetType, translates the serial number n of o in the sourceType Numberer to the serial number in the targetType Numberer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Numberer

public Numberer()
Method Detail

getNumberers

public static Map getNumberers()

setNumberers

public static void setNumberers(Map numbs)

getGlobalNumberer

public static Numberer getGlobalNumberer(String type)

number

public static int number(String type,
                         Object o)

object

public static Object object(String type,
                            int n)

translate

public static int translate(String sourceType,
                            String targetType,
                            int n)
For an Object o that occurs in Numberers of type sourceType and targetType, translates the serial number n of o in the sourceType Numberer to the serial number in the targetType Numberer.


total

public int total()

lock

public void lock()

hasSeen

public boolean hasSeen(Object o)

number

public int number(Object o)

object

public Object object(int n)

toString

public String toString()
Overrides:
toString in class Object


Stanford NLP Group