Package com.sun.identity.log.util
Class LogRecordSorter
- java.lang.Object
-
- com.sun.identity.log.util.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 Summary
Fields Modifier and Type Field Description String[][]sortedArrayContains the 2D array in sorted orderArrayListunSortedRecordsThis is the list of records with header to be sorted
-
Constructor Summary
Constructors Constructor Description LogRecordSorter(String fieldName, ArrayList allRecs)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String[][]getSortedRecords()This method should be called after creating the object, to get the sorted 2D array.
-
-
-
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.
-
-
Method Detail
-
getSortedRecords
public String[][] getSortedRecords() throws IllegalArgumentException, RuntimeException
This method should be called after creating the object, to get the sorted 2D array.- Returns:
- returns the sorted records in 2D array.
- Throws:
IllegalArgumentException- if sort by field name is absent.RuntimeException- if it fails to sort records.
-
-