com.esri.arcgis.geodatabase
Class ISubtypesProxy

java.lang.Object
  extended by com.esri.arcgis.interop.Dispatch
      extended by com.esri.arcgis.geodatabase.ISubtypesProxy
All Implemented Interfaces:
ISubtypes, Externalizable, Serializable

public class ISubtypesProxy
extends com.esri.arcgis.interop.Dispatch
implements ISubtypes, Serializable

Provides access to members that return and modify subtype information.

Description

ISubtypes interface is implemented by the ObjectClass class and is used to maintain information about subtypes for the object class. Subtypes can be removed, added, and retrieved using this interface. Default subtypes and subtypecodes can be set for the object class here as well.

When To Use

The ISubtypes interface is the main interface for managing the subtypes, default values and attribute domains of an object class. For example, use the ISubtypes interface to create new subtypes, delete subtypes and assign an attribute domain for a particular field of a subtype. ISubtypes is an interface implemented by the ObjectClass class.

Product Availability

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

See Also:
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
  ISubtypesProxy()
           
  ISubtypesProxy(Object obj)
           
protected ISubtypesProxy(Object obj, String iid)
           
 
Method Summary
 void addListener(String iidStr, Object theListener, Object theSource)
           
 void addSubtype(int subtypeCode, String subtypeName)
          Adds the subtype to the set of associated subtypes.
 void deleteSubtype(int subtypeCode)
          Deletes the subtype from the set of associated subtypes.
 int getDefaultSubtypeCode()
          The default subtype associated with the class.
 Object getDefaultValue(int subtypeCode, String fieldName)
          The default value for the associated attribute.
 IDomain getDomain(int subtypeCode, String fieldName)
          The domain given the subtype and field.
 int getSubtypeFieldIndex()
          The subtype field index.
 String getSubtypeFieldName()
          The subtype field name.
 String getSubtypeName(int subtypeCode)
          The subtype name.
 IEnumSubtype getSubtypes()
          The subtypes associated with the class.
 boolean isHasSubtype()
          Indicates if the table has subtypes.
 void removeListener(String iidStr, Object theListener)
           
 void setDefaultSubtypeCode(int subtypeCode)
          The default subtype associated with the class.
 void setDefaultValue(int subtypeCode, String fieldName, Object value)
          The default value for the associated attribute.
 void setDomainByRef(int subtypeCode, String fieldName, IDomain domain)
          The domain given the subtype and field.
 void setSubtypeFieldName(String fieldName)
          The subtype field name.
 
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
 

Field Detail

noncastable

public boolean noncastable
Constructor Detail

ISubtypesProxy

public ISubtypesProxy()

ISubtypesProxy

public ISubtypesProxy(Object obj)
               throws IOException
Throws:
IOException

ISubtypesProxy

protected ISubtypesProxy(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 com.esri.arcgis.interop.Dispatch
Throws:
IOException

removeListener

public void removeListener(String iidStr,
                           Object theListener)
                    throws IOException
Overrides:
removeListener in class com.esri.arcgis.interop.Dispatch
Throws:
IOException

isHasSubtype

public boolean isHasSubtype()
                     throws IOException,
                            AutomationException
Indicates if the table has subtypes.

Description

HasSubtype property returns a boolean value whether the given object class has subypes or not.

Remarks

This property returns a boolean value indicating if the object class has subtypes defined. If there are no subtypes defined, it returns FALSE , if there are subypes defined it returns TRUE.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
isHasSubtype in interface ISubtypes
Returns:
The hasSubtype
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDefaultSubtypeCode

public int getDefaultSubtypeCode()
                          throws IOException,
                                 AutomationException
The default subtype associated with the class.

Description

DefaultSubtypeCode property sets and returns the default subtype code for the given object class.

Remarks

This property sets or returns the value of the default subtype code for the associated class.

Example:


String aPath = "shape path";

String aName = "shape name";

IWorkspaceFactory shapefileFactory = new ShapefileWorkspaceFactory();

IFeatureWorkspace featureWorkspace = 

new IFeatureWorkspaceProxy(shapefileFactory.openFromFile(aPath,0));

IFeatureClass featureClass = 

new IFeatureClassProxy(featureWorkspace.openFeatureClass(aName));

ISubtypes pSubtypes = new ISubtypesProxy(featureClass);

long lDefCode = pSubtypes.getDefaultSubtypeCode();

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getDefaultSubtypeCode in interface ISubtypes
Returns:
The subtypeCode
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDefaultSubtypeCode

public void setDefaultSubtypeCode(int subtypeCode)
                           throws IOException,
                                  AutomationException
The default subtype associated with the class.

Description

DefaultSubtypeCode property sets the default subtype code for the given object class.

Example:


String aPath = "shape path";

String aName = "shape name";

IWorkspaceFactory shapefileFactory = new ShapefileWorkspaceFactory();

IFeatureWorkspace featureWorkspace = 

new IFeatureWorkspaceProxy(shapefileFactory.openFromFile(aPath,0));

IFeatureClass featureClass = 

new IFeatureClassProxy(featureWorkspace.openFeatureClass(aName));

ISubtypes pSubtypes = new ISubtypesProxy(featureClass);

long lDefCode = pSubtypes.getDefaultSubtypeCode();

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getDefaultValue

public Object getDefaultValue(int subtypeCode,
                              String fieldName)
                       throws IOException,
                              AutomationException
The default value for the associated attribute.

Product Availability

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

Specified by:
getDefaultValue in interface ISubtypes
Parameters:
subtypeCode - The subtypeCode (in)
fieldName - The fieldName (in)
Returns:
A Variant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDefaultValue

public void setDefaultValue(int subtypeCode,
                            String fieldName,
                            Object value)
                     throws IOException,
                            AutomationException
The default value for the associated attribute.

Product Availability

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

Specified by:
setDefaultValue in interface ISubtypes
Parameters:
subtypeCode - The subtypeCode (in)
fieldName - The fieldName (in)
value - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDomain

public IDomain getDomain(int subtypeCode,
                         String fieldName)
                  throws IOException,
                         AutomationException
The domain given the subtype and field.

Product Availability

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

Specified by:
getDomain in interface ISubtypes
Parameters:
subtypeCode - The subtypeCode (in)
fieldName - The fieldName (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IDomain
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDomainByRef

public void setDomainByRef(int subtypeCode,
                           String fieldName,
                           IDomain domain)
                    throws IOException,
                           AutomationException
The domain given the subtype and field.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
setDomainByRef in interface ISubtypes
Parameters:
subtypeCode - The subtypeCode (in)
fieldName - The fieldName (in)
domain - A reference to a com.esri.arcgis.geodatabase.IDomain (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSubtypeFieldName

public String getSubtypeFieldName()
                           throws IOException,
                                  AutomationException
The subtype field name.

Remarks

The SubtypeFieldName property is used to either set or return string value for the field that contains the subtypes for this object class. To assign the subtype field, set SubtypeFieldName equal to the name of the field:

Example:

String aPath = "shape path";

String aName = "shape name";

IWorkspaceFactory shapefileFactory = new ShapefileWorkspaceFactory();

IFeatureWorkspace featureWorkspace = 

new IFeatureWorkspaceProxy(shapefileFactory.openFromFile(aPath,0));          

IFeatureClass featureClass = 

new FeatureClassProxy(featureWorkspace.openFeatureClass(aName));

ISubtypes pSubtypes = new ISubtypesProxy(featureClass);

pSubtypes.setSubtypeFieldName("TYPECODE"); 



//The  Subtype field can be  reset by assigning an  empty string to SubtypeFieldName:; 

pSubtypes.setSubtypeFieldName("");     



     

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSubtypeFieldName in interface ISubtypes
Returns:
The fieldName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSubtypeFieldName

public void setSubtypeFieldName(String fieldName)
                         throws IOException,
                                AutomationException
The subtype field name.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getSubtypeFieldIndex

public int getSubtypeFieldIndex()
                         throws IOException,
                                AutomationException
The subtype field index.

Description

SubtypeFieldIndex property returns the index of the subtype field.

Remarks

This property returns the index of the field in the object class which stores the subtype codes. The field index is returned as a Long.

Example:

String aPath = "shape path";

String aName = "shape name";

IWorkspaceFactory shapefileFactory = new ShapefileWorkspaceFactory();

IFeatureWorkspace featureWorkspace = 

new IFeatureWorkspaceProxy(shapefileFactory.openFromFile(aPath,0));

IFeatureClass featureClass = 

new IFeatureClassProxy(featureWorkspace.openFeatureClass(aName));

ISubtypes pSubtypes = new ISubtypesProxy(featureClass);

int subFldIndex = pSubtypes.getSubtypeFieldIndex();

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSubtypeFieldIndex in interface ISubtypes
Returns:
The index
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSubtypeName

public String getSubtypeName(int subtypeCode)
                      throws IOException,
                             AutomationException
The subtype name.

Product Availability

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

Specified by:
getSubtypeName in interface ISubtypes
Parameters:
subtypeCode - The subtypeCode (in)
Returns:
The subtypeName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSubtypes

public IEnumSubtype getSubtypes()
                         throws IOException,
                                AutomationException
The subtypes associated with the class.

Description

Subtypes returns a IEnumSubtype populated with all of the subtypes for the given object class.

Remarks

Every ObjectClass has a default subtype code. If the user has not explicitly specified a default subtype or a subtype field, then DefaultSubtypeCode will return a subtype code of zero. Additionally, you can query the HasSubtype property; a value of False indicates an absence of a default subtype code, True indicates the presence of a default subtype code.

If the client instead asks for the enumeration of subtypes associated with an ObjectClass and no subtype has been previously added to the ObjectClass, then the enumerator will contain a single entry with a code of zero. The subtype field index value will be –1 if a default subtype has not been previously specified. Subtypes may only be short or long integers (esriFieldTypeSmallInteger or esriFieldTypeInteger). When setting the default subtype code, if one already exists, then it will be deleted. A subtype field must have been specified prior to setting the subtype code value.

Every type of field, except for esriFieldTypeShape, may have a default value. When setting the default value (which my be assigned on a subtype basis), it will be checked against the field’s associated Domain (if one exists) for validity.

This property returns all of the subtypes for the associated object class. Subtypes returns an IEnumSubtype enumeration which you can loop through to get all of the subtypes.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

addSubtype

public void addSubtype(int subtypeCode,
                       String subtypeName)
                throws IOException,
                       AutomationException
Adds the subtype to the set of associated subtypes.

Description

AddSubtype adds the subtype to the set of subtypes for the given object class with the subtype code and subtype name given.

Remarks

AddSubtype will create a new subtype for the associated object class. This method requires a subtype code as a Long and a subtype name as a String. Before adding subtypes, use the ISubtypes::SubtypeFieldName property to set the subtypes field.

Once created, you can use the ISubtypes::DefaultValue property to set default values for this subtypes fields, and the ISubtypes::Domain property to assign domains to fields for the subtype.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
addSubtype in interface ISubtypes
Parameters:
subtypeCode - The subtypeCode (in)
subtypeName - The subtypeName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deleteSubtype

public void deleteSubtype(int subtypeCode)
                   throws IOException,
                          AutomationException
Deletes the subtype from the set of associated subtypes.

Description

DeleteSubtype takes the subtype code parameter to remove the subtype from the set of subtypes of the given object class.

Remarks

DeleteSubtype will delete a subtype for the associated object class. Calling DeleteSubtype will also remove any reference to that subtype in the geodatabase.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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