com.mapinfo.midev.feature

## Class AttributeType

- java.lang.Object
- - java.lang.Enum
  - - com.mapinfo.midev.feature.AttributeType

All Implemented Interfaces:
  Serializable, Comparable

    public final class AttributeType
    extends Enum

Enumeration class for the data types supported by the Feature and Data Access models.

See Also:
  Serialized Form

### Field Summary

Fields
`static AttributeType` `BINARY` Corresponds to an array of Java `byte`s.
`static AttributeType` `BOOLEAN` Attribute values are limited to `true` and `false`.
`static AttributeType` `BYTE` Corresponds to the Java `byte` primitive type.
`static AttributeType` `CHAR` Corresponds to the Java `char` primitive type.
`static AttributeType` `DATE` Corresponds to the `MIDate` class.
`static AttributeType` `DATE_TIME` Corresponds to the `MIDateTime` class.
`static AttributeType` `DATE_TIME_ZONE` Corresponds to the `MIDateTimeZone` class.
`static AttributeType` `DBASE_DECIMAL` Identifies a double-precision floating point data type that has defined persistence characteristics for total width and decimal place precision.
`static AttributeType` `DOUBLE` Corresponds to the Java `double` primitive type.
`static AttributeType` `FEATURE` Corresponds to implementations of the `IFeature` interface.
`static AttributeType` `FEATURE_COLLECTION` Corresponds to implementations of the `IFeatureCollection` interface.
`static AttributeType` `FEATURE_GEOMETRY` Corresponds to implementations of the `IFeatureGeometry` interface.
`static AttributeType` `FLOAT` Corresponds to the Java `float` primitive type.
`static AttributeType` `INTEGER` Corresponds to the Java `int` primitive type.
`static AttributeType` `LONG_INTEGER` Corresponds to the Java `long` primitive type.
`static AttributeType` `MULTIFEATURE_COLLECTION` Corresponds to implementations of the `IMultiFeatureCollection` interface.
`static AttributeType` `RASTER` Corresponds to implementations of the `IRasterDataset` interface.
`static AttributeType` `SHORT_INTEGER` Corresponds to the Java `short` primitive type.
`static AttributeType` `STRING` Corresponds to the Java `String` type.
`static AttributeType` `STYLE` Corresponds to implementations of the `IStyle` interface.
`static AttributeType` `TIME` Corresponds to the `MITime` class.
`static AttributeType` `TIMESPAN` Corresponds to the `MITimespan` class.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `isDateType()` Indiacates if the attribute type corresponds to a Date Time type(date, time or combination of date time)
`boolean` `isNumeric()` Indicates if this attribute type corresponds to a numeric type (integer or floating point).
`boolean` `isRealNumber()` Indicates if this attribute type corresponds to a floating point (or real) number.
`boolean` `isWholeNumber()` Indicates if this attribute type corresponds to a whole (or integer) number.
`static AttributeType` `valueOf(String name)`
`static AttributeType[]` `values()`

### Methods inherited from class java.lang.Enum

`compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

### Field Detail

#### BOOLEAN

    public static final AttributeType BOOLEAN

Attribute values are limited to `true` and `false`.

Corresponds to the Java `boolean` primitive type.

#### INTEGER

    public static final AttributeType INTEGER

Corresponds to the Java `int` primitive type.

#### SHORT_INTEGER

    public static final AttributeType SHORT_INTEGER

Corresponds to the Java `short` primitive type.

#### LONG_INTEGER

    public static final AttributeType LONG_INTEGER

Corresponds to the Java `long` primitive type.

#### FLOAT

    public static final AttributeType FLOAT

Corresponds to the Java `float` primitive type.

#### DOUBLE

    public static final AttributeType DOUBLE

Corresponds to the Java `double` primitive type.

#### DBASE_DECIMAL

    public static final AttributeType DBASE_DECIMAL

Identifies a double-precision floating point data type that has defined persistence characteristics for total width and decimal place precision. The `IAttributeDefinition.getWidth` and `IAttributeDefinition.getDecimals` properties apply to an attribute of this type. The width refers to the total width of the storage capacity of the attribute while the decimals refers to the number of significant digits that can be stored after the decimal point. Thus, an attribute of type DBASE_DECIMAL with a width of 6 and decimal precision of 1, for example, could store the range of values [-999.9 to 9999.9], inclusive.

Note that all access to and processing of an attribute of type DBASE_DECIMAL is the same as attributes of type DOUBLE. Intermediate results from calculations between two decimal types such as division and multiplication) will be treated as doubles. Features may hold onto these values as doubles and only restrict the significant number of decimal digits at the time of persistence without exception. Feature implementations should, however, validate the overall width of decimals at the time a value is set. For example, an attribute defined as decimal with a width of 6 and a decimal precision of 1 can hold onto a value of 1234.5678 and will persist this value as 1234.6. However, the value 12345.6 cannot be persisted and should not be accepted by the feature implementation.

#### STRING

    public static final AttributeType STRING

Corresponds to the Java `String` type. Attributes of type STRING may have defined persistence characteristics for total width or number of characters allowed. The `IAttributeDefinition.getWidth` property applies to an attribute of this type.

#### BINARY

    public static final AttributeType BINARY

Corresponds to an array of Java `byte`s. Attributes of type BINARY may have defined persistence characteristics for total width or number of bytes allowed. The `IAttributeDefinition.getWidth` property applies to an attribute of this type.

#### CHAR

    public static final AttributeType CHAR

Corresponds to the Java `char` primitive type.

#### BYTE

    public static final AttributeType BYTE

Corresponds to the Java `byte` primitive type.

#### DATE

    public static final AttributeType DATE

Corresponds to the `MIDate` class. Attributes of this type store date values containing only year, month, and day values.

#### TIME

    public static final AttributeType TIME

Corresponds to the `MITime` class. Attributes of this type store time values containing only hour, minute, and second values.

#### DATE_TIME

    public static final AttributeType DATE_TIME

Corresponds to the `MIDateTime` class. Attributes of this type store time values containing year, month, day, hour, minute, and second values.

#### DATE_TIME_ZONE

    public static final AttributeType DATE_TIME_ZONE

Corresponds to the `MIDateTimeZone` class. Attributes of this type store time values containing year, month, day, hour, minute, and second values with an associated timezone.

#### TIMESPAN

    public static final AttributeType TIMESPAN

Corresponds to the `MITimespan` class. Attributes of this type store time values that represent a time duration measured in days, hours, minutes, and seconds.

#### FEATURE_GEOMETRY

    public static final AttributeType FEATURE_GEOMETRY

Corresponds to implementations of the `IFeatureGeometry` interface.

#### STYLE

    public static final AttributeType STYLE

Corresponds to implementations of the `IStyle` interface.

#### RASTER

    public static final AttributeType RASTER

Corresponds to implementations of the `IRasterDataset` interface.

#### FEATURE

    public static final AttributeType FEATURE

Corresponds to implementations of the `IFeature` interface. Attributes that are of this type contain feature instances as their values. This may be encountered for complex types.

For example, a database server may define a type called Address as containing fields Street, City, State, and Zip and may then allow a customer table to be defined with fields Name, PromotionCode, ShipTo, and BillTo where ShipTo and BillTo would be fields of type Address. Features obtained from the Customer table would have attributes of type STRING, STRING, FEATURE, and FEATURE, respectively. The FEATURE types representing the server-side Address type would contain (nested) fields of type STRING, STRING, STRING, and STRING (for Street, City, State, and Zip, respectively).

#### FEATURE_COLLECTION

    public static final AttributeType FEATURE_COLLECTION

Corresponds to implementations of the `IFeatureCollection` interface. Attributes that are of this type contain feature collection instances as data values. This may be used to expose data type such as arrays or nested tables for data sources that support such concepts.

#### MULTIFEATURE_COLLECTION

    public static final AttributeType MULTIFEATURE_COLLECTION

Corresponds to implementations of the `IMultiFeatureCollection` interface. Attributes that are of this type contain multi-feature collection instances as data values. This may be used to expose data type such as variable-sized multi-dimensional arrays for data sources that support such concepts.

### Method Detail

#### values

    public static AttributeType[] values()

#### valueOf

    public static AttributeType valueOf(String name)

#### isRealNumber

    public boolean isRealNumber()

Indicates if this attribute type corresponds to a floating point (or real) number.

Returns:
  `true` for attribute types `DOUBLE`, `FLOAT`, and `DBASE_DECIMAL`; `false` otherwise.

#### isWholeNumber

    public boolean isWholeNumber()

Indicates if this attribute type corresponds to a whole (or integer) number.

Returns:
  `true` for attribute types `INTEGER`, `SHORT_INTEGER`, `LONG_INTEGER`, `BYTE`, and `CHAR`; `false` otherwise.

#### isNumeric

    public boolean isNumeric()

Indicates if this attribute type corresponds to a numeric type (integer or floating point).

Returns:
  `true` for attribute types that satisfy `isRealNumber` or `isWholeNumber`; `false` otherwise.

#### isDateType

    public boolean isDateType()

Indiacates if the attribute type corresponds to a Date Time type(date, time or combination of date time)

Returns:
  `true` for attribute types `DATE`,`DATE_TIME`, `TIME` ,`TIMESPAN`,`DATE_TIME_ZONE`, `false` otherwise.