|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
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.
Depending on the precision and scale setting you select, ArcGIS may convert the field into another type. For example:
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(java.lang.Object value)
Indicates if the value is valid given the field definition. |
java.lang.String |
getAliasName()
The alias name of the field. |
java.lang.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. |
java.lang.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 |
public java.lang.String getName()
throws java.io.IOException,
AutomationException
Depending on the geometry type, there will be fields for shape length and shape area. In a personal geodatabase, these will be named Shape_Length and Shape_Area. In an SDE geodatabase, the names of these fields will be dependant on the underlying DBMS:
DB2 - SHAPE..Length() and SHAPE..Area()
Informix - SE_Length(shape) and SE_Area(shape)
Oracle - SHAPE.LEN and SHAPE.AREA
SQL Server - SHAPE.len and SHAPE.area
The IFeatureClass::ShapeFieldName property should be used to determine the name of the length and area fields for a feature class.
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public java.lang.String getAliasName()
throws java.io.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.
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public int getType()
throws java.io.IOException,
AutomationException
The following table outlines the equivalent field data types in ArcCatalog, ArcObjects, Visual Basic and a selection of DBMSs:
| ArcCatalog |
esriFieldType (IField::Type) |
VB Variable Type (IField::VarType) |
Access | SQL Server | Oracle |
|---|---|---|---|---|---|
| Short Integer | esriFieldTypeSmallInteger | vbInteger | Number (Integer) | smallint | NUMBER |
| Long Integer | esriFieldTypeInteger | vbLong | Number (Long Integer) | int | NUMBER |
| Float | esriFieldTypeSingle | vbSingle | Number (Single) | float | NUMBER |
| Double | esriFieldTypeDouble | vbDouble | Number (Double) | float | NUMBER |
| Text | esriFieldTypeString | vbString | Text | varchar | VARCHAR2 |
| Date | esriFieldTypeDate | vbDate | Date/Time | datetime | DATE |
| Object ID | esriFieldTypeOID | vbLong | AutoNumber (Long Integer) | int | NUMBER(38) |
| Geometry | esriFieldTypeGeometry | vbDataObject | OLE Object | int | NUMBER(38) or SDO_GEOMETRY |
| Blob | esriFieldTypeBlob | vbObject | OLE Object | image | NUMBER(38) or SDO_GEOMETRY |
| Raster | esriFieldTypeRaster | vbDataObject | Number (Long Integer) | int | NUMBER |
| GUID | esriFieldTypeGUID | vbString | Number (Replication ID) | uniqueidentifier | CHAR |
| GlobalID | esriFieldTypeGlobalID | vbString | Number (Replication ID) | uniqueidentifier | CHAR |
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 |
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public IDomain getDomain()
throws java.io.IOException,
AutomationException
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.IDomain
public java.lang.Object getDefaultValue()
throws java.io.IOException,
AutomationException
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public int getLength()
throws java.io.IOException,
AutomationException
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public int getPrecision()
throws java.io.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.
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public int getScale()
throws java.io.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.
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public boolean isNullable()
throws java.io.IOException,
AutomationException
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public IGeometryDef getGeometryDef()
throws java.io.IOException,
AutomationException
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.IGeometryDef
public int getVarType()
throws java.io.IOException,
AutomationException
Returns an Integer indicating the subtype of a variable.
| Constant | Value | Description |
|---|---|---|
|
vbEmpty vbNull vbInteger vbLong vbSingle vbDouble vbCurrency vbDate vbString vbObject vbError vbBoolean vbVariant vbDataObject vbDecimal vbByte vbArray |
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 17 8192 |
Uninitialized (default) Contains no valid data Integer subtype Long subtype Single subtype Double subtype Currency subtype Date subtype String subtype Object Error subtype Boolean subtype Variant (used only for arrays of variants) Data access object Decimal subtype Byte subtype Array |
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public boolean isDomainFixed()
throws java.io.IOException,
AutomationException
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.IDomain
public boolean isRequired()
throws java.io.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.
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public boolean isEditable()
throws java.io.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.
java.io.IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
public boolean checkValue(java.lang.Object value)
throws java.io.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)
java.io.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 | |||||||||