1. /*
  2. * Copyright 2001-2004 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.apache.commons.collections.functors;
  17. import java.io.Serializable;
  18. import org.apache.commons.collections.Predicate;
  19. /**
  20. * Predicate implementation that always returns false.
  21. *
  22. * @since Commons Collections 3.0
  23. * @version $Revision: 1.6 $ $Date: 2004/05/16 11:16:01 $
  24. *
  25. * @author Stephen Colebourne
  26. */
  27. public final class FalsePredicate implements Predicate, Serializable {
  28. /** Serial version UID */
  29. static final long serialVersionUID = 7533784454832764388L;
  30. /** Singleton predicate instance */
  31. public static final Predicate INSTANCE = new FalsePredicate();
  32. /**
  33. * Factory returning the singleton instance.
  34. *
  35. * @return the singleton instance
  36. * @since Commons Collections 3.1
  37. */
  38. public static Predicate getInstance() {
  39. return INSTANCE;
  40. }
  41. /**
  42. * Restricted constructor.
  43. */
  44. private FalsePredicate() {
  45. super();
  46. }
  47. /**
  48. * Evaluates the predicate returning false always.
  49. *
  50. * @param object the input object
  51. * @return false always
  52. */
  53. public boolean evaluate(Object object) {
  54. return false;
  55. }
  56. }