|
BioLegato 0.6.2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.filechooser.FileFilter
org.biolegato.core.plugintypes.DataFormat
public abstract class DataFormat
| Constructor Summary | |
|---|---|
DataFormat()
Creates a new instance of DataFormat |
|
| Method Summary | |
|---|---|
static void |
addFormats(javax.swing.JFileChooser filechooser,
java.lang.String defaultFormat)
This function loads all of the available file formats into a JFileChooser. |
static Sequence[] |
auto(java.io.BufferedReader data)
Used to auto-detect and parse data into BioLegato sequence objects. |
static Sequence[] |
auto(java.io.File file)
Used to auto-detect and parse files into BioLegato sequence objects. |
static Sequence[] |
auto(java.io.InputStream stream)
Used to auto-detect and parse an input stream's data into BioLegato sequence objects. |
static DataFormat |
getFormat(java.lang.String hashname)
Finds the filetype that corresponds to the given hashname (null if not successful). |
java.lang.String |
getName()
Obtains the name of the file format for File Chooser purposes |
abstract boolean |
isFormat(java.io.Reader test)
Used to auto-detect Bio Legato formats |
Sequence[] |
readFile(java.io.File file)
Reads a file's contained sequences using the file filter's translation. |
abstract Sequence[] |
translateFrom(java.io.BufferedReader data)
Translates a string from the given file format into the BioLegato internal format. |
abstract java.lang.String |
translateTo(Sequence data)
Translates a string from the BioLegato internal format to the given file format. |
void |
writeFile(java.io.File file,
Sequence[] data)
Writes a list of sequences to a file. |
| Methods inherited from class javax.swing.filechooser.FileFilter |
|---|
accept, getDescription |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DataFormat()
| Method Detail |
|---|
public static void addFormats(javax.swing.JFileChooser filechooser,
java.lang.String defaultFormat)
filechooser - the JFileChooser to load the formats into.defaultFormat - the default file format for the file chooser.
public Sequence[] readFile(java.io.File file)
throws java.io.IOException
file - the file to writer to.
java.io.IOException - passes any exceptions from reading the file
public void writeFile(java.io.File file,
Sequence[] data)
throws java.io.IOException
file - the file to writer to.data - the contents to writer.
java.io.IOException - throws any exceptions that occur while writing to the filepublic java.lang.String getName()
public abstract java.lang.String translateTo(Sequence data)
data - the string to convert
public abstract Sequence[] translateFrom(java.io.BufferedReader data)
throws java.io.IOException
data - the string to convert.
java.io.IOException - any exeptions that occur while reading the stream are passed.public abstract boolean isFormat(java.io.Reader test)
test - the string to test
public static DataFormat getFormat(java.lang.String hashname)
hashname - the hashname to search for.
public static Sequence[] auto(java.io.File file)
file - the file to read.
public static Sequence[] auto(java.io.InputStream stream)
stream - the stream to read.
public static Sequence[] auto(java.io.BufferedReader data)
data - the string to convert
|
BioLegato 0.6.2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||