|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sofya.base.Handler sofya.mutator.MutationHandler
public class MutationHandler
Provides file handling routines for mutation related files.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_OP_DIR
Location of the default directory for mutation operators. |
static java.lang.String |
DEFAULT_OP_LIST_FILE
Location of the default mutation operator list file, which is the file that lists the operators included by default. |
Fields inherited from class sofya.base.Handler |
---|
HANDLER_EXTENSIONS, LINE_SEP |
Method Summary | |
---|---|
static void |
main(java.lang.String[] argv)
Test driver to exercise various handler routines. |
static MutatorConfiguration |
readConfiguration(java.lang.String configFile)
Reads a configuration file for the mutation table generator. |
static MutationIterator |
readMutationFile(java.lang.String fileName)
Returns an iterator that enables progressive reading of a mutation table from a file. |
static MutationTable |
readMutationTable(java.lang.String fileName)
Reads a mutation table from file into memory. |
static java.lang.String[] |
readOperatorList(java.lang.String fileName)
Reads the default operator list file. |
static FileWriterMutationTable |
writeMutationFile(java.lang.String fileName)
Returns a handle to a disk-backed mutation table that progressively writes mutations to a file as they are added. |
static void |
writeMutationTable(java.lang.String fileName,
MutationTable mt)
Writes a mutation table to file from memory. |
Methods inherited from class sofya.base.Handler |
---|
copyFile, createCacheFile, disableParseNumbers, ensureTagExists, formatSignature, isIntAvailable, isStringAvailable, newCache, openCacheFile, openInputFile, openInputFile, openOutputFile, openOutputFile, parseClass, prepareTokenizer, readInt, readIntIgnoreEOL, readJarClasses, readNextLine, readProgFile, readString, readStringIgnoreEOL, readToEOL, readToNextDataLine, toBinary, toHex |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_OP_DIR
public static final java.lang.String DEFAULT_OP_LIST_FILE
Method Detail |
---|
public static MutatorConfiguration readConfiguration(java.lang.String configFile) throws BadFileFormatException, java.io.IOException
configFile
- Name of the configuration file.
MutatorConfiguration
providing access to the
configuration data.
BadFileFormatException
- If the specified file is not a
configuration file or does not conform to the configuration file format.
java.io.IOException
- For any other I/O error that prevents successful
reading of the configuration file.public static java.lang.String[] readOperatorList(java.lang.String fileName) throws java.io.IOException
fileName
- Path to the default operator list file.
java.io.IOException
- For any I/O error that prevents successful reading
of the operator list file.public static MutationIterator readMutationFile(java.lang.String fileName) throws java.io.IOException
Reading a mutation table file using this approach is more efficient if mutations only need to be processed serially. This is especially true of large mutation tables.
fileName
- Name of the mutation file to be read.
MutationIterator
over the mutations in the mutation
table stored in the file.
java.io.IOException
- If the specified file does not exist or does not
contain a mutation table.public static FileWriterMutationTable writeMutationFile(java.lang.String fileName) throws java.io.IOException
Writing a mutation table file using this approach is more efficient if access to previously written mutations is not required during generation of the table. This is especially true of large mutation tables.
fileName
- Name of the mutation file to be written. Any existing
file of the same name will be overwritten.
FileWriterMutationTable
that provides transparent
serialization of mutations to file as they are added.
java.io.IOException
- If the requested mutation file cannot be opened
for writing.public static MutationTable readMutationTable(java.lang.String fileName) throws java.io.IOException
Large mutation tables may cause significant memory consumption.
fileName
- Name of the mutation file to be read.
MutationTable
providing access to the mutations read
from the mutation table.
java.io.IOException
- If the specified file does not exist or does not
contain a mutation table.public static void writeMutationTable(java.lang.String fileName, MutationTable mt) throws java.io.IOException
Retaining an entire mutation table in memory may be costly, therefore it is generally preferable to avoid using this method.
fileName
- Name of the mutation file to be written. Any
existing file of the same name will be overwritten.mt
- MutationTable to be written to the file.
java.io.IOException
- If the requested file cannot be opened for writing
or for any other I/O error that prevents successful serialization of
the mutation table to the file.public static void main(java.lang.String[] argv) throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |