|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectloci.formats.FormatHandler
public abstract class FormatHandler
Abstract superclass of all biological file format readers and writers.
Field Summary | |
---|---|
protected String |
currentId
Name of current file. |
static boolean |
debug
Debugging flag. |
static int |
debugLevel
Debugging level. 1=basic, 2=extended, 3=everything, 4=insane. |
protected String |
format
Name of this file format. |
protected Vector |
statusListeners
List of status listeners. |
protected String[] |
suffixes
Valid suffixes for this file format. |
Constructor Summary | |
---|---|
FormatHandler(String format,
String suffix)
Constructs a format handler with the given name and default suffix. |
|
FormatHandler(String format,
String[] suffixes)
Constructs a format handler with the given name and default suffixes. |
Method Summary | |
---|---|
void |
addStatusListener(StatusListener l)
Adds a listener for status update events. |
protected void |
debug(String s)
Issues a debugging statement. |
String |
getFormat()
Gets the name of this file format. |
StatusListener[] |
getStatusListeners()
Gets a list of all registered status update listeners. |
String[] |
getSuffixes()
Gets the default file suffixes for this file format. |
boolean |
isThisType(String name)
Checks if a file matches the type of this format handler. |
boolean |
isThisType(String name,
boolean open)
Checks if a file matches the type of this format handler. |
void |
removeStatusListener(StatusListener l)
Removes a listener for status update events. |
static void |
setDebug(boolean debug)
Toggles debug mode (more verbose output and error messages). |
static void |
setDebugLevel(int debugLevel)
Toggles debug mode verbosity (which kinds of output are produced). |
void |
setId(String id)
Sets the current file name. |
protected void |
status(int progress,
int maximum,
String message)
Fires a status update event. |
protected void |
status(StatusEvent e)
Fires a status update event. |
protected void |
status(String message)
Fires a status update event. |
protected void |
trace(String s)
Issues a stack trace. |
protected void |
trace(Throwable t)
Issues a stack trace. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface loci.formats.IFormatHandler |
---|
close, setId |
Field Detail |
---|
public static boolean debug
public static int debugLevel
protected String format
protected String[] suffixes
protected Vector statusListeners
protected String currentId
Constructor Detail |
---|
public FormatHandler(String format, String suffix)
public FormatHandler(String format, String[] suffixes)
Method Detail |
---|
protected void status(String message)
protected void status(int progress, int maximum, String message)
protected void status(StatusEvent e)
protected void debug(String s)
protected void trace(String s)
protected void trace(Throwable t)
public boolean isThisType(String name)
isThisType
in interface IFormatHandler
public boolean isThisType(String name, boolean open)
isThisType
in interface IFormatHandler
open
- If true, and the file extension is insufficient to determine
the file type, the (existing) file is opened for further analysis.
Does nothing in the default implementation.public String getFormat()
IFormatHandler
getFormat
in interface IFormatHandler
public String[] getSuffixes()
IFormatHandler
getSuffixes
in interface IFormatHandler
public void setId(String id) throws FormatException, IOException
IFormatHandler
setId
in interface IFormatHandler
FormatException
IOException
public void addStatusListener(StatusListener l)
StatusReporter
addStatusListener
in interface StatusReporter
public void removeStatusListener(StatusListener l)
StatusReporter
removeStatusListener
in interface StatusReporter
public StatusListener[] getStatusListeners()
StatusReporter
getStatusListeners
in interface StatusReporter
public static void setDebug(boolean debug)
public static void setDebugLevel(int debugLevel)
debugLevel
- 1=basic, 2=extended, 3=everything.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |