|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--one.util.Guid
Implementation of a globally unique identifier (GUID). Globally unique identifiers are 128-bit values as defined by the Open Group's DCE standard and as used in Microsoft's COM and DCOM.
GUIDs are created by a native, platform-dependent library. Currently, Windows and Linux are supported. The Windows library works on Windows 95 (DCOM release), Windows 98, Windows Me, Windows NT 4.0, and Windows 2000.
| Field Summary | |
protected static String |
STRING_TEMPLATE
The template for a string representation of a GUID. |
| Constructor Summary | |
Guid()
Create a new GUID. |
|
Guid(byte[] bytes)
Create a new GUID from the specified byte array. |
|
Guid(DataInput in)
Create a new GUID from the specified data input. |
|
Guid(long high,
long low)
Create a new GUID from the specified high and low value. |
|
Guid(String s)
Create a new GUID from the specified string. |
|
Guid(String s,
char sep)
Create a new GUID from the specified string using the specified separator. |
|
| Method Summary | |
boolean |
equals(Object o)
Determine wheter this GUID equals the specified object. |
protected String |
fill(StringBuffer buf)
Fill the specified string buffer with a string representation of this GUID. |
long |
getHigh()
Get the high double word for this GUID. |
long |
getLow()
Get the low double word for this GUID. |
int |
hashCode()
Get a hash code for this GUID. |
byte[] |
toBytes()
Get the bytes for this GUID. |
String |
toString()
Get a string representation of this GUID. |
String |
toString(char sep)
Get a string representation of this GUID. |
String |
toUnderscoredString()
Get a string representation of this GUID. |
void |
writeBytes(DataOutput out)
Write this GUID to the specified data output. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static final String STRING_TEMPLATE
| Constructor Detail |
public Guid()
public Guid(String s)
throws NumberFormatException
toString() method of this class.s - The string representation of the GUID.NumberFormatException - Signals that the specified string does not have
the expected format.
public Guid(String s,
char sep)
throws NumberFormatException
toString(char)
method of this class.s - The string representation of the GUID.sep - The separator.NumberFormatException - Signals that the specified string does not have
the expected format.public Guid(byte[] bytes)
bytes - The binary representation of new GUID.IllegalArgumentException - Signals that bytes is not 16
bytes long.toBytes()
public Guid(long high,
long low)
high - The most significant 64 bits for the new GUID
as a long.low - The least significant 64 bits for the new GUID
as a long.getHigh(),
getLow()
public Guid(DataInput in)
throws IOException
in - The data input to read the new GUID from.IOException - Signals an exceptional condition when reading from
the specified data input.| Method Detail |
public boolean equals(Object o)
equals in class Objecttrue if o is a GUID with
the same 128-bit value.public int hashCode()
hashCode in class Object
public void writeBytes(DataOutput out)
throws IOException
out - The data output to write the GUID to.IOException - Signals an exceptional condition when writing
to the specified data output.public long getHigh()
long.public long getLow()
long.public byte[] toBytes()
public String toString()
toString in class Objectpublic String toUnderscoredString()
public String toString(char sep)
sep - The separator.protected String fill(StringBuffer buf)
00000000-0000-0000-0000-000000000000", where
'-' may be replaced with any other character used as
a separator.buf - The string buffer to fill.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||