Class LogRecordSorter


  • public class LogRecordSorter
    extends Object
    LogRecordSorter class provides mechanism to sort log records on any field. It only sorts in ascending order on selected field. All the fields should be String only.
    • Field Detail

      • unSortedRecords

        public ArrayList unSortedRecords
        This is the list of records with header to be sorted
      • sortedArray

        public String[][] sortedArray
        Contains the 2D array in sorted order
    • Constructor Detail

      • LogRecordSorter

        public LogRecordSorter​(String fieldName,
                               ArrayList allRecs)
                        throws NoSuchFieldException
        Constructor.
        Parameters:
        fieldName - specifies a valid fieldname of the record.
        allRecs - contains the ArrayList of records.
        Throws:
        NoSuchFieldException - if sort by field name is absent.