Top Fields Constructors Methods
org.apache.derby.impl.services.uuid

public Class BasicUUID

extends Object
implements UUID, Formatable
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.services.io.Formatable, org.apache.derby.iapi.services.io.TypedFormat, java.io.Externalizable, java.io.Serializable, org.apache.derby.catalog.UUID
Imports
org.apache.derby.iapi.services.io.StoredFormatIds, .Formatable, org.apache.derby.catalog.UUID, java.io.ObjectOutput, .ObjectInput, .IOException, .StringReader

Field Summary

Modifier and TypeField and Description
private long
private int
private long

Constructor Summary

AccessConstructor and Description
public
BasicUUID(long majorId, long timemillis, int sequence)

Constructor only called by BasicUUIDFactory.

public
BasicUUID(String uuidstring)

Constructor only called by BasicUUIDFactory.

public

Method Summary

Modifier and TypeMethod and Description
public UUID

Returns:

a copy of this UUID
cloneMe
()

Implements org.apache.derby.catalog.UUID.cloneMe.

Clone this UUID.

public boolean
equals(Object
the reference object with which to compare.
otherObject
)

Overrides java.lang.Object.equals.

Implement value equality.

public int
public int
hashCode()

Overrides java.lang.Object.hashCode.

Provide a hashCode which is compatible with the equals() method.

public void
readExternal(ObjectInput
the stream to read data from in order to restore the object
in
)

Implements java.io.Externalizable.readExternal.

Read this in

private static long
readMSB(StringReader sr)

Read a long value, msb first, from its character representation in the string reader, using '-' or end of string to delimit.

public String

Returns:

string representation of UUID.
stringWorkhorse
(char
Character to separate number blocks. Null means do not include a separator.
separator
)

Private workhorse of the string making routines.

public String
toANSIidentifier()

Implements org.apache.derby.catalog.UUID.toANSIidentifier.

Produce a string representation of this UUID which is suitable for use as a unique ANSI identifier.

public String
toString()

Overrides java.lang.Object.toString.

Produce a string representation of this UUID which can be passed to UUIDFactory.recreateUUID later on to reconstruct it.

public void
writeExternal(ObjectOutput
the stream to write the object to
out
)

Implements java.io.Externalizable.writeExternal.

Write this out.

private static void
writeMSB(char[] data, int offset, long value, int nbytes)

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

majorIdback to summary
private long majorId
sequenceback to summary
private int sequence
timemillisback to summary
private long timemillis

Constructor Detail

BasicUUIDback to summary
public BasicUUID(long majorId, long timemillis, int sequence)

Constructor only called by BasicUUIDFactory.

BasicUUIDback to summary
public BasicUUID(String uuidstring)

Constructor only called by BasicUUIDFactory. Constructs a UUID from the string representation produced by toString.

See Also
BasicUUID#toString
BasicUUIDback to summary
public BasicUUID()

Method Detail

cloneMeback to summary
public UUID cloneMe()

Implements org.apache.derby.catalog.UUID.cloneMe.

Clone this UUID.

Returns:UUID

a copy of this UUID

equalsback to summary
public boolean equals(Object otherObject)

Overrides java.lang.Object.equals.

Implement value equality.

Parameters
otherObject:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

getTypeFormatIdback to summary
public int getTypeFormatId()

Implements org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

Return my format identifier.

Returns:int

Doc from org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

The identifier. (A UUID stuffed in an array of 16 bytes).

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Provide a hashCode which is compatible with the equals() method.

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object

readExternalback to summary
public void readExternal(ObjectInput in) throws IOException

Implements java.io.Externalizable.readExternal.

Read this in

Parameters
in:ObjectInput

Doc from java.io.Externalizable.readExternal.

the stream to read data from in order to restore the object

Exceptions
IOException:
error reading from log stream
readMSBback to summary
private static long readMSB(StringReader sr)

Read a long value, msb first, from its character representation in the string reader, using '-' or end of string to delimit.

stringWorkhorseback to summary
public String stringWorkhorse(char separator)

Private workhorse of the string making routines.

Parameters
separator:char

Character to separate number blocks. Null means do not include a separator.

Returns:String

string representation of UUID.

toANSIidentifierback to summary
public String toANSIidentifier()

Implements org.apache.derby.catalog.UUID.toANSIidentifier.

Produce a string representation of this UUID which is suitable for use as a unique ANSI identifier.

Returns:String

Doc from org.apache.derby.catalog.UUID.toANSIidentifier.

an ANSI identifier

toStringback to summary
public String toString()

Overrides java.lang.Object.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.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Implements java.io.Externalizable.writeExternal.

Write this out.

Parameters
out:ObjectOutput

Doc from java.io.Externalizable.writeExternal.

the stream to write the object to

Exceptions
IOException:
error writing to log stream
writeMSBback to summary
private static void writeMSB(char[] data, int offset, long value, int nbytes)