- java.lang.Object
-
- java.lang.Enum<DBaseFieldType>
-
- org.arakhne.afc.io.dbase.DBaseFieldType
-
- All Implemented Interfaces:
Serializable
,Comparable<DBaseFieldType>
public enum DBaseFieldType extends Enum<DBaseFieldType>
Describes the supported types in DBase fields.----------------------------------------------------------- Field Type (1 byte) ----------------------------------------------------------- Char. Size Type Content ----------------------------------------------------------- C 1..n STRING ASCII fill with spaces (not final \0 character). n=64kb (using deci. counter) n=32kb (using deci. counter) n=254 D 8 DATE [0-9]{8} with in format YYYYMMDD F 1..n NUMERIC [-.0-9]+, variable position of floating position N 1..n NUMERIC [-.0-9]+, fixed position, no floating position L 1 LOGICAL [TtFfYyNn ?] M 10 MEMORY 10 digits representing the start block position in the .dbt file, or 10 spaces if no entry in memo V 10 VARIABLE data in .dbv file, 4 bytes: start pos in memory 4 bytes: block size 1 byte: subtype 1 byte: reserved (0x1A) 10 spaces if no entry in .dbv P 10 PICTURE binary data in .ftp file (same structure as M type) B 10 BINARY binary data in .dbt file (same structure as M type) G 10 GENERAL OLE objects (same structure as M type) 2 2 NUMERIC short integer +/- 32762 4 4 NUMERIC long integer +/- 2147483647 8 8 NUMERIC signed double IEEE -----------------------------------------------------------
- Since:
- 14.0
- Version:
- 17.0 2020-01-04 14:41:52
- Author:
- Stéphane GALLAND, Olivier LAMOTTE
- Maven Group Id:
- org.arakhne.afc.advanced
- Maven Artifact Id:
- dbasefile
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BINARY
Binary block.BOOLEAN
Boolean.DATE
Date.DOUBLE
IEEE signer double.FLOATING_NUMBER
Floating number.GENERAL
OLE Object.INTEGER_2BYTES
2 byte integer.INTEGER_4BYTES
4 byte integer.MEMORY
Memory block.NUMBER
No-floating number.PICTURE
Picture block.STRING
String.VARIABLE
Variable block.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DBaseFieldType
fromAttributeType(AttributeType type)
Replies the field type corresponding to the attribute type.static DBaseFieldType
fromByte(byte abyte)
Replies the field type that corresponds to the specified byte.int
getDecimalPointPosition()
Replies the position of the decimal point of a field that corresponds to this type.int
getDecimalPointPosition(String value)
Replies the position of the decimal point of a field that corresponds to this type.int
getFieldSize()
Replies the size in bytes of a field that corresponds to this type.int
getFieldSize(String value)
Replies the size in bytes of a field that corresponds to this type.AttributeType
toAttributeType()
Replies the attribute type corresponding to the field type.byte
toByte()
Replies the byte representation of this type.static DBaseFieldType
valueOf(String name)
Returns the enum constant of this type with the specified name.static DBaseFieldType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
GENERAL
public static final DBaseFieldType GENERAL
OLE Object.
-
STRING
public static final DBaseFieldType STRING
String.
-
DATE
public static final DBaseFieldType DATE
Date.
-
FLOATING_NUMBER
public static final DBaseFieldType FLOATING_NUMBER
Floating number.
-
NUMBER
public static final DBaseFieldType NUMBER
No-floating number.
-
BOOLEAN
public static final DBaseFieldType BOOLEAN
Boolean.
-
INTEGER_2BYTES
public static final DBaseFieldType INTEGER_2BYTES
2 byte integer.
-
INTEGER_4BYTES
public static final DBaseFieldType INTEGER_4BYTES
4 byte integer.
-
DOUBLE
public static final DBaseFieldType DOUBLE
IEEE signer double.
-
MEMORY
public static final DBaseFieldType MEMORY
Memory block.
-
VARIABLE
public static final DBaseFieldType VARIABLE
Variable block.
-
PICTURE
public static final DBaseFieldType PICTURE
Picture block.
-
BINARY
public static final DBaseFieldType BINARY
Binary block.
-
-
Method Detail
-
values
public static DBaseFieldType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DBaseFieldType c : DBaseFieldType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DBaseFieldType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
fromByte
@Pure public static DBaseFieldType fromByte(byte abyte) throws DBaseFileException
Replies the field type that corresponds to the specified byte.- Parameters:
abyte
- is a byte that describes the dBase field type.- Returns:
- the corresponding type.
- Throws:
DBaseFileException
- if the given byte is unknown.
-
toByte
@Pure public byte toByte()
Replies the byte representation of this type.- Returns:
- the byte used by dBase to represent this type of field.
-
toAttributeType
@Pure public AttributeType toAttributeType()
Replies the attribute type corresponding to the field type.- Returns:
- the associated attribute type.
-
fromAttributeType
@Pure public static DBaseFieldType fromAttributeType(AttributeType type) throws DBaseFileException
Replies the field type corresponding to the attribute type.- Parameters:
type
- is the attribute type to convert- Returns:
- the dBase field type that corresponds to the given attribute type.
- Throws:
DBaseFileException
- if the given type is unknown.
-
getFieldSize
@Pure public int getFieldSize()
Replies the size in bytes of a field that corresponds to this type.- Returns:
- the size in bytes of a field that corresponds to this type.
-
getFieldSize
@Pure public int getFieldSize(String value)
Replies the size in bytes of a field that corresponds to this type.- Parameters:
value
- the value.- Returns:
- the size in bytes of a field that corresponds to this type.
-
getDecimalPointPosition
@Pure public int getDecimalPointPosition()
Replies the position of the decimal point of a field that corresponds to this type.- Returns:
- the position of the decimal point.
-
getDecimalPointPosition
@Pure public int getDecimalPointPosition(String value)
Replies the position of the decimal point of a field that corresponds to this type.- Parameters:
value
- the value.- Returns:
- the position of the decimal point
-
-