Package org.apache.log4j.chainsaw

## Interface EventContainer

- All Superinterfaces:
    `LoggerNameModel`, `SortTableModel`, `TableModel`

      public interface EventContainer
      extends SortTableModel, LoggerNameModel

  To allow pluggable TableModel implementations for Chainsaw, this interface has been factored out.

  This interface is still subject to change.

  Author:
    Paul Smith <psmith@apache.org>, Scott Deboy <sdeboy@apache.org>, Stephen Pain

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addEventCountListener​(EventCountListener listener)` | Adds an EventCountListener, to be notified when the # of events changes
    `void` | `addNewKeyListener​(NewKeyListener l)` | Adds a NewKeyListener to be notified when unique Key (Property keys) arrive into this EventContainer
    `void` | `addPropertyChangeListener​(PropertyChangeListener l)` |
    `void` | `addPropertyChangeListener​(String propertyName, PropertyChangeListener l)` |
    `void` | `clearModel()` | Clears the model completely
    `int` | `findColoredRow​(int currentRow, boolean forward)` | Determine next row with a non-default color
    `void` | `fireRowUpdated​(int row, boolean checkForNewColumns)` | A row was updated
    `void` | `fireTableEvent​(int begin, int end, int count)` | Fire appropriate table update events for the range.
    `List` | `getAllEvents()` | Returns a copied list of all the event in the model.
    `List` | `getFilteredEvents()` | Returns a copied list containing the events in the model with filter applied
    `List<LoggingEventWrapper>` | `getMatchingEvents​(org.apache.log4j.rule.Rule rule)` |
    `int` | `getMaxSize()` | If this container is in Cyclic mode, returns the Size of the cyclic buffer, otherwise this method throws an IllegalStateException, when in unlimited mode, this method has no meaning.
    `LoggingEventWrapper` | `getRow​(int row)` | Returns the vector representing the row.
    `int` | `getRowIndex​(LoggingEventWrapper loggingEventWrapper)` | Returns the index of the LoggingEventWrapper
    `int` | `getSearchMatchCount()` | Return the visible search match count
    `boolean` | `isAddRow​(LoggingEventWrapper e)` | Adds a row to the model.
    `int` | `locate​(org.apache.log4j.rule.Rule rule, int startRow, boolean searchForward)` | Locates a row number, starting from startRow, matching the rule provided
    `void` | `notifyCountListeners()` | Allow a forced notification of the EventCountListeners
    `void` | `reFilter()` | Force a re-processing of the table layout
    `void` | `removeNewKeyListener​(NewKeyListener l)` | Removes a listener from being notified of NewKey events.
    `void` | `removePropertyFromEvents​(String propName)` | Remove property from all events in container
    `void` | `setCyclic​(boolean cyclic)` | Configures this model to use Cyclic or non-cyclic models.
    `void` | `setRuleMediator​(RuleMediator ruleMediator)` | Sets the RuleMediator in operation
    `int` | `size()` | Returns the total number of events currently in the model (all, not just filtered)
    `int` | `updateEventsWithFindRule​(org.apache.log4j.rule.Rule findRule)` | Evaluate all events against the find rule

    - ### Methods inherited from interface org.apache.log4j.chainsaw.LoggerNameModel

      `addLoggerName, addLoggerNameListener, getLoggerNames, removeLoggerNameListener, reset`

    - ### Methods inherited from interface org.apache.log4j.chainsaw.SortTableModel

      `isSortable, isSortEnabled, sort, sortColumn`

    - ### Methods inherited from interface javax.swing.table.TableModel

      `addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt`

- - ### Method Detail

    - #### addEventCountListener

          void addEventCountListener​(EventCountListener listener)

      Adds an EventCountListener, to be notified when the # of events changes
      Parameters:
        `listener` -

    - #### addPropertyChangeListener

          void addPropertyChangeListener​(PropertyChangeListener l)

    - #### addPropertyChangeListener

          void addPropertyChangeListener​(String propertyName,
                                         PropertyChangeListener l)

    - #### addNewKeyListener

          void addNewKeyListener​(NewKeyListener l)

      Adds a NewKeyListener to be notified when unique Key (Property keys) arrive into this EventContainer
      Parameters:
        `l` -

    - #### removeNewKeyListener

          void removeNewKeyListener​(NewKeyListener l)

      Removes a listener from being notified of NewKey events.
      Parameters:
        `l` -

    - #### clearModel

          void clearModel()

      Clears the model completely

    - #### getMatchingEvents

          List<LoggingEventWrapper> getMatchingEvents​(org.apache.log4j.rule.Rule rule)

    - #### setCyclic

          void setCyclic​(boolean cyclic)

      Configures this model to use Cyclic or non-cyclic models. This method should fire a property Change event if it involves an actual change in the underlying model.

      This method does nothing if there is no change in proprty.

      Parameters:
        `cyclic` -

    - #### getMaxSize

          int getMaxSize()

      If this container is in Cyclic mode, returns the Size of the cyclic buffer, otherwise this method throws an IllegalStateException, when in unlimited mode, this method has no meaning.
      Returns:
        int size of the cyclic buffer
      Throws:
        `IllegalStateException` - if this containers isCyclic() method returns false.

    - #### locate

          int locate​(org.apache.log4j.rule.Rule rule,
                     int startRow,
                     boolean searchForward)

      Locates a row number, starting from startRow, matching the rule provided
      Parameters:
        `rule` -
        `startRow` -
        `searchForward` -

    - #### getAllEvents

          List getAllEvents()

      Returns a copied list of all the event in the model.

    - #### getFilteredEvents

          List getFilteredEvents()

      Returns a copied list containing the events in the model with filter applied

    - #### size

          int size()

      Returns the total number of events currently in the model (all, not just filtered)
      Returns:
        size

    - #### getRow

          LoggingEventWrapper getRow​(int row)

      Returns the vector representing the row.

    - #### isAddRow

          boolean isAddRow​(LoggingEventWrapper e)

      Adds a row to the model.
      Parameters:
        `e` - event
      Returns:
        flag representing whether or not the row is being displayed (not filtered)

    - #### fireTableEvent

          void fireTableEvent​(int begin,
                              int end,
                              int count)

      Fire appropriate table update events for the range.

    - #### fireRowUpdated

          void fireRowUpdated​(int row,
                              boolean checkForNewColumns)

      A row was updated
      Parameters:
        `row` -
        `checkForNewColumns` -

    - #### notifyCountListeners

          void notifyCountListeners()

      Allow a forced notification of the EventCountListeners

    - #### reFilter

          void reFilter()

      Force a re-processing of the table layout

    - #### setRuleMediator

          void setRuleMediator​(RuleMediator ruleMediator)

      Sets the RuleMediator in operation
      Parameters:
        `ruleMediator` -

    - #### getRowIndex

          int getRowIndex​(LoggingEventWrapper loggingEventWrapper)

      Returns the index of the LoggingEventWrapper
      Parameters:
        `loggingEventWrapper` -

    - #### removePropertyFromEvents

          void removePropertyFromEvents​(String propName)

      Remove property from all events in container
      Parameters:
        `propName` - the property name to remove

    - #### updateEventsWithFindRule

          int updateEventsWithFindRule​(org.apache.log4j.rule.Rule findRule)

      Evaluate all events against the find rule
      Parameters:
        `findRule` -

    - #### findColoredRow

          int findColoredRow​(int currentRow,
                             boolean forward)

      Determine next row with a non-default color
      Parameters:
        `currentRow` -
        `forward` -
      Returns:

    - #### getSearchMatchCount

          int getSearchMatchCount()

      Return the visible search match count
      Returns: