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 unique integer serial numbers to a family of objects, identified
by a name space. A Numberer is like a collection of Index
es,
and for
many purposes it is more straightforward to use an Index, but
Numberer can be useful precisely because it maintains a global name
space for numbered object families, and provides facilities for mapping
across numberings within that space. At any rate, it's widely used in
some existing packages.
- Author:
- Dan Klein
- See Also:
- Serialized Form
Numberer
public Numberer()
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)
objects
public Set objects()
number
public int number(Object o)
object
public Object object(int n)
toString
public String toString()
Stanford NLP Group