BioLegato 0.7.5 GDE plugin

org.biolegato.gdesupport.files
Class GDEFlatfile

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by org.biolegato.gdesupport.files.DataFormat
          extended by org.biolegato.gdesupport.files.GDEFlatfile

public class GDEFlatfile
extends DataFormat

This class acts as a parser/translator for GDE flat files.

Author:
Graham Alvare, Brian Fristensky

Field Summary
 
Fields inherited from class org.biolegato.gdesupport.files.DataFormat
FASTA, FORMAT_LIST, GDEFILE, GDEFLAT, GENBANK
 
Constructor Summary
GDEFlatfile()
          Creates a new instance of GDEFlatfile
 
Method Summary
 boolean accept(java.io.File file)
          Determines whether a specified file is of type GDE flat file (based on extension).
 java.lang.String getDescription()
          Returns a description of the file format that can be displayed to the user.
 boolean isFormat(java.io.Reader test)
          Used to auto-detect Bio Legato formats
 void translateFrom(Dataset datamodel, java.io.BufferedReader data)
          Translates data in the GDE flat file format to sequence objecte
 void translateTo(java.lang.Appendable result, Seq seq, int offset, int length)
          Translates a sequence into the GDE flat file format.
 
Methods inherited from class org.biolegato.gdesupport.files.DataFormat
autodetect, getFormat, getName, readFile, readFile, writeAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GDEFlatfile

public GDEFlatfile()
Creates a new instance of GDEFlatfile

Method Detail

translateTo

public void translateTo(java.lang.Appendable result,
                        Seq seq,
                        int offset,
                        int length)
                 throws java.io.IOException
Translates a sequence into the GDE flat file format.

Specified by:
translateTo in class DataFormat
Parameters:
seq - the sequence to translate
Throws:
java.io.IOException

translateFrom

public void translateFrom(Dataset datamodel,
                          java.io.BufferedReader data)
                   throws java.io.IOException
Translates data in the GDE flat file format to sequence objecte

Specified by:
translateFrom in class DataFormat
Parameters:
data - the buffered reader to parse
Throws:
java.io.IOException - any exeptions that occur while reading the stream are passed

accept

public boolean accept(java.io.File file)
Determines whether a specified file is of type GDE flat file (based on extension). Currently the only extension supported is ".flat".

Specified by:
accept in class javax.swing.filechooser.FileFilter
Parameters:
file - the file to test
Returns:
true if the file is of type GDE flat file (otherwise false)
See Also:
FileFilter.accept(java.io.File)

getDescription

public java.lang.String getDescription()
Returns a description of the file format that can be displayed to the user.

Specified by:
getDescription in class javax.swing.filechooser.FileFilter
Returns:
the string description of the file format
See Also:
FileFilter.getDescription()

isFormat

public boolean isFormat(java.io.Reader test)
Used to auto-detect Bio Legato formats

Specified by:
isFormat in class DataFormat
Parameters:
test - the reader to parse data from
Returns:
whether the format is correct

BioLegato 0.7.5 GDE plugin

Copyright © 2008-2011 University of Manitoba.