|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.geodatabase.Field
public class Field
ESRI Field object.
Constructor Summary | |
---|---|
Field()
Constructs a Field using ArcGIS Engine. |
|
Field(Object obj)
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts. Field theField = (Field) obj; |
Method Summary | |
---|---|
void |
assign(IClone src)
Assigns the properties of src to the receiver. |
boolean |
checkValue(Object value)
Indicates if the value is valid given the field definition. |
Object |
describe(String name)
The description of the named object. |
void |
deserialize(IXMLSerializeData data)
Deserializes an object from XML. |
void |
empty()
Clears the value object. |
boolean |
equals(Object o)
Compare this object with another |
IClone |
esri_clone()
Clones the receiver and assigns the result to *clone. |
String |
getAliasName()
The alias name of the field. |
String |
getAsText()
Provides the value of the value object. |
void |
getClassID(GUID[] pClassID)
getClassID |
static String |
getClsid()
getClsid. |
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 |
getModelName()
The model name of the field. |
String |
getName()
The name of the field. |
int |
getPrecision()
The precision for field values. |
IRasterDef |
getRasterDef()
The raster column definition. |
int |
getScale()
The scale for field values. |
void |
getSizeMax(_ULARGE_INTEGER[] pcbSize)
getSizeMax |
int |
getType()
The type of the field. |
int |
getVarType()
The VARTYPE of the field (e.g. |
int |
hashCode()
the hashcode for this object |
IGPDataType |
IGPValue_getDataType()
The data type of the value object. |
void |
isDirty()
isDirty |
boolean |
isDomainFixed()
Indicates if the field's domain is fixed. |
boolean |
isEditable()
Indicates if the field is editable. |
boolean |
isEmpty()
Indicates if the value object is empty. |
boolean |
isEqual(IClone other)
Indicates if the receiver and other have the same properties. |
boolean |
isIdentical(IClone other)
Indicates if the receiver and other are the same object. |
boolean |
isNullable()
Indicates if the field can contain null values. |
boolean |
isRequired()
Indicates if the field is required. |
void |
load(IStream pstm)
load |
void |
readExternal(ObjectInput in)
|
void |
save(IStream pstm,
int fClearDirty)
save |
void |
serialize(IXMLSerializeData data)
Serializes an object to XML. |
void |
setAliasName(String rhs1)
The alias name of the field. |
IGPMessage |
setAsText(String text)
Provides the value of the value object with the given string value. |
void |
setDefaultValue(Object rhs1)
The default value of the field. |
void |
setDomainByRef(IDomain rhs1)
The default domain of the field. |
void |
setDomainFixed(boolean rhs1)
Indicates if the field's domain cannot be modified. |
void |
setEditable(boolean rhs1)
Indicates if the field can be edited. |
void |
setGeometryDefByRef(IGeometryDef rhs1)
The geometry definition if IsGeometry is TRUE. |
void |
setIsNullable(boolean rhs1)
Indicates if field values can be null. |
void |
setLength(int rhs1)
The maximum length, in bytes, for field values. |
void |
setModelName(String name)
The model name of the field. |
void |
setName(String rhs1)
The name of the field. |
void |
setPrecision(int rhs1)
The precision for field values. |
void |
setRasterDefByRef(IRasterDef rasterDef)
The raster column definition. |
void |
setRequired(boolean rhs1)
Indicates if the field is required. |
void |
setScale(int rhs1)
The scale for field values. |
void |
setType(int rhs1)
The type for the field. |
void |
writeExternal(ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef |
---|
getJintegraDispatch, release |
Constructor Detail |
---|
public Field() throws IOException, UnknownHostException
IOException
- if there are interop problems
UnknownHostException
- if there are interop problemspublic Field(Object obj) throws IOException
Field theField = (Field) obj;
obj
to Field
.
obj
- an object returned from ArcGIS Engine or Server
IOException
- if there are interop problemsMethod Detail |
---|
public static String getClsid()
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public 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.
getName
in interface IField
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public 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.
getAliasName
in interface IField
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public 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 |
getType
in interface IField
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IDomain getDomain() throws IOException, AutomationException
getDomain
in interface IField
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IField
public Object getDefaultValue() throws IOException, AutomationException
getDefaultValue
in interface IField
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getLength() throws IOException, AutomationException
getLength
in interface IField
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public 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.
getPrecision
in interface IField
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public 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.
getScale
in interface IField
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isNullable() throws IOException, AutomationException
isNullable
in interface IField
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IGeometryDef getGeometryDef() throws IOException, AutomationException
getGeometryDef
in interface IField
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public 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 |
getVarType
in interface IField
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isDomainFixed() throws IOException, AutomationException
isDomainFixed
in interface IField
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IClassSchemaEdit.alterDomain(String, com.esri.arcgis.geodatabase.IDomain)
,
IClassSchemaEdit
public 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.
isRequired
in interface IField
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public 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.
isEditable
in interface IField
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public 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.
checkValue
in interface IField
value
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IRasterDef getRasterDef() throws IOException, AutomationException
getRasterDef
in interface IField2
getRasterDef
in interface IFieldEdit2
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setName(String rhs1) throws IOException, AutomationException
setName
in interface IFieldEdit
rhs1
- The rhs1 (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setAliasName(String rhs1) throws IOException, AutomationException
This is only supported on fields from object classes and feature classes that are registered with a personal, File or ArcSDE geodatabase.
This is not supported for shapefiles, coverages, or other data sources.
You can register a table within the geodatabase to become an object class by right-clicking on the table in ArcCatalog and clicking on "Register with Geodatabase".
setAliasName
in interface IFieldEdit
rhs1
- The rhs1 (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setDomainByRef(IDomain rhs1) 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.
This is not supported for shapefiles, coverages, or other data sources.
You can register a table within the geodatabase to become an object class by right-clicking on the table in ArcCatalog and clicking on "Register with Geodatabase".
The IFieldEdit::Domain method is used to associate domains when creating new fields. You should not use it to modify existing fields, for that purpose use IClassSchemaEdit::AlterDomain or ISubtypes::Domain.
setDomainByRef
in interface IFieldEdit
rhs1
- 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 void setDefaultValue(Object rhs1) throws IOException, AutomationException
setDefaultValue
in interface IFieldEdit
rhs1
- A Variant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setType(int rhs1) throws IOException, AutomationException
setType
in interface IFieldEdit
rhs1
- A com.esri.arcgis.geodatabase.esriFieldType constant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setLength(int rhs1) throws IOException, AutomationException
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.
setLength
in interface IFieldEdit
rhs1
- The rhs1 (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setPrecision(int rhs1) 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.
setPrecision
in interface IFieldEdit
rhs1
- The rhs1 (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setScale(int rhs1) 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.
Precision is always returned as 0 from personal or File geodatabase fields.
setScale
in interface IFieldEdit
rhs1
- The rhs1 (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setIsNullable(boolean rhs1) throws IOException, AutomationException
setIsNullable
in interface IFieldEdit
rhs1
- The rhs1 (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setGeometryDefByRef(IGeometryDef rhs1) throws IOException, AutomationException
setGeometryDefByRef
in interface IFieldEdit
rhs1
- A reference to a com.esri.arcgis.geodatabase.IGeometryDef (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setDomainFixed(boolean rhs1) throws IOException, AutomationException
setDomainFixed
in interface IFieldEdit
rhs1
- The rhs1 (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setRequired(boolean rhs1) throws IOException, AutomationException
The Required property only applies to changes to modifying the schema of a Field's properties or blocking it from being deleted. It has no impact on the ability to update or add\delete the values within the field. Also, setting the Required field property to be True will block the user from deleting the field through the GUI, as well as through ArcObjects.
setRequired
in interface IFieldEdit
rhs1
- The rhs1 (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setEditable(boolean rhs1) throws IOException, AutomationException
setEditable
in interface IFieldEdit
rhs1
- The rhs1 (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setRasterDefByRef(IRasterDef rasterDef) throws IOException, AutomationException
RasterDef is required for creating a raster field.
setRasterDefByRef
in interface IFieldEdit2
rasterDef
- A reference to a com.esri.arcgis.geodatabase.IRasterDef (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String getModelName() throws IOException, AutomationException
Returns the model name currently associated with the field or object class.
getModelName
in interface IModelInfo
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IObjectClass
,
IField
public void setModelName(String name) throws IOException, AutomationException
setModelName
in interface IModelInfo
name
- The name (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IObjectClass
,
IField
public void getClassID(GUID[] pClassID) throws IOException, AutomationException
IPersist is a Microsoft interface. Please refer to MSDN for information about this interface.
getClassID
in interface IPersist
pClassID
- A Structure: com.esri.arcgis.support.ms.stdole.GUID (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IClone esri_clone() throws IOException, AutomationException
esri_clone
in interface IClone
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void assign(IClone src) throws IOException, AutomationException
assign
in interface IClone
src
- A reference to a com.esri.arcgis.system.IClone (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isEqual(IClone other) throws IOException, AutomationException
IsEqual returns True if the receiver and the source have the same properties. Note, this does not imply that the receiver and the source reference the same object.
isEqual
in interface IClone
other
- A reference to a com.esri.arcgis.system.IClone (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isIdentical(IClone other) throws IOException, AutomationException
IsIdentical returns true if the receiver and the source reference the same object.
isIdentical
in interface IClone
other
- A reference to a com.esri.arcgis.system.IClone (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IGPDataType IGPValue_getDataType() throws IOException, AutomationException
IGPValue_getDataType
in interface IGPValue
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isEmpty() throws IOException, AutomationException
The IsEmpty method returns if this Value object has been set or not.
isEmpty
in interface IGPValue
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void empty() throws IOException, AutomationException
The Empty method clears this Value object and releases any associated objects.
empty
in interface IGPValue
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String getAsText() throws IOException, AutomationException
The GetAsText method returns this Value object as a text string. For DataElement value objects it is the NameString. For simple value objects it is the text string for the scalar value.
getAsText
in interface IGPValue
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IGPMessage setAsText(String text) throws IOException, AutomationException
The SetAsText method sets the value of this Value object as a text string. For DataElement value objects it is the NameString. For simple value objects it is the text string representing the scalar value.
setAsText
in interface IGPValue
text
- The text (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void serialize(IXMLSerializeData data) throws IOException, AutomationException
serialize
in interface IXMLSerialize
data
- A reference to a com.esri.arcgis.system.IXMLSerializeData (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void deserialize(IXMLSerializeData data) throws IOException, AutomationException
deserialize
in interface IXMLSerialize
data
- A reference to a com.esri.arcgis.system.IXMLSerializeData (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void isDirty() throws IOException, AutomationException
IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.
isDirty
in interface IPersistStream
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void load(IStream pstm) throws IOException, AutomationException
IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.
load
in interface IPersistStream
pstm
- A reference to a com.esri.arcgis.system.IStream (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void save(IStream pstm, int fClearDirty) throws IOException, AutomationException
IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.
save
in interface IPersistStream
pstm
- A reference to a com.esri.arcgis.system.IStream (in)fClearDirty
- The fClearDirty (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void getSizeMax(_ULARGE_INTEGER[] pcbSize) throws IOException, AutomationException
IPersistStream is a Microsoft interface. Please refer to MSDN for information about this interface.
getSizeMax
in interface IPersistStream
pcbSize
- A Structure: com.esri.arcgis.system._ULARGE_INTEGER (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Object describe(String name) throws IOException, AutomationException
describe
in interface IGPDescribe
name
- The name (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |