View Javadoc
1   package net.logAnalyzer.gui.messages.filters;
2   
3   import net.logAnalyzer.handlers.LAMessage;
4   
5   /***
6    * This class implements a logical NOT filter.
7    * 
8    * @author Karim REFEYTON
9    * @version 0.1
10   */
11  public final class NotFilter extends UnaryFilter {
12  
13      /***
14       * Constructs a new filter.
15       * 
16       * @param filter
17       *            Filter to negate.
18       */
19      public NotFilter(LAMessagesFilter filter) {
20          super(filter);
21      }
22  
23      /***
24       * Returns <tt>true</tt> if the messageLabel is accepted by the filter. To
25       * be accepted, the messageLabel must not be accepted by the filter.
26       * 
27       * @param message
28       *            Message to check
29       * @return <tt>true</tt> if the messageLabel is accepted.
30       * @see net.logAnalyzer.gui.messages.filters.LAMessagesFilter#accept(net.logAnalyzer.handlers.LAMessage)
31       */
32      public boolean accept(LAMessage message) {
33          return !getFilter().accept(message);
34      }
35  
36      /***
37       * Returns a string representation of the filter. Used to display filter.
38       * 
39       * @return String representation of the filter.
40       */
41      public String toString() {
42          return "NOT";
43      }
44  }