1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.collections15.functors.predicate;
17
18 import net.sf.collections15.Predicate;
19
20 import java.io.Serializable;
21
22 /***
23 * <code>Predicate</code> implementation that always evaluates to
24 * <code>false</code>.
25 *
26 * @author Stephen Colebourne
27 * @author Chris Lambrou (port to Java 5.0)
28 * @since Collections15 1.0
29 */
30 public final class FalsePredicate <E> implements Predicate<E>, Serializable
31 {
32
33 static final long serialVersionUID = 8274221249111691049L;
34
35 /***
36 * ReturnsFactory returning the singleton instance.
37 *
38 * @return the singleton instance
39 *
40 * @since Commons Collections 3.1
41 */
42 public static <T> Predicate<T> getInstance()
43 {
44 return new FalsePredicate<T>();
45 }
46
47 /***
48 * Creates a new instance.
49 */
50 protected FalsePredicate()
51 {
52 }
53
54 /***
55 * Evaluates the <code>Predicate</code>, always returning
56 * <code>false</code>.
57 *
58 * @param object The input object.
59 *
60 * @return Always returns <code>false</code>.
61 */
62 public boolean evaluate(E object)
63 {
64 return false;
65 }
66
67 }