Package dataLoad

Class AbstractRecordLoader<E>

  • Direct Known Subclasses:
    DishLoader, EmployeeLoader, OrderLoader

    public abstract class AbstractRecordLoader<E>
    extends java.lang.Object

    AbstractRecordLoader

    Class responsible for reading the data from an input file.
    Since:
    2017-07-22
    Version:
    1.0
    • Method Summary

      Modifier and Type Method Description
      abstract int constructObjectFromRow​(java.lang.String[] tokens, java.util.ArrayList<E> objCollection)  
      int load​(java.lang.String fileName, java.lang.String delimeter, boolean hasHeaderLine, int numFields, java.util.ArrayList<E> objCollection)
      Reads the data from the given file and stores them in an ArrayList
      • Methods inherited from class java.lang.Object

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

      • AbstractRecordLoader

        public AbstractRecordLoader()
    • Method Detail

      • constructObjectFromRow

        public abstract int constructObjectFromRow​(java.lang.String[] tokens,
                                                   java.util.ArrayList<E> objCollection)
      • load

        public int load​(java.lang.String fileName,
                        java.lang.String delimeter,
                        boolean hasHeaderLine,
                        int numFields,
                        java.util.ArrayList<E> objCollection)
        Reads the data from the given file and stores them in an ArrayList
        Parameters:
        fileName - : name of the input file
        delimeter - : file delimeter
        hasHeaderLine - : specifies whether the file has a header
        numFields - : number of columns in the input file
        objCollection - : empty list which will be loaded with the data from the input file
        Returns:
        the number of rows that are Processed