java.lang.Object
org.pqt.autorib.util.NameNumberManager
- public class NameNumberManager
- extends java.lang.Object
This class allows you to allocate a number to
an object, based on the object's name. It allows
names to be grouped, so that even if the two names
are different the number allocated to them will be
the same
- Version:
|
Method Summary |
int |
getNumber(java.lang.String name)
Calculate a number to correspond to a given name
checking first against the defined groups
and if no match is found allocating a number |
void |
write(java.io.Writer out)
Write out a list of names (sorted) and their
equivalent numbers |
void |
write(java.io.Writer out,
boolean byName)
Write out a list of the names and numbers to
the given output. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
groups
private NameGroupManager groups
tree
private java.util.TreeMap tree
nextNumber
private int nextNumber
NameNumberManager
public NameNumberManager(NameGroupManager nameGroupManager)
- Creates new NameNumberManager
getNumber
public int getNumber(java.lang.String name)
- Calculate a number to correspond to a given name
checking first against the defined groups
and if no match is found allocating a number
write
public void write(java.io.Writer out,
boolean byName)
throws java.io.IOException
- Write out a list of the names and numbers to
the given output. Note that only those names and numbers that have actually
been used in an AppendNumber request are printed, because it is only when there
is an AppendNumber request that an objects number is actaully calculated
write
public void write(java.io.Writer out)
throws java.io.IOException
- Write out a list of names (sorted) and their
equivalent numbers