|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.util.Id
public final class Id
Id's are objects that uniquely characterize objects. Id's can only be obtained via the static forName() method. This method ensures that the Id object for a given String is unique. As a consequence one may assume that Id's can be compared for equality by means of the "==" test. This results in very efficient equality testing for Id's, even when these are based on (long) Strings like URI's etc.
| Field Summary | |
|---|---|
private int |
hash
|
private static int |
ID_HASHMAP_SIZE
|
private static Map<String,Id> |
ids
|
private String |
idString
|
| Constructor Summary | |
|---|---|
private |
Id(String idString)
|
| Method Summary | |
|---|---|
Object |
clone()
Real cloning an Id is not permitted, as it would violate the assumption that Id's are unique objects. |
static Id |
forName(String idString)
returns the Id object for idString. |
static Id |
getId(String idString)
Equivalent to Id.forName. returns the Id object for idString. |
int |
hashCode()
optimized hashCode, uses cached hash code of the id String |
String |
toString()
The String representation of this Id object. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private String idString
private int hash
private static final int ID_HASHMAP_SIZE
private static Map<String,Id> ids
| Constructor Detail |
|---|
private Id(String idString)
| Method Detail |
|---|
public String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic Object clone()
clone in class Objectpublic static Id forName(String idString)
public static Id getId(String idString)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||