From: David ‘Bombe’ Roden Date: Sun, 17 May 2009 20:02:45 +0000 (+0200) Subject: Add filter interface. X-Git-Tag: v0.1.1~56 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=b7805163d342716156eb1cd46132516677a4d519;p=jFCPlib.git Add filter interface. --- 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); + +}