Class ParadoxFile
java.lang.Object
|
+----ParadoxFile
- public class ParadoxFile
- extends Object
ParadoxFile
-
ParadoxFile()
- construct class needing call to readTableHeader(filename) to use
-
ParadoxFile(String)
- open given file and read header data
-
closeParadoxFile()
- close file
also called on any file error to assure pdxRW set null so isOK() returns false;
data block and record buffer also set null to indicate unsafe to use
-
formatDate(int[])
- format date as mo/da/year string
-
getCurrentRecordNumber()
- get current record number
-
getDateField(int)
- get value of date field by offset into field list
-
getDateField(String)
- get value of named date field
-
getFieldCount()
- get number of fields in each record
-
getFieldNames()
- get field names
-
getFieldTypes()
- get field types
-
getFirstRecord()
- get first record in paradox table to rawRecordData
-
getFormattedField(int)
- format data for reports
-
getIntField(int)
- get value of small integer field by offset in field list
-
getIntField(String)
- get value of named small integer field
-
getKeyFieldCount()
- get number of key fields
-
getLastRecord()
- get last record in paradox table
-
getNextRecord()
- get next record in paradox table to rawRecordData
-
getNumberField(int)
- get value of numeric field by offset in field list
-
getNumberField(String)
- get value of named numeric field
-
getPreviousRecord()
- get previous record in paradox table
-
getRecordCount()
- get number of records
-
getStringField(int)
- get value of String field by offset into field list
-
getStringField(String)
- get value of named String field
-
isDataReady()
- did last record fetch succeed?
-
isOK()
- is paradox file ready to use?
-
main(String[])
- ParadoxFile command line handler
-
readTableHeader(String)
- open table and read header data
-
toString()
-
ParadoxFile
public ParadoxFile()
- construct class needing call to readTableHeader(filename) to use
ParadoxFile
public ParadoxFile(String fileName)
- open given file and read header data
- Parameters:
- name - of paradox version 3.5 table
follow with isOK() test to determine if table ready to use
toString
public String toString()
- Overrides:
- toString in class Object
isOK
public boolean isOK()
- is paradox file ready to use?
- Returns:
- true if file ready for use
ready to use means file found available for read and write, header read,
description values parsed, and a request for table record can be honored.
isDataReady
public boolean isDataReady()
- did last record fetch succeed?
- Returns:
- true if valid data available
readTableHeader
public void readTableHeader(String fileName)
- open table and read header data
- Parameters:
- InputFileName
returns - without header variables set on error
closeParadoxFile
public void closeParadoxFile()
- close file
also called on any file error to assure pdxRW set null so isOK() returns false;
data block and record buffer also set null to indicate unsafe to use
getFirstRecord
public void getFirstRecord()
- get first record in paradox table to rawRecordData
getNextRecord
public void getNextRecord()
- get next record in paradox table to rawRecordData
getPreviousRecord
public void getPreviousRecord()
- get previous record in paradox table
getLastRecord
public void getLastRecord()
- get last record in paradox table
getFieldNames
public String[] getFieldNames()
- get field names
- Returns:
- String array of field names
note: this gives recipient opportunity to modify array element values
getFieldTypes
public char[] getFieldTypes()
- get field types
- Returns:
- char array of field type codes
note: this gives recipient opportunity to modify array element values
getRecordCount
public int getRecordCount()
- get number of records
- Returns:
- number of records in file
getCurrentRecordNumber
public int getCurrentRecordNumber()
- get current record number
- Returns:
- current record index in table
getFieldCount
public int getFieldCount()
- get number of fields in each record
- Returns:
- field count
getKeyFieldCount
public int getKeyFieldCount()
- get number of key fields
- Returns:
- key field count
getFormattedField
public String getFormattedField(int fieldIdx)
- format data for reports
- Parameters:
- field - list offest
- Returns:
- string with field data using default format or "" on unknown
getNumberField
public double getNumberField(String fieldName)
- get value of named numeric field
- Parameters:
- field - name
- Returns:
- double value, NaN indicates no field data
getNumberField
public double getNumberField(int fieldIdx)
- get value of numeric field by offset in field list
- Parameters:
- field - offset in record
- Returns:
- double value, NaN indicates no field data
getIntField
public int getIntField(String fieldName)
- get value of named small integer field
- Parameters:
- field - name
- Returns:
- double value, INT_NULL indicates no field data
getIntField
public int getIntField(int fieldIdx)
- get value of small integer field by offset in field list
- Parameters:
- field - offset in record
- Returns:
- double value, INT_NULL indicates no field data
getDateField
public int[] getDateField(String fieldName)
- get value of named date field
- Parameters:
- field - name
- Returns:
- int array with year, month, and day or null on blank
getDateField
public int[] getDateField(int fieldIdx)
- get value of date field by offset into field list
- Parameters:
- field - name
- Returns:
- int array with year, month, and day or null on blank
formatDate
public static String formatDate(int yrMoDa[])
- format date as mo/da/year string
- Parameters:
- getDateField - return integer array
- Returns:
- string in form mo/da/year
getStringField
public String getStringField(String fieldName)
- get value of named String field
- Parameters:
- field - name
- Returns:
- String, null indicates no field data
getStringField
public String getStringField(int fieldIdx)
- get value of String field by offset into field list
- Parameters:
- field - name
- Returns:
- String, null indicates no field data
main
public static void main(String args[])
- ParadoxFile command line handler
- Parameters:
- name - of Paradox file to examine
usage: 'java ParadoxFile table.db'
writes record data to standard output