For example, if the first object instance javax.swing.JButton
is passed into instanceName then the returned
string identifier will be "JButton0".
| Modifier and Type | Field and Description |
|---|---|
| private Map | |
| private Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static String | |
| public void | |
| public String | Returns: a unique string representing the objectobject used to generate string instance)Returns a unique string which identifies the object instance. |
| public static String |
| nameToCount | back to summary |
|---|---|
| private Map<String, Integer> nameToCount | |
| valueToName | back to summary |
|---|---|
| private Map<Object, String> valueToName | |
| NameGenerator | back to summary |
|---|---|
| public NameGenerator() | |
| capitalize | back to summary |
|---|---|
| public static String capitalize(String name) Returns a String which capitalizes the first letter of the string. | |
| clear | back to summary |
|---|---|
| public void clear() Clears the name cache. Should be called to near the end of the encoding cycle. | |
| instanceName | back to summary |
|---|---|
| public String instanceName(Object instance) Returns a unique string which identifies the object instance. Invocations are cached so that if an object has been previously passed into this method then the same identifier is returned. | |
| unqualifiedClassName | back to summary |
|---|---|
| public static String unqualifiedClassName(Class<T> type) Returns the root name of the class.
| |