Class AbstractReportReader<T extends Report>

    • Field Detail

      • m_Stopped

        protected boolean m_Stopped
        whether the reader got stopped.
    • Constructor Detail

      • AbstractReportReader

        public AbstractReportReader()
    • Method Detail

      • getFormatDescription

        public abstract String getFormatDescription()
        Returns a string describing the format (used in the file chooser).
        Specified by:
        getFormatDescription in interface FileFormatHandler
        a description suitable for displaying in the file chooser
      • getFormatExtensions

        public abstract String[] getFormatExtensions()
        Returns the extension(s) of the format.
        Specified by:
        getFormatExtensions in interface FileFormatHandler
        the extension(s) (without the dot!)
      • reset

        protected void reset()
        Resets the reader. Derived classes must call this method in set-methods of parameters to assure the invalidation of previously generated data.
        reset in class AbstractOptionHandler
      • inputTipText

        public String inputTipText()
        Returns the tip text for this property.
        Specified by:
        inputTipText in interface ReportReader<T extends Report>
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • read

        public List<T> read()
        Performs checks and (always) reads the data.
        Specified by:
        read in interface ReportReader<T extends Report>
        the report loaded from the file
      • checkData

        protected void checkData()
        The default implementation only checks whether the provided file object is an actual file and whether it exists (if m_InputIsFile = true), or if the file object is a directory and whether it exists.
      • readData

        protected abstract List<T> readData()
        Performs the actual reading.
        the reports that were read
      • postRead

        protected void postRead​(List<T> data)
        Post-processing after reading the data.
        data - the reports to post-process
      • stopExecution

        public void stopExecution()
        Stops the execution.
        Specified by:
        stopExecution in interface Stoppable
      • isStopped

        public boolean isStopped()
        Whether the execution has been stopped.
        Specified by:
        isStopped in interface StoppableWithFeedback
        true if stopped
      • determineParentID

        protected abstract int determineParentID​(Report report)
        Tries to determine the parent ID for the current report.
        report - the report to determine the ID for
        the parent database ID, -1 if it cannot be determined
      • cleanUp

        public void cleanUp()
        Can be used to free up memory. Default implementation just calls reset(). Derived classes can add additional code.
        Specified by:
        cleanUp in interface CleanUpHandler
        See Also:
      • newInstance

        public abstract T newInstance()
        Returns a new instance of the report class in use.
        the new (empty) report
      • compareTo

        public int compareTo​(Object o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

        Only compares the commandlines of the two objects.
        Specified by:
        compareTo in interface Comparable<T extends Report>
        o - the object to be compared.
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        ClassCastException - if the specified object's type prevents it from being compared to this object.
      • equals

        public boolean equals​(Object o)
        Returns whether the two objects are the same.

        Only compares the commandlines of the two objects.
        equals in class Object
        o - the object to be compared
        true if the object is the same as this one
      • shallowCopy

        public AbstractReportReader shallowCopy​(boolean expand)
        Returns a shallow copy of itself, i.e., based on the commandline options.
        Specified by:
        shallowCopy in interface ShallowCopySupporter<T extends Report>
        expand - whether to expand variables to their current values
        the shallow copy
      • getReaders

        public static String[] getReaders()
        Returns a list with classnames of readers.
        the reader classnames
      • forName

        public static AbstractReportReader forName​(String classname,
                                                   String[] options)
        Instantiates the report reader with the given options.
        classname - the classname of the reader to instantiate
        options - the options for the reader
        the instantiated reader or null if an error occurred
      • forCommandLine

        public static AbstractReportReader forCommandLine​(String cmdline)
        Instantiates the report reader from the given commandline (i.e., classname and optional options).
        cmdline - the classname (and optional options) of the reader to instantiate
        the instantiated reader or null if an error occurred