Package io.github.zazalng.contracts
Enum DBFDataType
- All Implemented Interfaces:
Serializable,Comparable<DBFDataType>,java.lang.constant.Constable
Defines the possible data types for fields within a DBF file.
The types cover standard dBase III+ formats as well as extensions found in later versions like Visual FoxPro (VFP) and dBase Level 7.
- Since:
- 1.0.0
- Author:
- Zazalng
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptiondBase Level 7 Autoincrement field.Standard dBase Character/String field.Visual FoxPro Currency type.Standard dBase Date field (format YYYYMMDD).Visual FoxPro DateTime type.Visual FoxPro Double precision floating-point type.Standard dBase Float field using binary floating-point representation.Visual FoxPro General field (typically OLE or graphics data).Visual FoxPro Integer type.Standard dBase Logical/Boolean field.Standard dBase Memo field, which holds a pointer to an external memo file (.dbt, .fpt).Standard dBase Numeric field with a fixed decimal point.Visual FoxPro Picture field.dBase Level 7 Timestamp field.Fallback for an unknown or unsupported field type code.Visual FoxPro Varchar, a variable-length character field (requires special header handling). -
Method Summary
Modifier and TypeMethodDescriptionstatic DBFDataTypefromCode(char code) Attempts to find theDBFDataTypeenum constant corresponding to the given character code.chargetCode()Gets the single-character code that represents this data type in the DBF header.Gets a human-readable description of the data type.static DBFDataTypeReturns the enum constant of this type with the specified name.static DBFDataType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
CHARACTER
Standard dBase Character/String field. -
NUMERIC
Standard dBase Numeric field with a fixed decimal point. -
FLOAT
Standard dBase Float field using binary floating-point representation. -
DATE
Standard dBase Date field (format YYYYMMDD). -
LOGICAL
Standard dBase Logical/Boolean field. -
MEMO
Standard dBase Memo field, which holds a pointer to an external memo file (.dbt, .fpt). -
CURRENCY
Visual FoxPro Currency type. -
DATETIME
Visual FoxPro DateTime type. -
DOUBLE
Visual FoxPro Double precision floating-point type. -
INTEGER
Visual FoxPro Integer type. -
GENERAL
Visual FoxPro General field (typically OLE or graphics data). -
PICTURE
Visual FoxPro Picture field. -
VARCHAR
Visual FoxPro Varchar, a variable-length character field (requires special header handling). -
AUTOINCREMENT
dBase Level 7 Autoincrement field. -
TIMESTAMP
dBase Level 7 Timestamp field. -
UNKNOWN
Fallback for an unknown or unsupported field type code.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-
getCode
public char getCode()Gets the single-character code that represents this data type in the DBF header.- Returns:
- The field type code (e.g., 'C', 'N', 'D').
-
getDescription
Gets a human-readable description of the data type.- Returns:
- The data type description.
-
fromCode
Attempts to find theDBFDataTypeenum constant corresponding to the given character code.- Parameters:
code- The character code from the DBF header.- Returns:
- The matching
DBFDataType, ornullif the code is not recognized.
-