Class LogFile

  • All Implemented Interfaces:
    Serializable

    public class LogFile
    extends Object
    implements Serializable

    This class encapsulates the log file so that its details are not exposed. "getLongEntries" returns an unfiltered List of LogEntry objects from the requested record number. It will always search forward. getIndexSize() returns the number of records between each index. getLastIndexNumber returns the last index.

    See Also:
    Serialized Form
    • Constructor Detail

      • LogFile

        public LogFile​(String name)
        Constructor
    • Method Detail

      • getLogEntries

        public List getLogEntries​(long startingRecord)
        This method returns up to _indexSize records starting with the given record number.
        Parameters:
        startingRecord - The starting point to search for LogEntries
      • getLogEntries

        public List getLogEntries​(long startingRecord,
                                  long maxRecords)
        This method returns up to _indexSize records starting with the given record number. It will return up to "maxRecords" records.
        Parameters:
        startingRecord - The starting point to search for LogEntries
        maxRecords - The maximum number of records to return
      • getLogFileName

        public String getLogFileName()
      • getLastIndexNumber

        public long getLastIndexNumber()
        The log records are indexed, this method returns the last index. It will ensure that the indexes are up-to-date.
      • getIndexSize

        public long getIndexSize()