com.sapportals.portal.prt.util
Class Guid

java.lang.Object
  |
  +--com.sapportals.portal.prt.util.Guid
All Implemented Interfaces:
java.io.Serializable

public class Guid
extends java.lang.Object
implements java.io.Serializable

Globally unique identifier. The Guid internally consists of 16 Bytes of data (internally stored as two long's). Created: Mon Dec 18 10:36:27 2000

Version:
$Revision: #3 $
$File: //workplace/portal/dev/portal/src/java/core/com/sapportals/workplace/util/Guid.java $ , $Revision: #1 $ Last modified on $Date: 2000/12/22 $ by $Author: d029034 $ using $Change: 3954 $ Copyright (c) SAP Portals Europe GmbH 2001
See Also:
Serialized Form

Field Summary
protected  long m_part1
           
protected  long m_part2
           
 
Constructor Summary
Guid()
          This Constructor creates a new Guid with a new value.
Guid(int part1_high, int part1_low, int part2_high, int part2_low)
          This Constructor should not be used anymore because it is slower.
Guid(long part1, long part2)
          Hint for programmers: You can enter a long value in your coding in the following way: long l = 123456789L
 
Method Summary
 int compareTo(Guid guid2)
           
 int compareTo(java.lang.Object o)
           
static void copyBinaryGuidIntoBuffer(byte[] buf, int offset, Guid guid)
           
static void copyBinaryGuidIntoBuffer(char[] buf, int offset, Guid guid)
           
static void copyGuidIntoBuffer(char[] buf, int offset, Guid guid)
           
 boolean equals(Guid guid2)
           
 boolean equals(java.lang.Object o)
           
protected  void fillFromByteArray(byte[] array, int offset)
           
static long fillLongFromByteArray(byte[] array, int offset)
           
 int hashCode()
           
static java.lang.String longToHexString(long l)
           
static java.lang.String longToHexString(java.lang.Long l)
           
static void main(java.lang.String[] args)
           
static Guid parseBinaryCharArray(byte[] s, int beginIndex)
           
static Guid parseBinaryCharArray(char[] s, int beginIndex)
           
static Guid parseHexByteArray(byte[] s, int beginIndex)
           
static Guid parseHexCharArray(char[] s, int beginIndex, int endIndex)
           
static Guid parseHexString(java.lang.String s)
           
 long part1()
           
 long part2()
           
static Guid readGuidFromBytes(byte[] array, int offset)
          This Constructor is a technical one, it reads the next 16 bytes from the array beginning with offset.
 byte[] toByteArray(byte[] buf, int offset)
           
 byte[] toBytes()
           
 java.lang.String toHexString()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

m_part1

protected long m_part1

m_part2

protected long m_part2
Constructor Detail

Guid

public Guid(long part1,
            long part2)
Hint for programmers: You can enter a long value in your coding in the following way:

long l = 123456789L


Guid

public Guid()
This Constructor creates a new Guid with a new value. ...to be honest: The Guid is assembled out of a random value and a time stamp. If this is not "unique enough" then please find the Guid on your own and use the other constructors...

Guid

public Guid(int part1_high,
            int part1_low,
            int part2_high,
            int part2_low)
This Constructor should not be used anymore because it is slower.
Method Detail

longToHexString

public static final java.lang.String longToHexString(long l)

longToHexString

public static final java.lang.String longToHexString(java.lang.Long l)

copyGuidIntoBuffer

public static final void copyGuidIntoBuffer(char[] buf,
                                            int offset,
                                            Guid guid)

copyBinaryGuidIntoBuffer

public static final void copyBinaryGuidIntoBuffer(char[] buf,
                                                  int offset,
                                                  Guid guid)

copyBinaryGuidIntoBuffer

public static final void copyBinaryGuidIntoBuffer(byte[] buf,
                                                  int offset,
                                                  Guid guid)

parseHexString

public static final Guid parseHexString(java.lang.String s)

parseHexCharArray

public static final Guid parseHexCharArray(char[] s,
                                           int beginIndex,
                                           int endIndex)

parseHexByteArray

public static final Guid parseHexByteArray(byte[] s,
                                           int beginIndex)

parseBinaryCharArray

public static final Guid parseBinaryCharArray(char[] s,
                                              int beginIndex)

parseBinaryCharArray

public static final Guid parseBinaryCharArray(byte[] s,
                                              int beginIndex)

fillLongFromByteArray

public static long fillLongFromByteArray(byte[] array,
                                         int offset)

readGuidFromBytes

public static Guid readGuidFromBytes(byte[] array,
                                     int offset)
This Constructor is a technical one, it reads the next 16 bytes from the array beginning with offset.

toString

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

hashCode

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

equals

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

equals

public final boolean equals(Guid guid2)

compareTo

public final int compareTo(java.lang.Object o)

compareTo

public final int compareTo(Guid guid2)

toHexString

public final java.lang.String toHexString()

toByteArray

public final byte[] toByteArray(byte[] buf,
                                int offset)

toBytes

public final byte[] toBytes()

fillFromByteArray

protected void fillFromByteArray(byte[] array,
                                 int offset)

main

public static void main(java.lang.String[] args)

part1

public long part1()

part2

public long part2()