com.sap.tc.mobile.cfs.utils.api
Class GUID

java.lang.Object
  extended by com.sap.tc.mobile.cfs.utils.api.GUID
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class GUID
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

GUID class.

Author:
D039184
See Also:
Serialized Form

Field Summary
protected  long hiBytes
           
protected  long loBytes
           
 
Constructor Summary
GUID()
          Construct a new GUID.
GUID(byte[] bytes)
          Construct GUID from bytes.
GUID(byte[] bytes, int pos)
          Construct GUID from bytes.
GUID(char[] data, int pos)
          Construct GUID from hex characters.
GUID(long h, long l)
          Construct GUID from two longs.
GUID(java.lang.String hexString)
          Construct GUID from hex string.
 
Method Summary
protected  void _setData(byte[] bytes, int pos)
          Set GUID from bytes.
protected  void _setData(char[] data, int pos)
          Set GUID from hex characters.
protected  void _setData(java.lang.String hexString)
          Set GUID from hex string.
 java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
           
 void getBytes(byte[] data, int startPos)
          Fill in byte data with GUID.
 void getCharData(char[] data, int startPos)
          Fill in character data with hex representation of this GUID.
 void getCharData(java.io.Writer writer)
          Writes GUID on the stream, in an efficient way.
 long getHi8()
          Get high 8 bytes of the GUID as long.
 long getLo8()
          Get low 8 bytes of the GUID as long.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

loBytes

protected long loBytes

hiBytes

protected long hiBytes
Constructor Detail

GUID

public GUID()
Construct a new GUID.


GUID

public GUID(java.lang.String hexString)
Construct GUID from hex string.

Parameters:
hexString - hex string with 32 characters.

GUID

public GUID(char[] data,
            int pos)
Construct GUID from hex characters.

Parameters:
data - data with 32 characters.
pos - starting position of the GUID in array.

GUID

public GUID(byte[] bytes)
Construct GUID from bytes.

Parameters:
bytes - 16 bytes of the GUID.

GUID

public GUID(byte[] bytes,
            int pos)
Construct GUID from bytes.

Parameters:
bytes - 16 bytes of the GUID.
pos - starting position of GUID in array.

GUID

public GUID(long h,
            long l)
Construct GUID from two longs.

Parameters:
h - high 8 bytes.
l - low 8 bytes.
Method Detail

_setData

protected final void _setData(java.lang.String hexString)
Set GUID from hex string.

Parameters:
hexString - hexString hex string with 32 characters.

_setData

protected final void _setData(char[] data,
                              int pos)
Set GUID from hex characters.

Parameters:
data - data with 32 characters.
pos - starting position of the GUID in array.

_setData

protected final void _setData(byte[] bytes,
                              int pos)
Set GUID from bytes.

Parameters:
bytes - 16 bytes of the GUID.
pos - starting position of GUID in array.

getCharData

public final void getCharData(char[] data,
                              int startPos)
Fill in character data with hex representation of this GUID.

Parameters:
data - data array to fill.
startPos - start position in the array.

getBytes

public final void getBytes(byte[] data,
                           int startPos)
Fill in byte data with GUID.

Parameters:
data - data to fill in.
startPos - starting position where to write data.

getLo8

public final long getLo8()
Get low 8 bytes of the GUID as long.

Returns:
low 8 bytes of the GUID.

getHi8

public final long getHi8()
Get high 8 bytes of the GUID as long.

Returns:
high 8 bytes of the GUID.

equals

public final boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public final int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public final java.lang.String toString()
Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

getCharData

public void getCharData(java.io.Writer writer)
                 throws java.io.IOException
Writes GUID on the stream, in an efficient way.

Parameters:
writer -
Throws:
java.io.IOException