1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.collections15.functors.closure;
17
18 import net.sf.collections15.Closure;
19
20 import java.io.Serializable;
21
22
23 /***
24 * <code>Closure</code> implementation that does nothing.
25 *
26 * @author Stephen Colebourne
27 * @author Chris Lambrou (port to Java 5.0)
28 * @since Collections15 1.0
29 */
30 public class NOPClosure <E> implements Closure<E>, Serializable
31 {
32
33 static final long serialVersionUID = 851018997309347977L;
34
35 /***
36 * Returns a <code>Closure</code> which does nothing.
37 *
38 * @return A <code>Closure</code> which does nothing.
39 *
40 * @since Collections15 1.0
41 */
42 public static <T> Closure<T> getInstance()
43 {
44 return new NOPClosure<T>();
45 }
46
47 /***
48 * Creates a <code>Closure</code> which does nothing.
49 */
50 protected NOPClosure()
51 {
52 }
53
54 /***
55 * Does nothing.
56 *
57 * @param input The input object.
58 */
59 public void execute(E input)
60 {
61 }
62
63 }