public interface IOInterface
| Modifier and Type | Field and Description |
|---|---|
static String |
inputEncoding
file input encoding
|
static String |
inputseparator
file input separator
|
static String |
outputEncoding
file output encoding
|
static String |
outputseparator
file output separator
|
| Modifier and Type | Method and Description |
|---|---|
void |
closeOutput()
simply close the outputfile you must call this method before the program
terminates
|
IOIterator |
getLineIterator()
returns the IOIterator to iterate over file data
|
IOIterator |
select(String tablename)
select all cols from table "tablename" and returns an iterator
|
IOIterator |
select(String tablename,
String[] cols)
select the "cols" from table "tablename" and returns an iterator
|
IOIterator |
sendInputQuery(String query)
iterates over the resultset of a given query please read the
IOIteratorInterface code
|
boolean |
sendOutputQuery(String query)
send a query to database
|
void |
setupInput(String inputfile)
setup the inputfile for reading uses the separator to determine the
amount of columns (use a simple split(separator)
|
void |
setupInput(String inputfile,
int cols)
setup (open) the inputfile for reading
|
void |
setupInput(String database,
String username,
String password)
same as setupOutput( String ), but with hostname="localhost" and
port=3306
|
void |
setupInput(String database,
String username,
String password,
String hostname,
int port)
setup the database to write in open a connection to db
|
void |
setupOutput(String outputfile)
setup the outputfile to write in you must call the closeOutput() to flush
and close the outputfile
|
void |
setupOutput(String database,
String username,
String password)
same as above, but with hostname="localhost" and port=3306
|
void |
setupOutput(String database,
String username,
String password,
String hostname,
int port)
same as for setupInput, but for writing
|
boolean |
writeLine(String line)
write a line to an open file see
de.uni_leipzig.asv.utils.IOInterface#setupOutput(java.lang.String)
|
static final String inputEncoding
static final String outputEncoding
static final String inputseparator
static final String outputseparator
IOIterator getLineIterator() throws IOWrapperException
IOWrapperExceptionboolean writeLine(String line) throws IOWrapperException
IOWrapperExceptionvoid closeOutput()
throws IOWrapperException
IOWrapperExceptionvoid setupInput(String inputfile, int cols) throws IOWrapperException
inputfile - the name of the input filecols - in file, separated by tabs - use 0 for auto-detection (dynamic
col-count)IOWrapperExceptionvoid setupInput(String inputfile) throws IOWrapperException
inputfile - to open the file for readIOWrapperExceptionvoid setupOutput(String outputfile) throws IOWrapperException
outputfile - to open the file to write intoIOWrapperExceptionvoid setupInput(String database, String username, String password, String hostname, int port) throws IOWrapperException
database - name, "de" for exampleusername - to log inpassword - to log inhostname - the database runs onport - =
database portIOWrapperExceptionvoid setupInput(String database, String username, String password) throws IOWrapperException
database - username - password - IOWrapperExceptionvoid setupOutput(String database, String username, String password, String hostname, int port) throws IOWrapperException
database - username - password - hostname - port - IOWrapperExceptionvoid setupOutput(String database, String username, String password) throws IOWrapperException
database - username - password - IOWrapperExceptionIOIterator select(String tablename, String[] cols) throws IOWrapperException
tablename - cols - IOWrapperExceptionIOIterator select(String tablename) throws IOWrapperException
tablename - IOWrapperExceptionIOIterator sendInputQuery(String query) throws IOWrapperException
query - IOWrapperExceptionboolean sendOutputQuery(String query) throws IOWrapperException
query - IOWrapperExceptionCopyright © 2013. All rights reserved.