com.esri.arcgis.geodatabase
Class IFeatureClassProxy

java.lang.Object
  extended by com.esri.arcgis.interop.Dispatch
      extended by com.esri.arcgis.geodatabase.IClassProxy
          extended by com.esri.arcgis.geodatabase.IObjectClassProxy
              extended by com.esri.arcgis.geodatabase.IFeatureClassProxy
All Implemented Interfaces:
IClass, IFeatureClass, IObjectClass, Externalizable, Serializable
Direct Known Subclasses:
INetworkClassProxy

public class IFeatureClassProxy
extends IObjectClassProxy
implements IFeatureClass, Serializable

Provides access to members that control the behavior and properties of a feature class.

Remarks

Feature classes can be created using the IFeatureWorkspace.CreateFeatureClass and IFeatureDataset.CreateFeatureClass methods.

When To Use

The IFeatureClass interface is the main interface for getting and setting properties of a feature class. For example, use the IFeatureClass interface to get the type of feature class, get a count of features that satisfy some query, or create a new feature in the feature class. The IFeatureClass interface inherits from the IObjectClass interface.

Product Availability

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

See Also:
IObjectClass, Serialized Form

Field Summary
 boolean noncastable
           
 
Fields inherited from class com.esri.arcgis.interop.Dispatch
DISPATCH_METHOD, DISPATCH_PROPERTYGET, DISPATCH_PROPERTYPUT, DISPATCH_PROPERTYPUTREF, objRef
 
Constructor Summary
  IFeatureClassProxy()
           
  IFeatureClassProxy(Object obj)
           
protected IFeatureClassProxy(Object obj, String iid)
           
 
Method Summary
 void addListener(String iidStr, Object theListener, Object theSource)
           
 IFeature createFeature()
          Create a new feature, with a system assigned object ID and null property values.
 IFeatureBuffer createFeatureBuffer()
          Create a feature buffer that can be used with an insert cursor.
 int featureCount(IQueryFilter queryFilter)
          The number of features selected by the specified query.
 IField getAreaField()
          The geometry area field.
 IFeature getFeature(int iD)
          Get the feature with the specified object ID.
 int getFeatureClassID()
          The unique ID for the Feature Class.
 IFeatureDataset getFeatureDataset()
          The feature dataset that contains the feature class.
 IFeatureCursor getFeatures(Object fids, boolean recycling)
          Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by GeoDatabaseHelper.getFeatures(com.esri.arcgis.geodatabase.IFeatureClass, int[], boolean).
 int getFeatureType()
          The type of features in this feature class.
 IField getLengthField()
          The geometry length field.
 String getShapeFieldName()
          The name of the default sShape field.
 int getShapeType()
          The type of the default Shape for the features in this feature class.
 IFeatureCursor IFeatureClass_insert(boolean useBuffering)
          Returns a cursor that can be used to insert new features.
 IFeatureCursor IFeatureClass_update(IQueryFilter filter, boolean recycling)
          Returns a cursor that can be used to update features selected by the specified query.
 void removeListener(String iidStr, Object theListener)
           
 IFeatureCursor search(IQueryFilter filter, boolean recycling)
          Returns an object cursor that can be used to fetch feature objects selected by the specified query.
 ISelectionSet select(IQueryFilter queryFilter, int selType, int selOption, IWorkspace selectionContainer)
          Returns a selection That contains the object ids selected by the specified query.
 
Methods inherited from class com.esri.arcgis.geodatabase.IObjectClassProxy
getAliasName, getObjectClassID, getRelationshipClasses
 
Methods inherited from class com.esri.arcgis.geodatabase.IClassProxy
addField, addIndex, deleteField, deleteIndex, findField, getCLSID, getEXTCLSID, getExtension, getExtensionProperties, getFields, getIndexes, getOIDFieldName, isHasOID
 
Methods inherited from class com.esri.arcgis.interop.Dispatch
bindUsingMoniker, constructVtblPosTable, convertToNative, cookieForListener, createDispatch, createObjrefMonikerDisplayName, equals, getActiveObject, getActiveObject, getDefaultProperty, getDispatchIdOfName, getLastErrorCode, getMtsObjectContext, getObjRef, getPropertyByName, getPropertyByName, getVtblPos, hashCode, initDispatch, invoke, invokeMethodByName, invokeMethodByName, invokeMethodByName, invokePropertyGetByName, invokePropertyPutByName, invokePropertyPutByRefByName, isNativeMode, isObjRef, optimizedVtblInvoke, queryInterface, readExternal, release, setNativeMode, setPropertyByName, toString, vtblInvoke, writeExternal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.geodatabase.IObjectClass
getAliasName, getObjectClassID, getRelationshipClasses
 
Methods inherited from interface com.esri.arcgis.geodatabase.IClass
addField, addIndex, deleteField, deleteIndex, findField, getCLSID, getEXTCLSID, getExtension, getExtensionProperties, getFields, getIndexes, getOIDFieldName, isHasOID
 

Field Detail

noncastable

public boolean noncastable
Constructor Detail

IFeatureClassProxy

public IFeatureClassProxy()

IFeatureClassProxy

public IFeatureClassProxy(Object obj)
                   throws IOException
Throws:
IOException

IFeatureClassProxy

protected IFeatureClassProxy(Object obj,
                             String iid)
                      throws IOException
Throws:
IOException
Method Detail

addListener

public void addListener(String iidStr,
                        Object theListener,
                        Object theSource)
                 throws IOException
Overrides:
addListener in class IObjectClassProxy
Throws:
IOException

removeListener

public void removeListener(String iidStr,
                           Object theListener)
                    throws IOException
Overrides:
removeListener in class IObjectClassProxy
Throws:
IOException

getShapeType

public int getShapeType()
                 throws IOException,
                        AutomationException
The type of the default Shape for the features in this feature class.

Description

ShapeType returns the basic type of geometry of a shape. For the purposes of using the ShapeType property in deciding how to render/symbolize a layer, only esriGeometryPolyline, esriGeometryPolygon, esriGeometryPoint, esriGeometryMulitpoint, and esriGeometryMultipatch need to be checked. All the other types will report as being one of these five types. The reason is that esriGeometryBezier3Curve or esriGeometryPath, etc. can be segments or parts of another shape.

Remarks

This read-only property returns the shape type for the feature class. This shape type can be one of the following esriGeometryType.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getShapeType in interface IFeatureClass
Returns:
A com.esri.arcgis.geometry.esriGeometryType constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IFeatureClass.getShapeType(), esriGeometryType

getFeatureType

public int getFeatureType()
                   throws IOException,
                          AutomationException
The type of features in this feature class.

Remarks

This read-only property returns the feature type for the feature class as an esriFeatureType value. This property can be used to determine if a feature class is of a particular type, in order for the feature class to added to a network or topology, or possibly to skip over the feature class in an enumerator.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getFeatureType in interface IFeatureClass
Returns:
A com.esri.arcgis.geodatabase.esriFeatureType constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
esriFeatureType

getShapeFieldName

public String getShapeFieldName()
                         throws IOException,
                                AutomationException
The name of the default sShape field.

Remarks

This read-only property returns the name of the geometry field for the feature class.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getShapeFieldName in interface IFeatureClass
Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IPoint, IPolygon, IGeometry, ILine

getAreaField

public IField getAreaField()
                    throws IOException,
                           AutomationException
The geometry area field.

Remarks

This read-only property returns the name of the field which records the area of each feature. Only feature classes that have a ShapeType of esriGeometryPolygon have an Area field.

A null pointer will be returned if:

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getAreaField in interface IFeatureClass
Returns:
A reference to a com.esri.arcgis.geodatabase.IField
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IField, IFields

getLengthField

public IField getLengthField()
                      throws IOException,
                             AutomationException
The geometry length field.

Remarks

This read-only property returns the name of the field which records the length of each feature. Only feature classes that have a ShapeType of esriGeometryPolygon or esriGeometryPolyLine have a Length field. For Line features, this field records the length of the polyline. For polygon features, this field records the perimeter of the polygon.

A null pointer will be returned if:

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getLengthField in interface IFeatureClass
Returns:
A reference to a com.esri.arcgis.geodatabase.IField
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IField, IFields

getFeatureDataset

public IFeatureDataset getFeatureDataset()
                                  throws IOException,
                                         AutomationException
The feature dataset that contains the feature class.

Remarks

This read-only property returns the IFeatureDataset interface on the feature dataset that this feature class is a memeber of. If the feature class is a stand alone feature class (it does not have a feature dataset), then this function will return a null pointer. A coverage feature class will return the IFeatureDataset interface to the coverage itself. Shapefiles will always return a null pointer.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getFeatureDataset in interface IFeatureClass
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeatureDataset
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createFeature

public IFeature createFeature()
                       throws IOException,
                              AutomationException
Create a new feature, with a system assigned object ID and null property values.

Remarks

CreateFeature will create a new feature for the feature class. The new feature is by default assigned a unique object ID (OID). All other fields are initialized to null values if they can be made null and to built-in default values appropriate to the type of the field if they cannot be made null. Use the IFeature::Store method to actually store this new feature in the database. When working with a versioned feature class, CreateFeature should only be called within an edit session. You can start an edit session by calling IWorkspaceEdit::StartEditing. All edits to features that participate in a Topology or Geometric Network must be performed within an edit session and bracketed within an edit operation.

After calling CreateFeature, the default subtype value is not automatically set nor are default values initialized. For features without a subtype that have defined default values, calling IRowSubtypes::InitDefaultValues will initialize the default values. Use IRowSubtypes::SubtypeCode to set the subtype value for features with subtypes before calling IRowSubtypes::InitDefaultValues to initialize the default values for the particular subtype.

Calling the CreateFeature method on a feature class (via the IFeatureClass interface on the feature class) has the same effect as calling the CreateRow method on the FeatureClass (via the ITable interface on the feature class) except that the IFeatureClass methods return IFeature interfaces on the returned row object.

If multiple features with common attributes are being sequentially created, the CreateFeatureBuffer method, IFeatureCursor.InsertFeature method and IFeatureBuffer interface should be used for better performance.

The basic process to create a new feature is:

1) Create the feature
2) Create the geometry for the feature
3) Store the geometry in the feature
4) Store the feature

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
createFeature in interface IFeatureClass
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeature
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IFeature, IFeatureCursor

getFeature

public IFeature getFeature(int iD)
                    throws IOException,
                           AutomationException
Get the feature with the specified object ID.

Remarks

GetFeature will return a feature from the feature class with the parameter-specified Object ID (OID). This method is typically used to find a particular feature with a known Object ID. A cursor should be used to iterate through all features in a feature class.

Calling the GetFeature method on a feature class (via the IFeatureClass interface on the feature class) has the same effect as calling the GetRow method on the feature class (via the ITable interface) except that the return value is an IFeature reference, rather than IRow.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getFeature in interface IFeatureClass
Parameters:
iD - The iD (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeature
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IFeature, IFeatureCursor

getFeatures

public IFeatureCursor getFeatures(Object fids,
                                  boolean recycling)
                           throws IOException,
                                  AutomationException
Deprecated. This method uses C style arrays which are not supported in the ArcGIS API for Java. It is replaced by GeoDatabaseHelper.getFeatures(com.esri.arcgis.geodatabase.IFeatureClass, int[], boolean).

Get a cursor of Rows given a set of object ids.

Remarks

GetFeatures will return an IFeatureCursor which contains the features from the feature class with the parameter-specified Object IDs (OID). This method can be used to loop through a particular set of features with known Object IDs.

Calling the GetFeatures method from the IFeatureClass interface has the same effect as calling the GetRows method from the ITable interface except that the return value is an IFeatureCursor reference, rather than an ICursor reference.

The fids parameter should be provided with an integer array. If the array contains an invalid Object ID, no error will occur, and no feature will be retrieved for the value.

This method should not be called from .NET or Java applications. Instead, call IGeoDatabaseBridge.GetFeatures.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getFeatures in interface IFeatureClass
Parameters:
fids - A Variant (in)
recycling - The recycling (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeatureCursor
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IFeature, IFeatureCursor

getFeatureClassID

public int getFeatureClassID()
                      throws IOException,
                             AutomationException
The unique ID for the Feature Class.

Remarks

This read-only property will return the unique identifier for this feature class. All feature classes inside Geodatabases have a unique ID. Coverage and Shapefile feature classes do not, so IFeatureClass::FeatureClassID will always return -1 for Coverage and Shapefile feature classes. Since IFeatureClass inherits from IObjectClass, you can also get the feature class ID from IObjectClass:: ObjectClassID.



Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getFeatureClassID in interface IFeatureClass
Returns:
The fID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IObjectClass

createFeatureBuffer

public IFeatureBuffer createFeatureBuffer()
                                   throws IOException,
                                          AutomationException
Create a feature buffer that can be used with an insert cursor.

Remarks

The CreateFeatureBuffer method creates a feature buffer and returns the IFeatureBuffer interface. This can be used to create new features in the feature class with an insert cursor. Like creating a feature with IFeatureClass::CreateFeature, the field values for the new feature must be initialized to some value before it can be stored in the database. All edits to features that participate in a Topology or Geometric Network must be performed within an edit session and bracketed within an edit operation.

Calling the CreateFeatureBuffer method in IFeatureClass has the same effect as calling the CreateRowBuffer interface in ITable except that the IFeatureClass methods return an IFeatureBuffer interface on the created row buffer.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
createFeatureBuffer in interface IFeatureClass
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeatureBuffer
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IFeature, IFeatureCursor

featureCount

public int featureCount(IQueryFilter queryFilter)
                 throws IOException,
                        AutomationException
The number of features selected by the specified query.

Remarks

FeatureCount returns the number of features that satisfy some attribute and/or spatial query as specified by an IQueryFilter object. If Nothing is supplied for the IQueryFilter, then FeatureCount returns the total number of features in the feature class.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
featureCount in interface IFeatureClass
Parameters:
queryFilter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
Returns:
The numFeatures
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:

In Java, rather than passing Nothing to get the total number of features, you should pass null.


search

public IFeatureCursor search(IQueryFilter filter,
                             boolean recycling)
                      throws IOException,
                             AutomationException
Returns an object cursor that can be used to fetch feature objects selected by the specified query.

Remarks

Search will return an IFeatureCursor with all of the features that satisfy the attribute and/or spatial constraints as specified by an IQueryFilter reference. If a null value is passed to the filter parameter, the feature cursor will return all of the features from the feature class.

The recycling parameter controls row object allocation behavior. Recycling cursors rehydrate a single feature object on each fetch and can be used to optimize read-only access, for example, when drawing. It is illegal to maintain a reference on a feature object returned by a recycling cursor across multiple calls to NextFeature on the cursor. Features returned by a recycling cursor should not be modified. Non-recycling cursors return a separate feature object on each fetch. The features returned by a non-recycling cursor may be modified and stored with polymorphic behavior.

The Geodatabase guarantees "unique instance semantics" on non-recycling feature objects fetched during an edit session. In other words, if the feature retrieved by a search cursor has already been instantiated and is being referenced by the calling application, then a reference to the existing feature object is returned.

Non-recycling feature cursors returned from the Search method *MUST* be used when copying features from the cursor into an insert cursor of another class. This is because a recycling cursor reuses the same geometry and under some circumstances all of the features inserted into the insert cursor may have the same geometry. Using a non-recycling cursor ensures that each geometry is unique.

Existing rows can be edited with either a search cursor or an update cursor. When using a search cursor, NextRow is called, returning a reference to a row. The row is edited, and IRow.Store is called. When using an update cursor, NextRow is called, the row is edited, and ICursor.UpdateRow is called with the row as a parameter. It is important to remember, when using an update cursor, do not call the Store method.

In the same way, rows can be deleted using a search cursor or an update cursor, with IRow.Delete used instead of IRow.Store, and ICursor.DeleteRow used instead of ICursor.UpdateRow.
The recommended approach depends on whether or not the edits are being made in an edit session, if the cursor is being used by ArcMap or by an Engine application, and if the features being edited are simple or complex. The table below shows which approach to use in different situations:
ArcMap
Engine - Simple
Engine - Complex
Inside edit sessions
Search Cursor
Search Cursor
Search Cursor
Outside edit sessions
Search Cursor
Update Cursor
Search Cursor
A search cursor is always recommended in ArcMap, because the query may be satisfied by the contents of the map cache, making a DBMS query unnecessary.
When working with simple features and edit sessions in an Engine application, it's recommended that a search cursor be used to take advantage of batched updates in edit operations. With complex features, on the other hand, update calls are overridden by the features' custom behavior, meaning that the feature's store method will be called even if an update cursor is used.

When using cursors within an edit session, they should always be scoped to edit operations. In other words, a cursor should be created after an edit operation has begun and should not be used once that edit operation has been stopped or aborted.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
search in interface IFeatureClass
Parameters:
filter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
recycling - The recycling (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeatureCursor
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IQueryFilter

IFeatureClass_update

public IFeatureCursor IFeatureClass_update(IQueryFilter filter,
                                           boolean recycling)
                                    throws IOException,
                                           AutomationException
Returns a cursor that can be used to update features selected by the specified query.

Product Availability

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

Specified by:
IFeatureClass_update in interface IFeatureClass
Parameters:
filter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
recycling - The recycling (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeatureCursor
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

IFeatureClass_insert

public IFeatureCursor IFeatureClass_insert(boolean useBuffering)
                                    throws IOException,
                                           AutomationException
Returns a cursor that can be used to insert new features.

Product Availability

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

Specified by:
IFeatureClass_insert in interface IFeatureClass
Parameters:
useBuffering - The useBuffering (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeatureCursor
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

select

public ISelectionSet select(IQueryFilter queryFilter,
                            int selType,
                            int selOption,
                            IWorkspace selectionContainer)
                     throws IOException,
                            AutomationException
Returns a selection That contains the object ids selected by the specified query.

Remarks

Select will return an ISelectionSet with all of the features that satisfy some attribute and/or spatial query as specified by an IQueryFilter object. If Nothing is given as the IQueryFilter, then the selection will have all of the features from the feature class.

Calling the Select method in IFeatureClass has the same effect as calling the corresponding method in ITable.

The selType parameter determines the type of selection set that will be created: an ID set, a snapshot, or a hybrid. See the ISelectionSet interface for a comparison of the three types.

When calling Select the selectionContainer parameter is no longer required. A null value should be passed as this parameter.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
select in interface IFeatureClass
Parameters:
queryFilter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
selType - A com.esri.arcgis.geodatabase.esriSelectionType constant (in)
selOption - A com.esri.arcgis.geodatabase.esriSelectionOption constant (in)
selectionContainer - A reference to a com.esri.arcgis.geodatabase.IWorkspace (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.ISelectionSet
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IQueryFilter