org.deckfour.xes.id
Class XID

java.lang.Object
  extended by org.deckfour.xes.id.XID
All Implemented Interfaces:
Cloneable

public class XID
extends Object
implements Cloneable

Implements a unique ID based on UUID.

Author:
Christian W. Guenther (christian@deckfour.org)

Constructor Summary
XID()
          Creates a new XID object.
XID(long msb, long lsb)
          Creates a new XID object.
XID(UUID uuid)
          Creates a new XID object.
 
Method Summary
 Object clone()
          Creates a clone of this ID.
 boolean equals(Object obj)
          Tests XID object for equality.
 int hashCode()
          Returns a hash code for this XID.
static XID parse(String idString)
          Parses an XID object from its text representation.
static XID read(DataInputStream dis)
          Reads a binary-serialized XID from a data input stream.
 String toString()
          Returns the string representation of an XID instance.
static void write(XID id, DataOutputStream dos)
          Serializes an XID object binarily to a data output stream.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XID

public XID()
Creates a new XID object.


XID

public XID(long msb,
           long lsb)
Creates a new XID object.

Parameters:
msb - Most significant bits of an UUID
lsb - Least significant bits of an UUID

XID

public XID(UUID uuid)
Creates a new XID object.

Parameters:
uuid - The UUID implementing XID uniqueness.
Method Detail

parse

public static XID parse(String idString)
Parses an XID object from its text representation.

Parameters:
idString - Text representation of an XID.
Returns:
The parsed XID.

read

public static XID read(DataInputStream dis)
                throws IOException
Reads a binary-serialized XID from a data input stream.

Parameters:
dis - Data input stream to read XID from.
Returns:
The read XID object.
Throws:
IOException

write

public static void write(XID id,
                         DataOutputStream dos)
                  throws IOException
Serializes an XID object binarily to a data output stream.

Parameters:
id - XID to be serialized.
dos - Data output stream to store XID serialization.
Throws:
IOException

equals

public boolean equals(Object obj)
Tests XID object for equality.

Overrides:
equals in class Object

toString

public String toString()
Returns the string representation of an XID instance.

Overrides:
toString in class Object

clone

public Object clone()
Creates a clone of this ID.

Overrides:
clone in class Object

hashCode

public int hashCode()
Returns a hash code for this XID.

Overrides:
hashCode in class Object