|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.woden.ant.ObjectIdTable
public class ObjectIdTable
Provides a completely safe way to generate unique ids for equivalence classes of objects. Equivalent objects are assigned the same ids. Inequivalent objects are assigned different ids. Here equivalance is defined by the equals() method which is used by HashMap. Experience has shown that hashCode() occasionally produces the same hash for different objects. Note that the objects are permanently stored, so only use this class when serializing objects in an XML file. A count is kept and assigned to each object equivalence class as it is added.
Constructor Summary | |
---|---|
ObjectIdTable()
|
Method Summary | |
---|---|
int |
id(java.lang.Object o)
Returns a unique integer for the equivalence class of the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ObjectIdTable()
Method Detail |
---|
public int id(java.lang.Object o)
o
- An object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |