Class IDAREDatasetReader

  • All Implemented Interfaces:
    idare.imagenode.internal.IDAREService

    public abstract class IDAREDatasetReader
    extends Object
    implements idare.imagenode.internal.IDAREService
    A IDAREDatasetReader must be able to read a Datafile into a
    Author:
    Thomas Pfau
    • Field Detail

      • IS_READY

        public static String IS_READY
      • IS_SET_UP

        public static String IS_SET_UP
    • Constructor Detail

      • IDAREDatasetReader

        public IDAREDatasetReader()
    • Method Detail

      • readData

        public abstract IDAREWorkbook readData​(File inputfile)
                                        throws WrongFormat,
                                               IOException
        Read an input File and create an IDARE compatible Workbook structure.
        Parameters:
        inputfile - the file to read.
        Returns:
        A workbook containing the data from the file
        Throws:
        WrongFormat - If the format cannot be read by this Reader, or if the file provided is not the file the reader was set up for.
        IOException - If there are problems with the IO of the file
      • fileTypeAccepted

        public abstract boolean fileTypeAccepted​(File inputfile)
        Test, whether the file can potentially be read by this reader. THis only checks the File extension, and not the content.
        Parameters:
        inputfile - The file to check
        Returns:
        whether this parser can be used to read the file.
      • getSetupTask

        public abstract IDAREReaderSetupTask getSetupTask​(File inputfile,
                                                          boolean twocolumn)
                                                   throws Exception
        The Reader should provide a Task that can be used to set up the reader for future use on the given inputFile. if null is returned, it is assumed, that no Task is needed
        Parameters:
        inputfile - the input file to generate the setup task. This file can be read to extract information for options.
        twocolumn - whether a IDAREWorkbook with label and id or a set with only an id is requested.
        Returns:
        a Task that can obtain input from the user via Tunables, or null if no setup information is necessary
        Throws:
        Exception - Multiple Exceptions from IO to other issues.
      • getStatusMessage

        public final String getStatusMessage()
        Informs about the status of the reader. If the reader is ready to provide a SetupTask, it should return IDAREDatasetReader.IS_READY. If the reader is set up (i.e. getSetupTask completed successfully) it should return IDAREDatasetReader.IS_SET_UP
        Returns:
        information, where the process of reading failed, or IS_READY
      • setStatusMessage

        public final void setStatusMessage​(String Message)
        This function allows setting the Status Message if an exception is thrown during reading.
        Parameters:
        Message - the Message that will be set (comonly the errormessage received during one of the calls.
      • reset

        public final void reset()
        Resets the reader. This sets the statusMessage and calls the resetReader() method implemented by the extending class.
      • resetReader

        public abstract void resetReader()
        Reset the reader, clearing any temporary fields. after this call the reader status should be "IS_READY" When extending the class, this Method should be overwritten but the reset method from the abstract class should also be called,