Packages
 In this topic

*Constructors

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.com   Previous This
Package
Next

 


Class _Guid

public final class _Guid
{
  // Constructors
  public _Guid(byte [] ba);
  public _Guid(int d1, short d2, short d3, byte b8, byte b9,
        byte b10, byte b11, byte b12, byte b13, byte b14,
        byte b15);
  public _Guid(String str);
  public _Guid();

  // Methods
  public boolean equals(Object g2);
  public int hashCode();
  public void set(byte [] ba);
  public void set(String str);
  public void set(int d1, short d2, short d3, byte b8, byte b9,
        byte b10, byte b11, byte b12, byte b13, byte b14,
        byte b15);
  public byte [] toByteArray();
  public String toString();
}

This class represents globally unique identifiers (GUIDs), which are 128-bit integer values that are used to assign world-wide unique identifiers for COM interfaces and CoClasses. The jactivex tool maps all GUIDs found in a type library to instances of the _Guid class.

Constructors

_Guid

public _Guid(byte [] ba);

Constructs a new _Guid object, whose value matches the internal representation of the specified 16-element byte array.

Caution This constructor form is efficient but not endian-portable. Its use, therefore, is not recommended for cross-platform applications.

ParameterDescription
ba The 16-element byte array.

_Guid

public _Guid(int d1, short d2, short d3, byte b8, byte b9, byte b10,
        byte b11, byte b12, byte b13, byte b14, byte b15);

Constructs a new _Guid object. whose value is specified by the internal representations of the parameters d1 through b15 in order.

ParameterDescription
d1 A 32-bit integer.
d2 A 16-bit integer.
d3 A 16-bit integer.
b8 An 8-bit integer.
b9 An 8-bit integer.
b10 An 8-bit integer.
b11 An 8-bit integer.
b12 An 8-bit integer.
b13 An 8-bit integer.
b14 An 8-bit integer
b15 An 8-bit integer.

_Guid

public _Guid(String str);

Constructs a new _Guid object from its string representation. The string representation is in the following form, in which each x denotes a hexadecimal digit:

{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} 

ParameterDescription
str The GUID string representation.

_Guid

public _Guid();

Constructs a new _Guid object, whose value is as follows:

{00000000-0000-0000-0000-000000000000}. 

Methods

equals

public boolean equals(Object g2);

Tests whether the GUID represented by the parameter g2 is equal to the GUID represented by the current _Guid object. Two GUIDs are equal only if each of the 128 bits in the two GUIDs is equal

Return Value:

Returns true if each of the 128 bits in the two GUIDs are equal; otherwise, returns false.

ParameterDescription
g2 The object whose GUID is being compared against the current _Guid object

hashCode

public int hashCode();

Computes a hash code based on the value of the GUID.

Return Value:

Returns an integer hash code.

set

public void set(byte [] ba);

Reinitializes an existing _Guid object from a 16-element byte array.

Caution This method of reinitialization is not endian-portable.

Return Value:

No return value.

ParameterDescription
ba A 16-element byte array.

set

public void set(String str);

Reinitializes an existing _Guid from its registry string representation. The string representation is in the following form, in which each x denotes a hexadecimal digit:

{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} 

Return Value:

No return value.

ParameterDescription
str The registry string representation.

set

public void set(int d1, short d2, short d3, byte b8, byte b9, byte b10,
        byte b11, byte b12, byte b13, byte b14, byte b15);

Reinitializes an existing _Guid object so that its value is specified by the internal representations of the parameters d1 through b15 in order.

Return Value:

No return value.

ParameterDescription
d1 A 32-bit integer.
d2 A 16-bit integer.
d3 A 16-bit integer.
b8 An 8-bit integer.
b9 An 8-bit integer.
b10 An 8-bit integer.
b11 An 8-bit integer.
b12 An 8-bit integer.
b13 An 8-bit integer.
b14 An 8-bit integer.
b15 An 8-bit integer.

toByteArray

public byte [] toByteArray();

Converts a GUID to a 16-element byte array.

Caution The byte array representation is not endian-portable; it cannot be used to transmit GUIDs between processors.

Return Value:

Returns a 16-element byte array that represents the GUID.

toString

public String toString();

Converts a GUID to its registry string representation.

Return Value:

Returns the registry string representation of the GUID.

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.