Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
gnu.java.beans.encoder.ObjectId
<class><Nameindex>
.
Each id can be in an unused state which means that only one instance of the
object is in use and a special id is not needed. Certain Element
subclasses use this feature to find
out whether they write the "id" attribute or not.
An ObjectId
instance is typically given to multiple objects.
The second user should then invoke the init()
method to generate the
identification string and bring the id in the 'used' state.
Method Summary | |
void |
|
boolean |
|
String |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public void init()
Generates a simple Id by concatenating a class name with a self-increasing number.
public String toString()
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it intoSystem.out.println()
and such.It is typical, but not required, to ensure that this method never completes abruptly with a
RuntimeException
.This method will be called when performing string concatenation with this object. If the result is
null
, string concatenation will instead use"null"
.The default implementation returns
getClass().getName() + "@" + Integer.toHexString(hashCode())
.
- Returns:
- the String representing this Object, which may be null
- See Also:
getClass()
,Object.hashCode()
,Class.getName()
,Integer.toHexString(int)