|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectpds.util.PPITable
public class PPITable
PPITable is a class for reading and writing ASCII tables.
| Field Summary | |
|---|---|
(package private) java.lang.String[] |
mFieldName
Array of field names |
(package private) java.lang.String[] |
mFieldValue
Array of field Values |
(package private) java.io.FileInputStream |
mFile
base file object |
(package private) java.io.BufferedReader |
mReader
File object reader |
(package private) int |
mRecordAt
Current record count |
| Constructor Summary | |
|---|---|
PPITable()
Creates an instance. |
|
| Method Summary | |
|---|---|
boolean |
close()
Close a connection. |
static java.lang.String |
copy(java.lang.String source,
java.lang.String destination)
Copy a file from one location to another. |
java.lang.String |
getValue(int index)
Return the value associated with a field given the index of the field. |
boolean |
open(java.lang.String pathName,
boolean nameHeader)
Open a table containing ASCII comma seperated values (CSV). |
java.lang.String[] |
parseLine(java.lang.String buffer)
Parse a string, using a comma (",") as the delimiter. |
boolean |
readRecord()
Read one record from a connection and parse the record into fields. |
int |
recordAt()
Return the count of the number of records read from the table. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
java.io.FileInputStream mFile
java.io.BufferedReader mReader
java.lang.String[] mFieldName
java.lang.String[] mFieldValue
int mRecordAt
| Constructor Detail |
|---|
public PPITable()
| Method Detail |
|---|
public boolean open(java.lang.String pathName,
boolean nameHeader)
pathName - the path and name of the file containing the table of data.nameHeader - if true the first line of the file
is read, parsed and used to define the name of each
field.. If false no header line is read
and no names are defined for each field.
true if the file was opened.
false otherwise.public boolean close()
true if the connection to the source
was closed properly.
false otherwise.public boolean readRecord()
true if read was successful
false otherwise.public int recordAt()
public java.lang.String[] parseLine(java.lang.String buffer)
public java.lang.String getValue(int index)
index - the index of the field for which to extract the value.
public static java.lang.String copy(java.lang.String source,
java.lang.String destination)
source - the name of the source file.destination - the name of the file to copy the source file to.
true if the copy is successful.
false otherwise.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||