com.esri.arcgis.geodatabase
Interface IClass

All Superinterfaces:
Serializable
All Known Subinterfaces:
IFeatureClass, INetworkClass, IObjectClass, ITable
All Known Implementing Classes:
AttributedRelationshipClass, CadAnnotationLayer, CadastralFabricSubLayer, CadFeatureLayer, CoverageAnnotationLayer, DimensionLayer, FDOGraphicsLayer, FeatureClass, FeatureLayer, GdbRasterCatalogLayer, IClassProxy, IFeatureClassProxy, ImageServerLayer, IMSSubFeatureLayer, INetworkClassProxy, IObjectClassProxy, ITableProxy, NAClass, ObjectClass, RasterBand, RasterCatalog, RasterLayer, RelQueryTable, RouteEventSource, SchematicDiagramClass, SchematicElementClass, SchematicInMemoryFeatureClass, StandaloneTable, Table, TemporalFeatureClass, TemporalFeatureLayer, TemporalRecordSet, XYEventSource

public interface IClass
extends Serializable

Provides access to members that return information about and manage the class.

Remarks

All tables support the IClass interface.

The CLSID property returns the globally unique identifier for the software component (COM coclass) representing the row objects stored and handed out by this table. Examples of the value of this property include the CLSIDs representing esriGeoDatabase.Row, esriGeoDatabase.Object, esriGeoDatabase.Feature, and esriGeoDatabase.AttributedRelationship.

The EXTCLSID property returns the globally unique identifier for the software component (COM coclass) representing the class extension associated with this Table. Class extensions are a mechanism whereby a developer can associate additional class level methods with an ObjectClass in the database.

The CLSID and EXTCLSID and other similar properties for a Table are stored in the geodatabase as part of the data dictionary information for the database. These properties link the behavior of the class (as implemented by software components in a DLL) with the data in the table.

The Extension property returns an interface on the ClassExtension associated with this Table.

The HasOID property may be used to test if this table has an Object ID column. Tables representing object classes and attributed relationship classes in a geodatabase will have an Object ID column whose values are unique and are assigned by the geodatabase as new objects and attributed relationships are created. The “Register With Geodatabase” command available on the context menu of a table in ArcCatalog can be used to register a pre-existing table in an RDBMS as an object class, this process will add an Object ID column to the table if needed.

The IClass interface also contains methods (inherited by ITable) to manage the collection of fields and indexes for a Table.

Product Availability

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


Method Summary
 void addField(IField field)
          Adds a field to this object class.
 void addIndex(IIndex index)
          Adds an index to this object class.
 void deleteField(IField field)
          Deletes a field from this object class.
 void deleteIndex(IIndex index)
          Deletes an index from this object class.
 int findField(String name)
          The index of the field with the specified name.
 IUID getCLSID()
          The GUID for the COM Class (CoClass) corresponding to instances of this object class.
 IUID getEXTCLSID()
          The GUID for the COM Class (CoClass) corresponding to the class extension for this object class.
 Object getExtension()
          The extension for this object class.
 IPropertySet getExtensionProperties()
          The extension properties for this object class.
 IFields getFields()
          The fields collection for this object class.
 IIndexes getIndexes()
          The indexes collection for this object class.
 String getOIDFieldName()
          The name of the field corresponding to the OID.
 boolean isHasOID()
          Indicates if the class has an object identity (OID) field.
 

Method Detail

findField

int findField(String name)
              throws IOException,
                     AutomationException
The index of the field with the specified name.

Remarks

If FindField returns -1, the Field could not be found in the Fields collection.

Developers working with SDE should be aware of qualified field names and their impact on calls to FindField. For more information, see the IFields2 interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
name - The name (in)
Returns:
The fieldIndex
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFields

IFields getFields()
                  throws IOException,
                         AutomationException
The fields collection for this object class.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.geodatabase.IFields
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getIndexes

IIndexes getIndexes()
                    throws IOException,
                           AutomationException
The indexes collection for this object class.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.geodatabase.IIndexes
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addField

void addField(IField field)
              throws IOException,
                     AutomationException
Adds a field to this object class.

Remarks

Prior to adding a new field to a class, an exclusive schema lock should be obtained using the ISchemaLock interface.

Attempting to add a new field that does not allow null values will fail, if the class already has data in it. The only solution is to recreate the class with the non-nullable field, then copy the rows from the original class into the new class.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
field - A reference to a com.esri.arcgis.geodatabase.IField (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deleteField

void deleteField(IField field)
                 throws IOException,
                        AutomationException
Deletes a field from this object class.

Remarks

DeleteField removes the specified field from a table, object class or feature class. Fields that are required by the Geodatabase and cannot be removed include:

Prior to deleting a field from a class, an exclusive schema lock should be obtained using the ISchemaLock interface.

Example:

// Assume we have a reference to a FeatureClass (pFC)

      IFields pFields;

      IField pField;



      pFields = pFC.getFields();

      pField = pFields.getField(pFields.findField("MyField"));



      pFC.deleteField(pField);

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
field - A reference to a com.esri.arcgis.geodatabase.IField (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

addIndex

void addIndex(IIndex index)
              throws IOException,
                     AutomationException
Adds an index to this object class.

Remarks

Prior to adding a new index to a class, an exclusive schema lock should be obtained using the ISchemaLock interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
index - A reference to a com.esri.arcgis.geodatabase.IIndex (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deleteIndex

void deleteIndex(IIndex index)
                 throws IOException,
                        AutomationException
Deletes an index from this object class.

Remarks

Prior to deleting an index from a class, an exclusive schema lock should be obtained using the ISchemaLock interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
index - A reference to a com.esri.arcgis.geodatabase.IIndex (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isHasOID

boolean isHasOID()
                 throws IOException,
                        AutomationException
Indicates if the class has an object identity (OID) field.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The hasOID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getOIDFieldName

String getOIDFieldName()
                       throws IOException,
                              AutomationException
The name of the field corresponding to the OID.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCLSID

IUID getCLSID()
              throws IOException,
                     AutomationException
The GUID for the COM Class (CoClass) corresponding to instances of this object class.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.system.IUID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getEXTCLSID

IUID getEXTCLSID()
                 throws IOException,
                        AutomationException
The GUID for the COM Class (CoClass) corresponding to the class extension for this object class.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.system.IUID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getExtension

Object getExtension()
                    throws IOException,
                           AutomationException
The extension for this object class.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to another Object (IUnknown)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getExtensionProperties

IPropertySet getExtensionProperties()
                                    throws IOException,
                                           AutomationException
The extension properties for this object class.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.system.IPropertySet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.