|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
FileEx interface defines all methods needed to provide the extended file functions of BDL. Use the File load functions of SilkPerformer to open and load a file. These functions return objects that implement FileEx which can be used to access a loaded file. Every method that starts with an upper case letter has a complement in BDL, the benchmark description language of Segue's SilkPerformer.
Example: Prints first column of every line of the file c:/MyCustomers.txt
...
// Load the file
FileEx customers = silkPerformer.FileCSVLoad("c:/MyCustomers.txt", ";");
// Retrieve the number of rows the file contains
int numRows = customers.FileGetNumRows();
// Print all rows, begin with first row
for(int i = 1; i <= numRows; i++)
{
customers.FileGetRow(i);
// Print the first column of every row
silkPerformer.Print("Row #" + i + ": " + customers.FileGetCol(1,256));
}
// Discard the file
customers.FileUnload();
customers = null;
...
SilkPerformer.FileCSVLoad(String,String),
SilkPerformer.FileCSVLoadGlobal(String,String),
SilkPerformer.FileFixedLoad(String,String),
SilkPerformer.FileFixedLoadGlobal(String,String),
SilkPerformer| Method Summary | |
java.lang.String |
FileGetCol(int col,
int max)
Retrieves a column value of the current row. |
void |
FileGetFirstRow()
Sets the current row pointer to the first row in the file. |
int |
FileGetNextRow()
Sets the row pointer to the row after the current row. |
int |
FileGetNumRows()
Calculates the number of rows the file contains. |
int |
FileGetRndRow()
Sets the row pointer to a randomly selected row of the file. |
int |
FileGetRow(int row)
Sets the current row pointer to the row number specified. |
void |
FileUnload()
Discards all resources of a loaded file. |
java.lang.String |
getFileName()
Retrieves the name of the file that is represented by this FileEx object. |
boolean |
isGlobal()
Retrieves if a file has a global row pointer. |
| Method Detail |
public java.lang.String getFileName()
public boolean isGlobal()
public void FileGetFirstRow()
throws java.lang.Exception
java.lang.Exception
public int FileGetNextRow()
throws java.lang.Exception
java.lang.Exception
public int FileGetRndRow()
throws java.lang.Exception
java.lang.Exception
public int FileGetNumRows()
throws java.lang.Exception
java.lang.Exception
public int FileGetRow(int row)
throws java.lang.Exception
row - Wanted number of the row with 1 for the first row.
java.lang.Exception
public java.lang.String FileGetCol(int col,
int max)
throws java.lang.Exception
col - Wanted number of the column with 1 for the first column.max - Maximum length of the returned string, if it is longer
it would be truncated.
java.lang.Exception
public void FileUnload()
throws java.lang.Exception
java.lang.ExceptionSilkPerformer.FileCSVLoad(String,String),
SilkPerformer.FileCSVLoadGlobal(String,String),
SilkPerformer.FileFixedLoad(String,String),
SilkPerformer.FileFixedLoadGlobal(String,String)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||