Class LogMOTableSizeLimit<R extends MOTableRow>

  • All Implemented Interfaces:
    java.util.EventListener, MOTableRowListener<R>

    public class LogMOTableSizeLimit<R extends MOTableRow>
    extends MOTableSizeLimit<R>
    The LogMOTableSizeLimit implements a MOTableSizeLimit to limit the number of entries in a table by removing the eldest rows existing in the table when the limit is exceeded.
    Since:
    1.1.5
    Version:
    1.1.5
    Author:
    Frank Fock
    • Constructor Detail

      • LogMOTableSizeLimit

        public LogMOTableSizeLimit​(int maxNumRows)
      • LogMOTableSizeLimit

        public LogMOTableSizeLimit​(java.util.Properties limits)
    • Method Detail

      • removeEldest

        protected boolean removeEldest​(MOTableRowEvent<R> triggeringEvent,
                                       int numRows)
        Removes the given number of rows starting at the lowest index value.
        Overrides:
        removeEldest in class MOTableSizeLimit<R extends MOTableRow>
        Parameters:
        triggeringEvent - the MOTableRowEvent object that describes the table with exceeding row limit.
        numRows - the number of rows to remove (if possible).
        Returns:
        true if one or more rows could be removed and false if the causing event should be denied/rejected. The default implementation returns false always.