|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.unibi.techfak.jpredictor.operator.OptionFile
public class OptionFile
The class for summoning the methods needed to evaluate an option file. Note, that for motif definition names must be unique.
| Field Summary | |
|---|---|
private static ICommunicator |
comm
The ICommunicator for this class. |
(package private) static java.lang.String[] |
motifTypes
The types of motifs within the section [Motif] |
(package private) static int |
SECTION_COUNT
|
(package private) static int |
SECTION_MMLIST
|
(package private) static int |
SECTION_MOTIF
|
(package private) static int |
SECTION_MULTIMOTIF
|
(package private) static int |
SECTION_NONE
Enumeration of section names for sections-in-file recognition. |
(package private) static int |
SECTION_SEQUENCE
|
(package private) static java.lang.String[] |
sectionNames
The names of the sections in the file |
(package private) static java.lang.String[] |
sequenceParam
The parameter in the section [Sequence]. |
| Constructor Summary | |
|---|---|
OptionFile()
|
|
| Method Summary | |
|---|---|
static boolean |
recognize(java.lang.String filename,
ICommunicator comm,
MotifList mls,
MotifList mld)
This method opens and recognizes the content of the option file. |
private static void |
recognizeMotif(java.lang.String filecontent,
MotifList mls,
MotifList mld,
int line)
Trys to recognize a motif in the given string. |
private static void |
recognizeMultiMotif(java.lang.String filecontent,
MotifList mls,
MotifList mld,
int line)
Trys to recognize a MultiMotif. |
private static void |
recognizeMultiMotifList(java.lang.String filecontent,
MotifList mls,
MotifList mld,
int line)
Trys to recognize many MultiMotifs from a list definition. |
private static void |
recognizeSequence(java.lang.String filecontent,
ICommunicator comm,
int line)
Trys to recognize the [Sequence] section of an option file. |
static void |
writeMotifList(java.io.PrintStream f,
MotifList mlConst)
This method writes the given MotifList to the stream in a way that it can be recognized again. |
private static void |
writeMultiMotif(java.io.PrintStream f,
MultiMotif m,
boolean usable)
Output all stats for a MultiMotif. |
static void |
writeSettings(java.io.PrintStream f,
ICommunicator comm)
This method opens a file and writes the settings taken from the given communicator to a file. |
private static void |
writeSingleMotif(java.io.PrintStream f,
Motif m,
boolean usable)
Output all stats for a single motif. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static ICommunicator comm
ICommunicator for this class. It is set by the
methods recognize(String, ICommunicator, MotifList,
MotifList) and save(String, boolean, ICommunicator,
MotifList) and used by every other method present to
output things.
static java.lang.String[] sectionNames
static final int SECTION_NONE
static final int SECTION_MOTIF
static final int SECTION_MULTIMOTIF
static final int SECTION_MMLIST
static final int SECTION_SEQUENCE
static final int SECTION_COUNT
static java.lang.String[] sequenceParam
static java.lang.String[] motifTypes
| Constructor Detail |
|---|
public OptionFile()
| Method Detail |
|---|
public static boolean recognize(java.lang.String filename,
ICommunicator comm,
MotifList mls,
MotifList mld)
filename - The name of the option file.comm - The communicator which gets the settings.mls - The list of motifs, to which the single motifs found
are added.mld - The list of motifs, to which the multi motifs found
are added.
false, if the file was not found,
true otherwise.
private static void recognizeSequence(java.lang.String filecontent,
ICommunicator comm,
int line)
filecontent - The line by line file content, separated by "\n".comm - The ICommunicator to add the information found into.line - The line where the filecontent starts.
private static void recognizeMultiMotifList(java.lang.String filecontent,
MotifList mls,
MotifList mld,
int line)
filecontent - The line by line file content, separated by "\n".mls - The list of motifs whos names are compared.mld - The MotifList to add the motif to.line - The line where the filecontent starts.
private static void recognizeMultiMotif(java.lang.String filecontent,
MotifList mls,
MotifList mld,
int line)
filecontent is not searched for comments,
they must have been deleted befor. Note, that for correct recognition
of line numbers the remaining empty lines should be part of the
string.
filecontent - The line by line file content, separated by "\n".mls - List of motifs which are not used for searching.mld - List of motifs which are used for searching later on.line - The line where the filecontent starts.
private static void recognizeMotif(java.lang.String filecontent,
MotifList mls,
MotifList mld,
int line)
filecontent is not searched for comments,
they must have been deleted befor. Note, that for correct recognition
of line numbers the remaining empty lines should be part of the
string.
filecontent - The line by line file content, separated by "\n".mls - List of motifs which are not used for searching.mld - List of motifs which are used for searching later on.line - The line where the filecontent starts.
public static void writeMotifList(java.io.PrintStream f,
MotifList mlConst)
f or
mlConst is null.
f - The PrintStream to write to.mlConst - The list of motifs to get output.
private static void writeSingleMotif(java.io.PrintStream f,
Motif m,
boolean usable)
f - The stream to write the output to.m - The single motif to output.usable - Whether the motif should occur in the list or not.
private static void writeMultiMotif(java.io.PrintStream f,
MultiMotif m,
boolean usable)
MultiMotif. This method is not
designed for writing single motifs.
f - The stream to write the output to.m - The motif to output.usable - Whether the motif should occur in the list or not.
public static void writeSettings(java.io.PrintStream f,
ICommunicator comm)
f - The PrintStream to write to.comm - The communicator to which error messages are sent
and from which the settings are taken
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||