com.esri.arcgis.system
Class UID

java.lang.Object
  extended by com.esri.arcgis.system.UID
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, IPersist, IPersistStream, IUID, IXMLSerialize, Externalizable, Serializable

public class UID
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IUID, IPersist, IPersistStream, IXMLSerialize, Externalizable

Unique Identifier Object.

Remarks

COM interfaces and coclasses are identified by a globally unique identifier (GUID). The GUID for an interface is called an interface ID (IID). The GUID for a coclass is called class ID (CLSID). A ProgID is a text alias for a CLSID; the ProgID is a string composed of the project name and the class name of the coclass.

The UID coclass can be used to represent the GUID of an object.

There is built-in module called ArcID in the VBA project for the Normal template in both ArcMap and ArcCatalog. This module is a utility for finding the UID of the built-in commands and toolbars. You pass the name of a command or toolbar in as an argument to ArcID and the UID of that item is returned. The ArcID module is regenerated every time the Normal template is loaded; the registry is read to get the GUIDs of all the commands and toolbars that are currently used by the application.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

See Also:

Java developers can use the UID::setValue(Class class) method to initialize the UID object with the CLSID of an arcobjects coClass, or the IID of an arcobjects interface.

For example -

UID id = new UID();

id.setValue(com.esri.arcgis.geodatabase.IDataset.class);

, Serialized Form

Constructor Summary
UID()
          Constructs a UID using ArcGIS Engine.
UID(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
UID theUID = (UID) obj;
 
Method Summary
 boolean compare(IUID otherID)
          Indicates if the two UID objects represent the same globally unique identifier.
 void deserialize(IXMLSerializeData data)
          Deserializes an object from XML.
 boolean equals(Object o)
          Compare this object with another
 void generate()
          Creates a new globally unique value for the UID object.
 void getClassID(GUID[] pClassID)
          getClassID
static String getClsid()
          getClsid.
 void getSizeMax(_ULARGE_INTEGER[] pcbSize)
          getSizeMax
 int getSubType()
          The subtype of the UID object.
 Object getValue()
          The value of the UID object.
 int hashCode()
          the hashcode for this object
 void isDirty()
          isDirty
 void load(IStream pstm)
          load
 void readExternal(ObjectInput in)
           
 void save(IStream pstm, int fClearDirty)
          save
 void serialize(IXMLSerializeData data)
          Serializes an object to XML.
 void setSubType(int subType)
          The subtype of the UID object.
 void setValue(Class clazz)
          Sets the value of the UID object to the CLSID or IID of the passed in ArcObjects Class or Interface.
 void setValue(Object guidAsString)
          The value of the UID object.
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

UID

public UID()
    throws IOException,
           UnknownHostException
Constructs a UID using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

UID

public UID(Object obj)
    throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
UID theUID = (UID) obj;

Construct a UID using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to UID.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

getValue

public Object getValue()
                throws IOException,
                       AutomationException
The value of the UID object.

Remarks

The Value property is a string representing either the CLSID or ProgID of an interface or coclass.

COM interfaces and coclasses are identified by a globally unique identifier (GUID). The GUID for an interface is called an interface ID (IID). The GUID for a coclass is called class ID (CLSID). A ProgID is a text alias for a CLSID; the ProgID is a string composed of the project name and the class name of the coclass.

ArcGIS Desktop developers can find the CLSID, ProgID, and subtype of a built-in command, menu, or toolbar in ArcMap or ArcCatalog, in the following technical documents:

ArcGIS Developer Help for Desktop developers > General reference > Names and IDs > ArcMap commands

ArcGIS Developer Help for Desktop developers > Technical General reference > Names and IDs > ArcCatalog commands

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getValue in interface IUID
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setValue

public void setValue(Object guidAsString)
              throws IOException,
                     AutomationException
The value of the UID object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setValue in interface IUID
Parameters:
guidAsString - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

generate

public void generate()
              throws IOException,
                     AutomationException
Creates a new globally unique value for the UID object.

Description

Creates a new globally unique value (GUID) for the UID object. This is a 128-bit integer used for CLSIDs and interface identifiers.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
generate in interface IUID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSubType

public int getSubType()
               throws IOException,
                      AutomationException
The subtype of the UID object.

Description

Use the SubType property when working with classes that implement ICommandSubType that have multiple commands within a single class.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSubType in interface IUID
Returns:
The subType
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSubType

public void setSubType(int subType)
                throws IOException,
                       AutomationException
The subtype of the UID object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
setSubType in interface IUID
Parameters:
subType - The subType (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

compare

public boolean compare(IUID otherID)
                throws IOException,
                       AutomationException
Indicates if the two UID objects represent the same globally unique identifier.

Description

Returns a boolean indicating whether the specified UID object represents the same globally unique value (GUID) as this UID object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
compare in interface IUID
Parameters:
otherID - A reference to a com.esri.arcgis.system.IUID (in)
Returns:
The bEqual
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getClassID

public void getClassID(GUID[] pClassID)
                throws IOException,
                       AutomationException
getClassID

Description

IPersist is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getClassID in interface IPersist
Parameters:
pClassID - A Structure: com.esri.arcgis.support.ms.stdole.GUID (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isDirty

public void isDirty()
             throws IOException,
                    AutomationException
isDirty

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
isDirty in interface IPersistStream
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

load

public void load(IStream pstm)
          throws IOException,
                 AutomationException
load

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
load in interface IPersistStream
Parameters:
pstm - A reference to a com.esri.arcgis.system.IStream (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

save

public void save(IStream pstm,
                 int fClearDirty)
          throws IOException,
                 AutomationException
save

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
save in interface IPersistStream
Parameters:
pstm - A reference to a com.esri.arcgis.system.IStream (in)
fClearDirty - The fClearDirty (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSizeMax

public void getSizeMax(_ULARGE_INTEGER[] pcbSize)
                throws IOException,
                       AutomationException
getSizeMax

Description

IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSizeMax in interface IPersistStream
Parameters:
pcbSize - A Structure: com.esri.arcgis.system._ULARGE_INTEGER (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

serialize

public void serialize(IXMLSerializeData data)
               throws IOException,
                      AutomationException
Serializes an object to XML.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
serialize in interface IXMLSerialize
Parameters:
data - A reference to a com.esri.arcgis.system.IXMLSerializeData (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deserialize

public void deserialize(IXMLSerializeData data)
                 throws IOException,
                        AutomationException
Deserializes an object from XML.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
deserialize in interface IXMLSerialize
Parameters:
data - A reference to a com.esri.arcgis.system.IXMLSerializeData (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

setValue

public void setValue(Class clazz)
              throws IOException,
                     AutomationException
Sets the value of the UID object to the CLSID or IID of the passed in ArcObjects Class or Interface.

Parameters:
clazz - The Class object of an ArcGIS class or interface
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception. RuntimeException If the passed in Class does not represent an ArcObjects Class or Interface.