Class BasicUUID
- java.lang.Object
-
- org.apache.derby.impl.services.uuid.BasicUUID
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,UUID,Formatable,TypedFormat
public class BasicUUID extends java.lang.Object implements UUID, Formatable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private longmajorIdprivate intsequenceprivate longtimemillis-
Fields inherited from interface org.apache.derby.catalog.UUID
NULL, UUID_BYTE_LENGTH
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description UUIDcloneMe()Clone this UUID.booleanequals(java.lang.Object otherObject)Implement value equality.intgetTypeFormatId()Return my format identifier.inthashCode()Provide a hashCode which is compatible with the equals() method.voidreadExternal(java.io.ObjectInput in)Read this inprivate static longreadMSB(java.io.StringReader sr)Read a long value, msb first, from its character representation in the string reader, using '-' or end of string to delimit.java.lang.StringstringWorkhorse(char separator)Private workhorse of the string making routines.java.lang.StringtoANSIidentifier()Produce a string representation of this UUID which is suitable for use as a unique ANSI identifier.java.lang.StringtoString()Produce a string representation of this UUID which can be passed to UUIDFactory.recreateUUID later on to reconstruct it.voidwriteExternal(java.io.ObjectOutput out)Write this out.private static voidwriteMSB(char[] data, int offset, long value, int nbytes)
-
-
-
Constructor Detail
-
BasicUUID
public BasicUUID(long majorId, long timemillis, int sequence)Constructor only called by BasicUUIDFactory.
-
BasicUUID
public BasicUUID(java.lang.String uuidstring)
Constructor only called by BasicUUIDFactory. Constructs a UUID from the string representation produced by toString.- See Also:
toString()
-
BasicUUID
public BasicUUID()
-
-
Method Detail
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOExceptionWrite this out.- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException- error writing to log stream
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOExceptionRead this in- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException- error reading from log stream
-
getTypeFormatId
public int getTypeFormatId()
Return my format identifier.- Specified by:
getTypeFormatIdin interfaceTypedFormat- Returns:
- The identifier. (A UUID stuffed in an array of 16 bytes).
-
writeMSB
private static void writeMSB(char[] data, int offset, long value, int nbytes)
-
readMSB
private static long readMSB(java.io.StringReader sr)
Read a long value, msb first, from its character representation in the string reader, using '-' or end of string to delimit.
-
equals
public boolean equals(java.lang.Object otherObject)
Implement value equality.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Provide a hashCode which is compatible with the equals() method.- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
Produce a string representation of this UUID which can be passed to UUIDFactory.recreateUUID later on to reconstruct it. The funny representation is designed to (sort of) match the format of Microsoft's UUIDGEN utility.- Overrides:
toStringin classjava.lang.Object
-
toANSIidentifier
public java.lang.String toANSIidentifier()
Produce a string representation of this UUID which is suitable for use as a unique ANSI identifier.- Specified by:
toANSIidentifierin interfaceUUID
-
stringWorkhorse
public java.lang.String stringWorkhorse(char separator)
Private workhorse of the string making routines.- Parameters:
separator- Character to separate number blocks. Null means do not include a separator.- Returns:
- string representation of UUID.
-
-