Enum DBFDataType

java.lang.Object
java.lang.Enum<DBFDataType>
io.github.zazalng.contracts.DBFDataType
All Implemented Interfaces:
Serializable, Comparable<DBFDataType>, java.lang.constant.Constable

public enum DBFDataType extends Enum<DBFDataType>
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 Constants
    Enum Constant
    Description
    dBase 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 Type
    Method
    Description
    fromCode(char code)
    Attempts to find the DBFDataType enum constant corresponding to the given character code.
    char
    Gets the single-character code that represents this data type in the DBF header.
    Gets a human-readable description of the data type.
    Returns the enum constant of this type with the specified name.
    static DBFDataType[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • CHARACTER

      public static final DBFDataType CHARACTER
      Standard dBase Character/String field.
    • NUMERIC

      public static final DBFDataType NUMERIC
      Standard dBase Numeric field with a fixed decimal point.
    • FLOAT

      public static final DBFDataType FLOAT
      Standard dBase Float field using binary floating-point representation.
    • DATE

      public static final DBFDataType DATE
      Standard dBase Date field (format YYYYMMDD).
    • LOGICAL

      public static final DBFDataType LOGICAL
      Standard dBase Logical/Boolean field.
    • MEMO

      public static final DBFDataType MEMO
      Standard dBase Memo field, which holds a pointer to an external memo file (.dbt, .fpt).
    • CURRENCY

      public static final DBFDataType CURRENCY
      Visual FoxPro Currency type.
    • DATETIME

      public static final DBFDataType DATETIME
      Visual FoxPro DateTime type.
    • DOUBLE

      public static final DBFDataType DOUBLE
      Visual FoxPro Double precision floating-point type.
    • INTEGER

      public static final DBFDataType INTEGER
      Visual FoxPro Integer type.
    • GENERAL

      public static final DBFDataType GENERAL
      Visual FoxPro General field (typically OLE or graphics data).
    • PICTURE

      public static final DBFDataType PICTURE
      Visual FoxPro Picture field.
    • VARCHAR

      public static final DBFDataType VARCHAR
      Visual FoxPro Varchar, a variable-length character field (requires special header handling).
    • AUTOINCREMENT

      public static final DBFDataType AUTOINCREMENT
      dBase Level 7 Autoincrement field.
    • TIMESTAMP

      public static final DBFDataType TIMESTAMP
      dBase Level 7 Timestamp field.
    • UNKNOWN

      public static final DBFDataType UNKNOWN
      Fallback for an unknown or unsupported field type code.
  • Method Details

    • values

      public static DBFDataType[] 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

      public static DBFDataType 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 name
      NullPointerException - 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

      public String getDescription()
      Gets a human-readable description of the data type.
      Returns:
      The data type description.
    • fromCode

      public static DBFDataType fromCode(char code)
      Attempts to find the DBFDataType enum constant corresponding to the given character code.
      Parameters:
      code - The character code from the DBF header.
      Returns:
      The matching DBFDataType, or null if the code is not recognized.