|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mro.util.UniqueIdentifier
public class UniqueIdentifier
A UniqueIdentifier for an object based on the Class name and two longs: the current system time and the current thread ID. Note: it is only the name of the class that is stored, not the entire object.
Thread
Field Summary | |
---|---|
private java.lang.String |
ownerClassName
A String containing the full name of the class of the owner object. |
private long |
threadID
The Thread in which the UniqueIdentifier was created. |
private long |
time
The creation time of the UniqueIdentifier. |
Constructor Summary | |
---|---|
UniqueIdentifier()
Constructor. |
|
UniqueIdentifier(long time,
long threadID,
java.lang.Object o)
Constructor. |
|
UniqueIdentifier(long time,
long threadID,
java.lang.String ownerClassName)
Constructor. |
|
UniqueIdentifier(java.lang.Object o)
Constructor. |
|
UniqueIdentifier(java.lang.String ownerClassName)
Constructor. |
|
UniqueIdentifier(UniqueIdentifier ui)
Copy constructor. |
Method Summary | |
---|---|
boolean |
endElementPartXML(java.lang.StringBuffer buffer,
java.lang.String qualifiedName)
Use when defining a DefaultHandler
to parse a larger XML-file where a UniqueIdentifier is a part. |
boolean |
equals(java.lang.Object obj)
Compares two UniqueIdentifiers. |
java.lang.String |
getDTDElementName()
Returns a String with the name of the element defining a UniqueIdentifier in a DTD. |
java.lang.String |
getOwnerClassName()
Returns the full name of the class of the owning object. |
long |
getThreadID()
Returns the ID of the Thread in which this UniqueIdentifier was created. |
long |
getTime()
Returns the time for the creation this UniqueIdentifier. |
void |
printPartDTD(java.io.PrintWriter out)
Prints the DTD for a UniqueIndentifier. |
void |
printPartXML(java.io.PrintWriter out)
Prints this UniqueIdentifier to a PrintWriter as a part of a larger XML-file following the DTD in printPartDTD(java.io.PrintWriter) . |
boolean |
startElementPartXML(java.lang.StringBuffer buffer,
java.lang.String qualifiedName)
Use when defining a DefaultHandler
to parse a larger XML-file where a UniqueIdentifier is a part. |
static void |
staticPrintPartDTD(java.io.PrintWriter out)
Prints the DTD for a UniqueIndentifier. |
java.lang.String |
toString()
Just for printing to screen. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.String ownerClassName
private long time
private long threadID
Constructor Detail |
---|
public UniqueIdentifier()
public UniqueIdentifier(java.lang.Object o)
public UniqueIdentifier(java.lang.String ownerClassName)
public UniqueIdentifier(UniqueIdentifier ui)
public UniqueIdentifier(long time, long threadID, java.lang.Object o)
public UniqueIdentifier(long time, long threadID, java.lang.String ownerClassName)
Method Detail |
---|
public long getTime()
public long getThreadID()
public java.lang.String getOwnerClassName()
public java.lang.String getDTDElementName()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static void staticPrintPartDTD(java.io.PrintWriter out)
<!--A Unique Identifier--> <!ELEMENT UniqueIdentifier (OwnerClassName, Time, Thread)> <!ELEMENT OwnerClassName (#PCDATA)> <!--Class of the object it identifies--> <!ELEMENT Time (#PCDATA)> <!--System Time of Creation--> <!ELEMENT Thread (#PCDATA)> <!--ThreadID-->
public void printPartDTD(java.io.PrintWriter out)
XMLPartIO
printPartDTD
in interface XMLPartIO
public void printPartXML(java.io.PrintWriter out)
printPartDTD(java.io.PrintWriter)
.
printPartXML
in interface XMLPartIO
public boolean startElementPartXML(java.lang.StringBuffer buffer, java.lang.String qualifiedName)
DefaultHandler
to parse a larger XML-file where a UniqueIdentifier is a part.
This particular instance always returns false, as no
information on the start of these tags are nedeed.
startElementPartXML
in interface XMLPartIO
public boolean endElementPartXML(java.lang.StringBuffer buffer, java.lang.String qualifiedName)
DefaultHandler
to parse a larger XML-file where a UniqueIdentifier is a part.
Returns true when the elements in the DTD
(see printPartDTD(java.io.PrintWriter)
) are found.
In these cases the content of the UniqueIdentifier are
set to the the values found in the XML-file.
endElementPartXML
in interface XMLPartIO
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |