Class GUID


  • public class GUID
    extends java.lang.Object
    GUIDs identify objects such as interfaces, manager entry-point vectors (EPVs), and class objects. A GUID is a 128-bit value consisting of one group of 8 hexadecimal digits, followed by three groups of 4 hexadecimal digits each, followed by one group of 12 hexadecimal digits. The following example shows the groupings of hexadecimal digits in a GUID.
    6B29FC40-CA47-1067-B31D-00DD010662DA
     typedef struct _GUID {
                    DWORD Data1;
                    WORD Data2;
                    WORD Data3;
                    BYTE Data4[8];
     } GUID;
     
    Data1 - Specifies the first 8 hexadecimal digits of the GUID.
    Data2 - Specifies the first group of 4 hexadecimal digits.
    Data3 - Specifies the second group of 4 hexadecimal digits.
    Data4 - Array of 8 bytes. The first 2 bytes contain the third group of 4 hexadecimal digits. The remaining 6 bytes contain the final 12 hexadecimal digits.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int SIZEOF  
    • Constructor Summary

      Constructors 
      Constructor Description
      GUID​(int data1, short data2, short data3, byte[] data4)
      Constructs a GUID using the constitute pieces.
      GUID​(BinaryReader reader)
      Reads a GUID from the given binary reader.
      GUID​(MemBuffer buf)
      Reads a GUID from the given memory buffer.
      GUID​(java.lang.String guidString)
      Creates a GUID object using the GUID string form.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      int getData1()
      Specifies the first 8 hexadecimal digits of the GUID.
      short getData2()
      Specifies the first group of 4 hexadecimal digits.
      short getData3()
      Specifies the second group of 4 hexadecimal digits.
      byte[] getData4()
      Array of 8 bytes.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • GUID

        public GUID​(java.lang.String guidString)
        Creates a GUID object using the GUID string form.
        Parameters:
        guidString - - "6B29FC40-CA47-1067-B31D-00DD010662DA"
        Throws:
        java.lang.IllegalArgumentException - if string does not represent a valid GUID
      • GUID

        public GUID​(int data1,
                    short data2,
                    short data3,
                    byte[] data4)
        Constructs a GUID using the constitute pieces.
      • GUID

        public GUID​(BinaryReader reader)
             throws java.io.IOException
        Reads a GUID from the given binary reader.
        Parameters:
        reader - the binary reader to read the GUID
        Throws:
        java.io.IOException - if an I/O error occurs while reading the GUID
    • Method Detail

      • toString

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

        public int getData1()
        Specifies the first 8 hexadecimal digits of the GUID.
        Returns:
      • getData2

        public short getData2()
        Specifies the first group of 4 hexadecimal digits.
        Returns:
      • getData3

        public short getData3()
        Specifies the second group of 4 hexadecimal digits.
        Returns:
      • getData4

        public byte[] getData4()
        Array of 8 bytes. The first 2 bytes contain the third group of 4 hexadecimal digits. The remaining 6 bytes contain the final 12 hexadecimal digits.
        Returns:
      • hashCode

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

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