From b7805163d342716156eb1cd46132516677a4d519 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 17 May 2009 22:02:45 +0200 Subject: [PATCH] Add filter interface. --- src/net/pterodactylus/util/filter/Filter.java | 42 +++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/net/pterodactylus/util/filter/Filter.java diff --git a/src/net/pterodactylus/util/filter/Filter.java b/src/net/pterodactylus/util/filter/Filter.java new file mode 100644 index 0000000..a17931a --- /dev/null +++ b/src/net/pterodactylus/util/filter/Filter.java @@ -0,0 +1,42 @@ +/* + * jFCPlib - Filter.java - + * Copyright © 2009 David Roden + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ +package net.pterodactylus.util.filter; + +/** + * Interface for a filter that determines whether a certain action can be + * performed on an object based on its properties. + * + * @param + * The type of the filtered object + * @author David ‘Bombe’ Roden <bombe@freenetproject.org> + */ +public interface Filter { + + /** + * Runs the given object through this filter and return whether the object + * matches this filter or not. + * + * @param object + * The object to analyse + * @return true if the object matched this filter, + * false otherwise + */ + public boolean filterObject(T object); + +} -- 2.7.4