public class CSValueDB
extends java.lang.Object
.csv file.
This class uses classes CSValueRecord and FieldValue. The database
is basically an array of CSValueRecords, and each record of which is basically an
array of FieldValues.| Constructor and Description |
|---|
CSValueDB(CSValueRecord[] ra,
char[] ta,
java.lang.String[] fna)
Instantiate a database.
|
CSValueDB(java.lang.String fileName)
Load the database from a file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dumpCSV(java.lang.String csvFile)
Write the database to a file in
.csv format. |
java.lang.String[] |
getFieldNames()
Get the field names of the records.
|
char[] |
getFieldTypes()
Get the field types of the records.
|
int |
getNumFields()
Get the number of fields per record.
|
int |
getNumRecords()
Get the number of records in the database.
|
CSValueRecord[] |
getRecords()
Get the records of the database.
|
java.lang.String |
toString()
Return a
String representing the database. |
public CSValueDB(java.lang.String fileName)
fileName - The .csv file containing the database.public CSValueDB(CSValueRecord[] ra, char[] ta, java.lang.String[] fna)
ra - The array of records.ta - The array of types.
Type i is int,
type d is double, and
type s is String.fna - The array of field names.public int getNumRecords()
public int getNumFields()
public java.lang.String[] getFieldNames()
public char[] getFieldTypes()
i is int,
type d is double, and
type s is String.public CSValueRecord[] getRecords()
public java.lang.String toString()
String representing the database.toString in class java.lang.Objectpublic void dumpCSV(java.lang.String csvFile)
.csv format.csvFile - The file name to write to.