org.geworkbench.components.parsers
Class FileFormat

java.lang.Object
  extended by org.geworkbench.components.parsers.FileFormat
Direct Known Subclasses:
DataSetFileFormat

public abstract class FileFormat
extends java.lang.Object

Version:
$Id: FileFormat.java,v 1.4 2009-10-07 15:38:48 my2248 Exp $ Base class for reading input data files complying to a desired format. Support for any given microarray data format (e.g., Affymetrix MAS 5, GenePix, etc), can be provide as follows:
Author:
my2248

Field Summary
protected  java.lang.String formatName
          The display name of the format.
 
Constructor Summary
FileFormat()
           
 
Method Summary
abstract  boolean checkFormat(java.io.File file)
          Checks if the contents of the designated file conform to the format.
abstract  java.lang.String[] getFileExtensions()
          Return the list of extensions (if any) for the files following this format.
 javax.swing.filechooser.FileFilter getFileFilter()
           
 java.lang.String getFormatName()
           
abstract  DSDataSet getMArraySet(java.io.File file)
          Generates and returns a MicrorarrauSet from the designated argument.
 void getMArraySet(java.io.File file, CSExprMicroarraySet maSet)
          Generates and returns a MicrorarraySet from the designated argument.
abstract  Resource getResource(java.io.File file)
          Return a Resource object for the designated file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

formatName

protected java.lang.String formatName
The display name of the format.

Constructor Detail

FileFormat

public FileFormat()
Method Detail

getFormatName

public java.lang.String getFormatName()
Returns:
The format name.

checkFormat

public abstract boolean checkFormat(java.io.File file)
                             throws java.io.InterruptedIOException
Checks if the contents of the designated file conform to the format.

Parameters:
file - File to check.
Returns:
True or false, depending on if the argument is well formed according to the format or not.
Throws:
java.io.InterruptedIOException

getResource

public abstract Resource getResource(java.io.File file)
Return a Resource object for the designated file.

Parameters:
file -
Returns:

getMArraySet

public abstract DSDataSet getMArraySet(java.io.File file)
                                throws InputFileFormatException,
                                       java.io.InterruptedIOException
Generates and returns a MicrorarrauSet from the designated argument. In file does not conform to the format, returns null.

Parameters:
file - The file containing the input data.
Returns:
The corresponding MicroarraySet object.
Throws:
InputFileFormatException
java.io.InterruptedIOException

getMArraySet

public void getMArraySet(java.io.File file,
                         CSExprMicroarraySet maSet)
                  throws InputFileFormatException,
                         java.io.InterruptedIOException
Generates and returns a MicrorarraySet from the designated argument. In file does not conform to the format, returns null.

Parameters:
file - The file containing the input data.
maSet - The set to load the data in
Throws:
InputFileFormatException
java.io.InterruptedIOException

getFileExtensions

public abstract java.lang.String[] getFileExtensions()
Return the list of extensions (if any) for the files following this format.

Returns:

getFileFilter

public javax.swing.filechooser.FileFilter getFileFilter()
Returns:
An (optional) FileFilter to be used in gating the files offered to the user for selection. Useful, e.g., when the files of the format at hand have predefined extensions.