Class AbstractLineParser

  • Direct Known Subclasses:
    PlainDataTableCsvParser, SimpleCsvParser

    public abstract class AbstractLineParser
    extends java.lang.Object
    Simple line parser that provides common functionality to parse given lines. For reading lines a file reader is responsible that passes the lines to the parse(java.lang.String) method.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.text.DateFormat getDateFormat()
      Get the date format.
      java.util.Properties getProperties()
      Get the parser properties.
      java.util.Set<java.lang.String> getValueNames()
      Get markers for relevant data (e.g. column headlines).
      abstract ValueSet parse​(java.lang.String line)
      Parse the resource line.
      protected long parseTime​(java.lang.String timeString)
      Parse 'String' time stamp to 'long'.
      void setProperties​(java.util.Properties properties)
      Set the parser properties.
      void setValueNames​(java.util.Set<java.lang.String> valueNames)
      Store markers for relevant data (e.g. column headlines or index numbers).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractLineParser

        public AbstractLineParser()
    • Method Detail

      • parse

        public abstract ValueSet parse​(java.lang.String line)
        Parse the resource line.
        Parameters:
        line - line to parse
        Returns:
        parsed ValueSet or null if there is currently nothing to return. This might be in case the line has no value of interest.
      • parseTime

        protected long parseTime​(java.lang.String timeString)
        Parse 'String' time stamp to 'long'.
        Parameters:
        timeString - human readable time stamp like 08.08.1977 12:34:56 or UNIX time stamp like 239891696
        Returns:
        time stamp of type 'long' or -1 if parsing failed
      • getDateFormat

        protected java.text.DateFormat getDateFormat()
        Get the date format.
        Returns:
        the date format
      • setValueNames

        public void setValueNames​(java.util.Set<java.lang.String> valueNames)
        Store markers for relevant data (e.g. column headlines or index numbers).
        Parameters:
        valueNames - value names
      • getValueNames

        public java.util.Set<java.lang.String> getValueNames()
        Get markers for relevant data (e.g. column headlines).
        Returns:
        value names of interest
      • setProperties

        public void setProperties​(java.util.Properties properties)
        Set the parser properties.
        Parameters:
        properties - the parser properties
      • getProperties

        public java.util.Properties getProperties()
        Get the parser properties.
        Returns:
        the parser properties