|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Utils.IndexedStringTable
Class that defines a container of Strings indexed by their creation rank. You can get a string by its number or the number by its String.
Field Summary | |
---|---|
protected java.util.Vector |
instances
List of instances of the IndexedStringTable |
protected java.util.Hashtable |
myInstanceCounter
List of instances of the IndexedStringTable |
protected java.util.Hashtable |
myListOfInstance
List of instances of the IndexedStringTable |
protected int |
nbInstances
Nb maximum of different Strings |
Constructor Summary | |
---|---|
IndexedStringTable()
|
Method Summary | |
---|---|
private void |
addInstance(java.lang.String str)
Add a new String in the IndexedStringTable |
void |
addString(java.lang.String str,
boolean val)
Add a new String in the IndexedStringTable if its not already present. |
private boolean |
contains(java.lang.String str)
Checks whether the String is already present within the instances |
private java.util.Hashtable |
getListOfInstances()
Get the list of instances of the IndexedStringTable |
int |
getNbInstances()
Get the nb of different Strings |
int |
getNbInstances(java.lang.String str)
Get the nb of instances of one particular String |
int |
getNumberFromString(java.lang.String str)
Get the number of one String |
java.lang.String |
getStringFromNumber(int index)
Get one String from its number |
static void |
main(java.lang.String[] args)
A test routine |
private void |
setListOfInstances(java.util.Hashtable myLOI)
Set the list of instances of the IndexedStringTable |
java.lang.String |
toString()
Return a String describing the RelevantPointType instance |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.Vector instances
protected java.util.Hashtable myListOfInstance
protected java.util.Hashtable myInstanceCounter
protected int nbInstances
Constructor Detail |
public IndexedStringTable()
Method Detail |
private final void setListOfInstances(java.util.Hashtable myLOI)
private final java.util.Hashtable getListOfInstances()
private boolean contains(java.lang.String str)
private final void addInstance(java.lang.String str)
public final int getNbInstances()
public final int getNbInstances(java.lang.String str)
public final java.lang.String getStringFromNumber(int index)
public final int getNumberFromString(java.lang.String str)
public void addString(java.lang.String str, boolean val)
str
- is the String to addval
- is true if the String should be counted as a new instancepublic java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |