View Javadoc

1   /*
2    * @(#) Filterinterface.java Oct 26, 2004 Copyright (c) 2002-2005 Delft
3    * University of Technology Jaffalaan 5, 2628 BX Delft, the Netherlands. All
4    * rights reserved. This software is proprietary information of Delft University
5    * of Technology The code is published under the Lesser General Public License
6    */
7   package nl.tudelft.simulation.language.filters;
8   
9   import java.io.Serializable;
10  
11  /***
12   * The FilterInterface is a general interface for all filters in DSOL. Filters
13   * can be based on xY combinations, class information ,etc. etc. The API of
14   * implementing filters will explain what it expects as input.
15   * <p>
16   * (c) copyright 2002-2005 <a href="http://www.simulation.tudelft.nl">Delft
17   * University of Technology </a>, the Netherlands.
18   * <p>
19   * See for project information <a
20   * href="http://www.simulation.tudelft.nl/dsol/language">www.simulation.tudelft.nl/language
21   * </a> <br>
22   * License of use: <a href="http://www.gnu.org/copyleft/lesser.html">Lesser
23   * General Public License (LGPL) </a>, no warranty
24   * 
25   * @author <a
26   *         href="http://web.eur.nl/fbk/dep/dep1/Introduction/Staff/People/Lang">Niels
27   *         Lang </a><a href="http://www.peter-jacobs.com/index.htm">Peter
28   *         Jacobs </a>
29   * @version $Revision: 1.10 $ $Date: 2005/07/04 12:21:25 $
30   * @since 1.5
31   */
32  public interface Filterinterface extends Serializable
33  {
34      /***
35       * a filter defines whether to accept a value in a chart
36       * 
37       * @param entry the entry to filter
38       * @return whether to accept this entry
39       */
40      boolean accept(Object entry);
41  
42      /***
43       * inverts the filter
44       * 
45       * @param inverted whether to invert the filter
46       */
47      void setInverted(boolean inverted);
48  
49      /***
50       * is the filter inverted?
51       * 
52       * @return whether the filter is inverted.
53       */
54      boolean isInverted();
55  
56      /***
57       * returns a string representation of the criterium
58       * 
59       * @return the string representing the criterium
60       */
61      String getCriterium();
62  
63      /***
64       * adds filter to this filter and returns the composed filter
65       * 
66       * @param filter the filter to add
67       * @return the composed filter
68       */
69      Filterinterface and(Filterinterface filter);
70  
71      /***
72       * creates a new composite filter which is one or two
73       * 
74       * @param filter the filter to add
75       * @return the composed filter
76       */
77      Filterinterface or(Filterinterface filter);
78  }