Class CsvReader<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract T buildObject​(long entryNumber, java.util.List<java.lang.String> tokens)  
      void close()  
      protected double getDouble​(java.lang.String key, java.util.List<java.lang.String> values, double defaultValue)  
      protected long getLong​(java.lang.String key, java.util.List<java.lang.String> values, long defaultValue)  
      void load​(java.lang.String path)  
      T next()  
      protected T processLine​(java.lang.String line)  
      java.util.List<T> readAll​(java.lang.String inputPath)  
      • Methods inherited from class java.lang.Object

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

      • currentEntryNumber

        protected long currentEntryNumber
      • logger

        protected java.util.logging.Logger logger
      • path

        protected java.lang.String path
      • reader

        protected java.io.BufferedReader reader
    • Constructor Detail

      • CsvReader

        public CsvReader​(CsvSchema<T> schema)
    • Method Detail

      • load

        public void load​(java.lang.String path)
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • next

        public T next()
               throws java.io.IOException
        Throws:
        java.io.IOException
      • close

        public void close()
      • readAll

        public java.util.List<T> readAll​(java.lang.String inputPath)
      • processLine

        protected T processLine​(java.lang.String line)
      • buildObject

        protected abstract T buildObject​(long entryNumber,
                                         java.util.List<java.lang.String> tokens)
      • getDouble

        protected double getDouble​(java.lang.String key,
                                   java.util.List<java.lang.String> values,
                                   double defaultValue)
      • getLong

        protected long getLong​(java.lang.String key,
                               java.util.List<java.lang.String> values,
                               long defaultValue)