AFLPcore
Class ImportFilter
java.lang.Object
|
+--AFLPcore.Operation
|
+--AFLPcore.ImportFilter
- Direct Known Subclasses:
- ABI3x00Filter, ABILaneFilter, CEQLaneFilter, SCFFilter
- public abstract class ImportFilter
- extends Operation
This is an abstract class that should be extended to create
filters that read data from files. The data files should be of two
basic types, gel or lane. A lane file would contain only data for a
single lane. A gel file would contain the entire gel
In that case, the lanes would have to be tracked and
extracted, and then reassembled into a Gel. The filter should size
the data using a size standard if neccessary. Support for this may
be added elsewhere in the program, in which case, the filter could
simply call the approriate methods. Obviously a filter cannot
implement both readLane and readGel, so for the one that is not
supported, null
should be returned. The class
ImportMgr
can be used to track the different
filters. By adding the filters to it, one should be able to have a
program that read several different file types.
- See Also:
Operation
,
Lane
,
Gel
,
SizeFunction
,
ImportMgr
Field Summary |
protected int |
filetype
|
int |
GEL
constant to determine type of file filter is used on |
int |
LANE
constant to determine type of file filter is used on |
Method Summary |
abstract int |
getFileType()
Returns the type of input file supported by this filter, options are
ImportFilter.LANE or ImportFilter.GEL . |
abstract Gel |
readGel(java.io.File inputFile)
This is the method that is called to preform the actual reading of the
file. |
abstract Lane[] |
readLane(java.io.File inputFile)
This is the method that is called to preform the actual reading of the
file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LANE
public final int LANE
- constant to determine type of file filter is used on
GEL
public final int GEL
- constant to determine type of file filter is used on
filetype
protected int filetype
ImportFilter
public ImportFilter()
getFileType
public abstract int getFileType()
- Returns the type of input file supported by this filter, options are
ImportFilter.LANE
or ImportFilter.GEL
. This
information should be used by the caller to determine which method to
call readLane
or readGel
.
- Returns:
- either constant GEL or LANE, as described above.
readLane
public abstract Lane[] readLane(java.io.File inputFile)
throws java.io.IOException
- This is the method that is called to preform the actual reading of the
file. The data in the file represents data from a gel. If
the filter has any options to be selected, they should be set using the
get/setOptions
methods. This method should check to see
that the options are appropriate before continuing. Note that a filter
will only work on one type of data file, gel or lane. Therefore, one
of the methods readLane
or readGel
, will not
apply to the filter. For the one that does not apply, null
should be returned.
- Parameters:
inputFile
- The file that contains the lane data.- Returns:
- a Lane object with all of the appropriate information. It will
return
null
if the filter reads gels instead of lanes. - Throws:
java.io.IOException
- If an error is encountered in the file,
then this exception will be thrown
readGel
public abstract Gel readGel(java.io.File inputFile)
throws java.io.IOException
- This is the method that is called to preform the actual reading of the
file. The data in the file represents data from a gel. If
the filter has any options to be selected, tose should be set using the
get/setOptions
methods. This method should check to see
that the options are appropriate before continuing. Note that a filter
will only work on one type of data file, gel or lane. Therefore, one
of the methods readLane
or readGel
, will not
apply to the filter. For the one that does not apply, null
should be returned.
- Parameters:
inputFile
- The file that contains the gel data.- Returns:
- a Lane object with all of the appropriate information. It will
return
null
if the filter reads lanes instead of gels. - Throws:
java.io.IOException
- If an error is encountered in the file,
then this exception will be thrown