Package dataLoad
Class AbstractRecordLoader<E>
- java.lang.Object
-
- dataLoad.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
-
-
Constructor Summary
Constructors Constructor Description AbstractRecordLoader()
-
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
-
-
-
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 filedelimeter
- : file delimeterhasHeaderLine
- : specifies whether the file has a headernumFields
- : number of columns in the input fileobjCollection
- : empty list which will be loaded with the data from the input file- Returns:
- the number of rows that are Processed
-
-