|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectbyucc.edif.AbstractNameSpaceResolver
public abstract class AbstractNameSpaceResolver
Abstract class that contains methods for name space resolvers. Other name space classes will call the methods of this one. If another data type is desired for the name space then in the constructor of the other name space object _names is instantiated. This class is abstract and doesn't and doesn't implement an interface because interface methods can't be declared abstract. TODO: this class supports both maps and collections. This should probably be split up.
| Constructor Summary | |
|---|---|
AbstractNameSpaceResolver()
|
|
| Method Summary | |
|---|---|
protected static char |
incrementDigit(char c)
This method will perform an "increment" on a character. |
protected static java.lang.String |
incrementString(java.lang.String str)
|
static void |
main(java.lang.String[] args)
|
static boolean |
nameClash(java.util.Collection list,
java.lang.String newName)
Returns true if name does not clash with name space. |
static boolean |
nameClash(java.util.Map map,
java.lang.String name)
Returns true if name does not clash with name space. |
static java.lang.String |
returnNextString(java.lang.String orig)
The algorithm for creating a new unique name is as follows: - If the conflicting name does not have a "_", add one to the end as well as "a" - Change the last character and "increment" by one (i.e. |
static java.lang.String |
returnUniqueName(java.util.Collection list,
java.lang.String name)
If the name is valid, return name. |
static java.lang.String |
returnUniqueName(java.util.Map map,
java.lang.String name)
If the name is valid, return name. |
static void |
test_string(java.lang.String str)
|
static java.lang.String |
toString(java.util.Collection list)
Returns a string representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractNameSpaceResolver()
| Method Detail |
|---|
public static boolean nameClash(java.util.Collection list,
java.lang.String newName)
newName - Name to check if it already exists in the name space.list - The name space passed to this method.
public static boolean nameClash(java.util.Map map,
java.lang.String name)
name - Name to check if it already exists in the name space.map - The name space passed to this method.
public static java.lang.String returnNextString(java.lang.String orig)
protected static java.lang.String incrementString(java.lang.String str)
protected static char incrementDigit(char c)
c - The character to increment.
public static java.lang.String returnUniqueName(java.util.Collection list,
java.lang.String name)
name - Name to modify, and make unique for this name space.list - The name space passed to this method.
public static java.lang.String returnUniqueName(java.util.Map map,
java.lang.String name)
name - Name to modify, and make unique for this name space.map - The name space passed to this method.
public static java.lang.String toString(java.util.Collection list)
public static void test_string(java.lang.String str)
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||