|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jackrabbit.uuid.UUID
UUID
represents a Universally Unique Identifier per IETF
Draft specification. For more information regarding the IETF Draft UUID
specification
See: http://www.ietf.org/internet-drafts/draft-mealling-uuid-urn-01.txt
This is a lightweight implementation of an UUID, disregarding the different versions of UUIDs.
Field Summary |
Constructor Summary | |
UUID(byte[] b)
Constructs a UUID from a 16 byte array. |
|
UUID(DataInput input)
Constructs a UUID from a DataInput. |
|
UUID(long mostSignificant,
long leastSignificant)
Constructs a UUID from two long values in most significant byte, and least significant bytes order. |
|
UUID(String uuidString)
Constructs a UUID from a UUID formatted String. |
Method Summary | |
int |
compareTo(Object compareTo)
Compares two UUID's for equality |
boolean |
equals(Object obj)
Compares two UUID for equality. |
static UUID |
fromString(String uuidString)
Parses a string for a UUID. |
long |
getLeastSignificantBits()
Returns the least significant bits stored in the uuid's internal structure. |
long |
getMostSignificantBits()
Returns the most significant bits stored in the uuid's internal structure. |
byte[] |
getRawBytes()
Returns a copy of the byte values contained in this UUID. |
int |
hashCode()
Returns a hash code value for the object. |
static UUID |
randomUUID()
Returns a new version 4 UUID, based upon Random bits. |
String |
toString()
Returns a string representation of the UUID. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public UUID(byte[] b) throws IllegalArgumentException
Constructs a UUID from a 16 byte array.
b
- the 16 byte array to construct this UUID from.
IllegalArgumentException
- argument must be 16 bytespublic UUID(DataInput input) throws IOException
Constructs a UUID from a DataInput. Note if 16 bytes are not available this method will block.
input
- the datainput with 16 bytes to read in from.
IOException
- exception if there is an IO problem also argument must contain 16 bytes.public UUID(long mostSignificant, long leastSignificant)
Constructs a UUID from two long values in most significant byte, and least significant bytes order.
mostSignificant
- - the most significant 8 bytes of the uuid to be constructed.leastSignificant
- - the least significant 8 bytes of the uuid to be constructed.public UUID(String uuidString) throws IllegalArgumentException
Constructs a UUID from a UUID formatted String.
uuidString
- the String representing a UUID to construct this UUID
IllegalArgumentException
- String must be a properly formatted UUID stringMethod Detail |
public static UUID fromString(String uuidString) throws IllegalArgumentException
Parses a string for a UUID.
uuidString
- the UUID formatted String to parse.
IllegalArgumentException
- the String must be a properly formatted UUID String.public String toString()
Returns a string representation of the UUID.
public boolean equals(Object obj)
Compares two UUID for equality.
Object.equals(Object)
public int hashCode()
Returns a hash code value for the object.
Object.hashCode()
public int compareTo(Object compareTo) throws ClassCastException
Compares two UUID's for equality
compareTo
in interface Comparable
ClassCastException
Comparable.compareTo(Object)
public long getLeastSignificantBits()
Returns the least significant bits stored in the uuid's internal structure.
public long getMostSignificantBits()
Returns the most significant bits stored in the uuid's internal structure.
public byte[] getRawBytes()
Returns a copy of the byte values contained in this UUID.
public static UUID randomUUID()
Returns a new version 4 UUID, based upon Random bits.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |