Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.pqt.autorib.util
Class NameNumberManager  view NameNumberManager download NameNumberManager.java

java.lang.Object
  extended byorg.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:

Field Summary
private  NameGroupManager groups
           
private  int nextNumber
           
private  java.util.TreeMap tree
           
 
Constructor Summary
NameNumberManager(NameGroupManager nameGroupManager)
          Creates new NameNumberManager
 
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
 

Field Detail

groups

private NameGroupManager groups

tree

private java.util.TreeMap tree

nextNumber

private int nextNumber
Constructor Detail

NameNumberManager

public NameNumberManager(NameGroupManager nameGroupManager)
Creates new NameNumberManager

Method Detail

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