|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectiio_v2.IIO
public class IIO
| Constructor Summary | |
|---|---|
IIO(java.lang.String path,
java.lang.String fileType)
|
|
IIO(java.lang.String path,
java.lang.String fileType,
java.lang.String openMode)
|
|
| Method Summary | |
|---|---|
int |
append(Record rec)
Appends the passed record object to the end of the attached open file If the file type is indexed and if the key value exists, an error code is generated If the file type is sequential, the record is simply added to the end of the file regardless of the record content Passed argument value is a Record Class Object. |
void |
clearErrorLogFile()
Clear the error logging file |
int |
close()
Disconnects the file from the application and writes all open buffers to disk Used to effectively disconnect the physical file from the run unit Flushes all open buffers to disk All files must be closed in order to finalize the write operations Files opened for input are not flushed. |
int |
deleteRecord(int key)
Delete the record object associated with the passed numeric key value for this sequential file object. |
int |
deleteRecord(java.lang.String key)
Delete the record object associated with the passed string key value for this indexed file object. |
void |
dumpKeys(int count)
Dumps a number of keys from the file to the system out device Dumps keys up to the passed integer count value or the last record whichever comes first. |
void |
dumpRecords(int count)
Dumps a number of records and keys from the file to the system out device Dumps records up to the passed integer count value. |
int |
eraseFile()
Clears all records form this file. |
boolean |
existsRecord(java.lang.String key)
Tests to see if the passed key value exists in the set of keys for this file |
int |
getIOStatus()
Gets the current I/O Status code Returns the most recent I/O status. |
java.util.ArrayList |
getKeys()
Get all the keys from the file and put to an arraylist |
java.lang.String |
getMessage(int status)
Gets the associated error control message for the status code that was passed. |
int |
getRecordCount()
Get the current record count for this file object |
int |
open(java.lang.String openMode)
File Open operation is used to attach the associated filename to the current run unit If the open mode is "output", the file is initialized If the open mode is "input", the file pointer is set to the first(zeroth) record If the open mode is set to "append" or "extend", the file pointer is set past the last record in the file. |
Record |
read(int key)
Reads a record from a sequential file based upon the passed integer key value If the key exists, a Record object is returned and the I/O Status variable is set to Zero If key does not exist, a null object is returned and the IO Status is set to 26, NO_FIND. |
Record |
read(java.lang.String key)
Reads a record from an indexed file based upon the passed key value If the key exists, a Record object is returned and the I/O Status variable is set to Zero If key does not exist, a null object is returned and the IO Status is set to 26, NO_FIND. |
Record |
readFirst()
Read the first record in the file. |
Record |
readNext()
Read the next record in the file relative to the current record position For indexed files it is the next record in the key sequence For sequential files it is the next physical record. |
int |
setFileName(java.lang.String filename)
Sets the working filename for this object Generally this is a fully qualified path name. |
int |
setLowerLimit(java.lang.String key)
Sets a starting point (lower limit) in the indexed file upon which to begin all subsequent reading The default starting point for a recently opened file is the first record. |
int |
write(Record rec)
Write the passed record object to the attached open file object If Record object is null return an error If open mode is "Input" return an error Passed value is a Record Class Object. |
void |
writeErrorsToJOptionPane(boolean value)
Write I/O Errors to a JOptionPane Component (JOptionPane.showMessageDialog) |
void |
writeErrorsToLogFile(boolean value)
Write I/O Errors to the Error Logging file (IO_Errors_Log.txt) |
void |
writeErrorsToSystemErr(boolean value)
Write I/O Errors to the System Out Device (System.err.println) |
void |
writeErrorsToSystemOut(boolean value)
Write I/O Errors to the System Out Device (System.out.println) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IIO(java.lang.String path,
java.lang.String fileType,
java.lang.String openMode)
public IIO(java.lang.String path,
java.lang.String fileType)
| Method Detail |
|---|
public int open(java.lang.String openMode)
public int append(Record rec)
rec - as Record Object
public int close()
public void dumpRecords(int count)
public void dumpKeys(int count)
public java.util.ArrayList getKeys()
public int getRecordCount()
public boolean existsRecord(java.lang.String key)
public int eraseFile()
public int deleteRecord(java.lang.String key)
public int deleteRecord(int key)
public Record read(java.lang.String key)
public Record read(int key)
public Record readFirst()
public Record readNext()
public int setLowerLimit(java.lang.String key)
key - as String
public int setFileName(java.lang.String filename)
filename - as Stringpublic int write(Record rec)
public java.lang.String getMessage(int status)
status - as int
public int getIOStatus()
public void writeErrorsToSystemOut(boolean value)
value - as true or falsepublic void writeErrorsToSystemErr(boolean value)
value - as true or falsepublic void writeErrorsToJOptionPane(boolean value)
value - as true or falsepublic void writeErrorsToLogFile(boolean value)
value - as true or falsepublic void clearErrorLogFile()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||