BioLegato 0.7.3 GDE plugin

org.biolegato.gdesupport.formats
Class GDEFile

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by org.biolegato.gdesupport.formats.DataFormat
          extended by org.biolegato.gdesupport.formats.GDEFile

public class GDEFile
extends DataFormat

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

Author:
Graham Alvare, Brian Fristensky

Constructor Summary
GDEFile()
          Creates a new instance of GDEFile
 
Method Summary
 boolean accept(java.io.File file)
          Determines whether or not a specified file is of type GDE file (based on extension) Currently the only extension supported is ".gde".
 java.lang.String getDescription()
          Returns a description of the file format that can be displayed to the user.
 java.lang.String getName()
          Obtains the internal name of the file format (this is great for hashtables storage and searching).
 boolean isFormat(java.io.Reader test)
          Used to auto-detect Bio Legato formats
static java.lang.String quote(java.lang.String input)
          Quotes a GDE string (replaces " with ' and {} with [])
 Cell[] translateFrom(java.io.BufferedReader data)
          Translates data in the GDE file format to sequence objecte
 java.lang.String translateTo(Cell seq)
          Translates a sequence into the GDE file format.
 
Methods inherited from class org.biolegato.gdesupport.formats.DataFormat
addFormats, auto, auto, auto, getFormat, readFile, writeFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GDEFile

public GDEFile()
Creates a new instance of GDEFile

Method Detail

translateTo

public java.lang.String translateTo(Cell seq)
Translates a sequence into the GDE file format.

Specified by:
translateTo in class DataFormat
Parameters:
seq - the sequence to translate
Returns:
the resulting string

translateFrom

public Cell[] translateFrom(java.io.BufferedReader data)
                     throws java.io.IOException
Translates data in the GDE file format to sequence objecte

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

accept

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

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

getName

public java.lang.String getName()
Obtains the internal name of the file format (this is great for hashtables storage and searching).

Overrides:
getName in class DataFormat
Returns:
the name of the file format

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()

quote

public static java.lang.String quote(java.lang.String input)
Quotes a GDE string (replaces " with ' and {} with [])

Parameters:
input - the string to quote
Returns:
the quoted string

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 or not the format is correct

BioLegato 0.7.3 GDE plugin

Copyright © 2008-2010 University of Manitoba.