|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IField
Provides access to members that return information about the field.
The field object represents a column in a table. A field has many properties, the most obvious ones being its name and its datatype. The esriFieldType enumeration lists the possible datatypes.
When you create a field of type esriFieldTypeSingle, esriFieldTypeDouble or esriFieldTypeInteger, and specify zero for precision and scale, the geodatabase will attempt to create a binary type field if the underlying database supports it. Personal geodatabases support only binary type fields. ArcGIS ignores precision and scale of binary type fields.
The length property of a field has meaning only for esriFieldTypeString fields. The length property for all other field types is not important and will be ignored if specified.
Method Summary | |
---|---|
boolean |
checkValue(Object value)
Indicates if the value is valid given the field definition. |
String |
getAliasName()
The alias name of the field. |
Object |
getDefaultValue()
The default value of the field. |
IDomain |
getDomain()
The default domain of the field. |
IGeometryDef |
getGeometryDef()
The geometry definition for the field if IsGeometry is TRUE. |
int |
getLength()
The maximum length, in bytes, for values described by the field. |
String |
getName()
The name of the field. |
int |
getPrecision()
The precision for field values. |
int |
getScale()
The scale for field values. |
int |
getType()
The type of the field. |
int |
getVarType()
The VARTYPE of the field (e.g. |
boolean |
isDomainFixed()
Indicates if the field's domain is fixed. |
boolean |
isEditable()
Indicates if the field is editable. |
boolean |
isNullable()
Indicates if the field can contain null values. |
boolean |
isRequired()
Indicates if the field is required. |
Method Detail |
---|
String getName() throws IOException, AutomationException
Geodatabase feature classes, depending on their geometry type, may contain automatically generated fields for shape length and area. In personal and file geodatabases, these fields will be named using the name of the shape field suffixed with "_Length" and "_Area". In an SDE geodatabase, the names of these fields will be dependant on the underlying DBMS.
The IFeatureClass::ShapeFieldName property should be used to determine the name of the length and area fields for a feature class.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.String getAliasName() throws IOException, AutomationException
This is only supported on fields from object classes and feature classes that are registered with the geodatabase; Personal, File or ArcSDE geodatabases. For fields coming from other data sources (shapefiles, coverages, etc) the AliasName will be the same string as the field name.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.int getType() throws IOException, AutomationException
For more information on the relation between esriFieldType values and the underlying SDE and DBMS data types, see the following articles in the ArcGIS Help:
The following table outlines the equivalent field data types in ArcCatalog, ArcObjects and .NET:
ArcCatalog |
esriFieldType (IField::Type) |
.NET Variable Type |
---|---|---|
Short Integer | esriFieldTypeSmallInteger | System.Int16 |
Long Integer | esriFieldTypeInteger | System.Int32 |
Float | esriFieldTypeSingle | System.Single |
Double | esriFieldTypeDouble | System.Double |
Text | esriFieldTypeString | System.String |
Date | esriFieldTypeDate | System.DateTime |
Object ID | esriFieldTypeOID | System.Int32 |
Geometry | esriFieldTypeGeometry | ESRI.ArcGIS.Geometry.IGeometry |
Blob | esriFieldTypeBlob | ESRI.ArcGIS.esriSystem.IMemoryBlobStream |
Raster | esriFieldTypeRaster | ESRI.ArcGIS.Geodatabase.IRasterValue |
GUID | esriFieldTypeGUID | System.String |
GlobalID | esriFieldTypeGlobalID | System.String |
The following table outlines the Coverage, INFO Item to Geodatabase field mapping:
Item type | Item width | Geodatabase field type (esriFieldType) |
---|---|---|
B | 4 | esriFieldTypeInteger |
C | 1-320 | esriFieldTypeString |
D | 8 | esriFieldTypeDate |
F | 4 | esriFieldTypeSingle |
F | 8 | esriFieldTypeDouble |
I | 1-4 | esriFieldTypeSmallInteger |
I | 5-9 | esriFieldTypeInteger |
I | 10-16 | esriFieldTypeDouble |
N | 1-9 | esriFieldTypeSingle |
N | 10-16 | esriFieldTypeDouble |
The following table outlines the Shapefile, dBASE field to Geodatabase field mapping:
Field type | Field width | Geodatabase field type (esriFieldType) |
---|---|---|
Date | - | esriFieldTypeDate |
String | 1-255 | esriFieldTypeString |
Boolean | - | esriFieldTypeString |
Number | 1-16 (decimals = 0) | esriFieldTypeInteger |
Number | 1-16 (decimals > 0) | esriFieldTypeDouble |
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IDomain getDomain() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IField
Object getDefaultValue() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.int getLength() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.int getPrecision() throws IOException, AutomationException
Precision is the number of digits in a number. For example, the number 56.78 has a precision of 4. Precision is only valid for fields that are numeric. Precision is always returned as 0 from personal or File geodatabase fields.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.int getScale() throws IOException, AutomationException
Scale is the number of digits to the right of the decimal point in a number. For example, the number 56.78 has a scale of 2. Scale applies only to fields that are double. Scale is always returned as 0 from personal or File geodatabase fields.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean isNullable() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IGeometryDef getGeometryDef() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.int getVarType() throws IOException, AutomationException
Returns an Integer indicating the subtype of a variable.
Field type | VarType |
---|---|
esriFieldTypeSmallInteger esriFieldTypeInteger esriFieldTypeSingle esriFieldTypeDouble esriFieldTypeString esriFieldTypeDate esriFieldTypeOID esriFieldTypeGeometry esriFieldTypeBlob esriFieldTypeRaster esriFieldTypeGUID esriFieldTypeGlobalID |
2 3 4 5 8 7 3 13 13 13 8 8 |
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean isDomainFixed() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IClassSchemaEdit.alterDomain(String, com.esri.arcgis.geodatabase.IDomain)
,
IClassSchemaEdit
boolean isRequired() throws IOException, AutomationException
All tables and feature classes have a set of required fields that are necessary to record the state of any particular object in the table or feature class. These required fields are automatically created when you create a new feature class or table, and cannot be deleted. Required fields may also have required properties such as its domain property. You cannot modify the required property of a required field.
For example, in a simple feature class, OID and Shape are required fields. They do have properties such as their alias and geometry type that you can modify, but these fields cannot be deleted.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean isEditable() throws IOException, AutomationException
It is best to loop through the fields of a feature and skip the fields that are not editable, rather than allowing users to attempt to edit fields that cannot be edited.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean checkValue(Object value) throws IOException, AutomationException
CheckValue tests whether the specified value is valid for the current field, based upon the field type. For example, CheckValue will verify if the supplied value corresponds to field type of Small Integer or if the value corresponds to a string value.
The value is not checked against any existing domain.
value
- A Variant (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 |