Class DbaseFile


  • public class DbaseFile
    extends Object
    Class to read a dbase file in its entirety.
    • Field Detail

      • DBASEIII

        public static int DBASEIII
      • DBASEIV

        public static int DBASEIV
      • DBASE5DOS

        public static int DBASE5DOS
      • DBASE5WIN

        public static int DBASE5WIN
    • Constructor Detail

      • DbaseFile

        public DbaseFile​(String spec)
                  throws IOException
        Parameters:
        spec - Location of the *.dbf file, as either a URL or filename
        Throws:
        IOException
      • DbaseFile

        public DbaseFile​(File file)
        Parameters:
        file - A file object of the *.dbf file.
    • Method Detail

      • getField

        public DbaseData getField​(int index)
        Extract the data for a field by field index number.
        Parameters:
        index - Column number of the field to extract.
        Returns:
        A DbaseData object if the column is within bounds. Otherwise, null.
      • getField

        public DbaseData getField​(String Name)
        Extract the data for a given field by name.
        Parameters:
        Name - String with the name of the field to retrieve.
        Returns:
        A DbaseData object if the name was found or null if not found
      • getDoublesByName

        public double[] getDoublesByName​(String Name)
        Extract the double array of data for a field by Name.
        Parameters:
        Name - String with the name of the field to retrieve
        Returns:
        A double[] if valid numeric field, otherwise null
      • getStringsByName

        public String[] getStringsByName​(String Name)
        Extract the string array of data for a field by Name.
        Parameters:
        Name - String with the name of the field to retrieve
        Returns:
        A String[] if valid character field, otherwise null
      • getBooleansByName

        public boolean[] getBooleansByName​(String Name)
        Extract the boolean array of data for a field by Name.
        Parameters:
        Name - String with the name of the field to retrieve
        Returns:
        A boolean[] if valid character field, otherwise null
      • getFieldName

        public String getFieldName​(int i)
        Get the name of a field by column number.
        Parameters:
        i - The column number of the field name.
        Returns:
        A String with the field name or null if out of bounds
      • getFieldNames

        public String[] getFieldNames()
        Get a list of all the field names in the dbase file
        Returns:
        A String array of all the field names
      • getNumFields

        public int getNumFields()
        Get the number of fields in the file.
        Returns:
        number of fields
      • getNumRecords

        public int getNumRecords()
        Returns:
        number of records in the dbase file
      • isLoaded

        public boolean isLoaded()
        Returns:
        Boolean true if the data has been loaded, otherwise false.