com.esri.arcgis.geodatabase
Interface ISubtypes

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
FeatureClass, ISubtypesProxy, NetCDFFeatureClass, ObjectClass, RouteEventSource, SchematicDiagramClass, SchematicElementClass, XYEventSource

public interface ISubtypes
extends java.io.Serializable

Provides access to members that return and modify subtype information.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Description

ISubtypes interface is a member of the ObjectClass coclass and is used to maintain information about subtypes for the object class. Subtypes can be removed, added, and retrieved using this interface. Also default subtypes and subtypecodes can be set for the object class here.

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 on the ObjectClass coclass.


Method Summary
 void addSubtype(int subtypeCode, java.lang.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.
 java.lang.Object getDefaultValue(int subtypeCode, java.lang.String fieldName)
          The default value for the associated attribute.
 IDomain getDomain(int subtypeCode, java.lang.String fieldName)
          The domain given the subtype and field.
 int getSubtypeFieldIndex()
          The subtype field index.
 java.lang.String getSubtypeFieldName()
          The subtype field name.
 java.lang.String getSubtypeName(int subtypeCode)
          The subtype name.
 IEnumSubtype getSubtypes()
          The subtypes associated with the class.
 boolean isHasSubtype()
          Indicates if the table has subtypes.
 void setDefaultSubtypeCode(int subtypeCode)
          The default subtype associated with the class.
 void setDefaultValue(int subtypeCode, java.lang.String fieldName, java.lang.Object value)
          The default value for the associated attribute.
 void setDomainByRef(int subtypeCode, java.lang.String fieldName, IDomain domain)
          The domain given the subtype and field.
 void setSubtypeFieldName(java.lang.String fieldName)
          The subtype field name.
 

Method Detail

isHasSubtype

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

Supported Platforms

Windows, Solaris, Linux

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.

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

getDefaultSubtypeCode

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

Supported Platforms

Windows, Solaris, Linux

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.

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

setDefaultSubtypeCode

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

Supported Platforms

Windows, Solaris, Linux

Description

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

Parameters:
subtypeCode - The subtypeCode (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDefaultValue

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

Supported Platforms

Windows, Solaris, Linux

Description

DefaultValue property returns the default value for the given subtype.

Remarks

This property return the default value for a particular field associated with a subtype. It requires the subtype code as a Long and the field name as a String . You can use the IField::Type property to determine the type of field that you are passing into the function so you will know what data type is being returned.

Parameters:
subtypeCode - The subtypeCode (in)
fieldName - The fieldName (in)
Returns:
A Variant
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDefaultValue

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

Supported Platforms

Windows, Solaris, Linux

Description

DefaultValue property sets the default value for the given subtype.

Remarks

This property sets the default value for a particlar field associated with a subtype. It requires the subtype code as a Long and the field name as a String.

Parameters:
subtypeCode - The subtypeCode (in)
fieldName - The fieldName (in)
value - A Variant (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDomain

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

Supported Platforms

Windows, Solaris, Linux

Description

The Domain property returns or sets the domain given the subtype code and the fieldname of the subtype.

Remarks

This property returns or sets an IDomain object associated with a particular subtype code and field. The subtype code is required as a Long and field name as a String.

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

setDomainByRef

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

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

getSubtypeFieldName

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

Supported Platforms

Windows, Solaris, Linux

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:

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

setSubtypeFieldName

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
fieldName - The fieldName (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSubtypeFieldIndex

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

Supported Platforms

Windows, Solaris, Linux

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.

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

getSubtypeName

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

Supported Platforms

Windows, Solaris, Linux

Description

SubtypeName property returns the subtype name for the subtype referred to by the parameter subtypecode.

Remarks

This property returns the name of a subtype for a given subtype code for the associated object class. The subtype code is required as a Long and returns the name of the subtype as a String.

Parameters:
subtypeCode - The subtypeCode (in)
Returns:
The subtypeName
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getSubtypes

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

Supported Platforms

Windows, Solaris, Linux

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.

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

addSubtype

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

Supported Platforms

Windows, Solaris, Linux

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.

Parameters:
subtypeCode - The subtypeCode (in)
subtypeName - The subtypeName (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deleteSubtype

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

Supported Platforms

Windows, Solaris, Linux

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.

Parameters:
subtypeCode - The subtypeCode (in)
Throws:
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.