|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.interop.Dispatch com.esri.arcgis.geodatabase.ISubtypesProxy
public class ISubtypesProxy
Provides access to members that return and modify subtype information.
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.
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 |
---|
public boolean noncastable
Constructor Detail |
---|
public ISubtypesProxy()
public ISubtypesProxy(Object obj) throws IOException
IOException
protected ISubtypesProxy(Object obj, String iid) throws IOException
IOException
Method Detail |
---|
public void addListener(String iidStr, Object theListener, Object theSource) throws IOException
addListener
in class com.esri.arcgis.interop.Dispatch
IOException
public void removeListener(String iidStr, Object theListener) throws IOException
removeListener
in class com.esri.arcgis.interop.Dispatch
IOException
public boolean isHasSubtype() throws IOException, AutomationException
HasSubtype property returns a boolean value whether the given object class has subypes or not.
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.
isHasSubtype
in interface ISubtypes
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getDefaultSubtypeCode() throws IOException, AutomationException
DefaultSubtypeCode property sets and returns the default subtype code for the given object class.
This property sets or returns the value of the default subtype code for the associated class.
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();
getDefaultSubtypeCode
in interface ISubtypes
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setDefaultSubtypeCode(int subtypeCode) throws IOException, AutomationException
DefaultSubtypeCode property sets the default subtype code for the given object class.
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();
setDefaultSubtypeCode
in interface ISubtypes
subtypeCode
- The subtypeCode (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Object getDefaultValue(int subtypeCode, String fieldName) throws IOException, AutomationException
getDefaultValue
in interface ISubtypes
subtypeCode
- The subtypeCode (in)fieldName
- The fieldName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setDefaultValue(int subtypeCode, String fieldName, Object value) throws IOException, AutomationException
setDefaultValue
in interface ISubtypes
subtypeCode
- The subtypeCode (in)fieldName
- The fieldName (in)value
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IDomain getDomain(int subtypeCode, String fieldName) throws IOException, AutomationException
getDomain
in interface ISubtypes
subtypeCode
- The subtypeCode (in)fieldName
- The fieldName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setDomainByRef(int subtypeCode, String fieldName, IDomain domain) throws IOException, AutomationException
setDomainByRef
in interface ISubtypes
subtypeCode
- The subtypeCode (in)fieldName
- The fieldName (in)domain
- A reference to a com.esri.arcgis.geodatabase.IDomain (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String getSubtypeFieldName() throws IOException, AutomationException
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:
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("");
getSubtypeFieldName
in interface ISubtypes
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setSubtypeFieldName(String fieldName) throws IOException, AutomationException
setSubtypeFieldName
in interface ISubtypes
fieldName
- The fieldName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getSubtypeFieldIndex() throws IOException, AutomationException
SubtypeFieldIndex property returns the index of the subtype field.
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.
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();
getSubtypeFieldIndex
in interface ISubtypes
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String getSubtypeName(int subtypeCode) throws IOException, AutomationException
getSubtypeName
in interface ISubtypes
subtypeCode
- The subtypeCode (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IEnumSubtype getSubtypes() throws IOException, AutomationException
Subtypes returns a IEnumSubtype populated with all of the subtypes for the given object class.
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.
getSubtypes
in interface ISubtypes
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void addSubtype(int subtypeCode, String subtypeName) throws IOException, AutomationException
AddSubtype adds the subtype to the set of subtypes for the given object class with the subtype code and subtype name given.
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.
addSubtype
in interface ISubtypes
subtypeCode
- The subtypeCode (in)subtypeName
- The subtypeName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void deleteSubtype(int subtypeCode) throws IOException, AutomationException
DeleteSubtype takes the subtype code parameter to remove the subtype from the set of subtypes of the given object class.
DeleteSubtype will delete a subtype for the associated object class. Calling DeleteSubtype will also remove any reference to that subtype in the geodatabase.
deleteSubtype
in interface ISubtypes
subtypeCode
- The subtypeCode (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |