001/*
002 * GWTEventService
003 * Copyright (c) 2011 and beyond, strawbill UG (haftungsbeschr?nkt)
004 *
005 * This is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU Lesser General Public License as
007 * published by the Free Software Foundation; either version 3 of
008 * the License, or (at your option) any later version.
009 * Other licensing for GWTEventService may also be possible on request.
010 * Please view the license.txt of the project for more information.
011 *
012 * This software is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * You should have received a copy of the GNU Lesser General Public
018 * License along with this software; if not, write to the Free
019 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021 */
022package de.novanic.eventservice.client.event.filter;
023
024/**
025 * A CascadingEventFilter is based on cascading filter sequences. An CascadingEventFilter can only hold one next
026 * EventFilter. When the next EventFilter is also a CascadingEventFilter, it can handle another EventFilter...
027 * That technique can be used to build filter sequences (cascading).
028 * A other solution to build filter sequences is available with {@link de.novanic.eventservice.client.event.filter.CompositeEventFilter}
029 * or rather {@link de.novanic.eventservice.client.event.filter.EventFilterFactory#connect(EventFilter...)}.
030 *
031 * @author sstrohschein
032 *         <br>Date: 05.03.2009
033 *         <br>Time: 12:04:03
034 */
035public interface CascadingEventFilter extends AppendableEventFilter
036{
037    /**
038     * Returns the attached EventFilter. A CascadingEventFilter can only hold one {@link de.novanic.eventservice.client.event.filter.EventFilter}.
039     * EventFilter instances can be attached with {@link de.novanic.eventservice.client.event.filter.AppendableEventFilter#attach(EventFilter)}.
040     * @return the attached {@link de.novanic.eventservice.client.event.filter.EventFilter}
041     */
042    EventFilter getAttachedEventFilter();
043
044    /**
045     * Detaches the attached {@link de.novanic.eventservice.client.event.filter.EventFilter}. A CascadingEventFilter can
046     * only hold one {@link de.novanic.eventservice.client.event.filter.EventFilter}.
047     * EventFilter instances can be attached with {@link de.novanic.eventservice.client.event.filter.AppendableEventFilter#attach(EventFilter)}.
048     * @return true if an EventFilter was registered, otherwise false
049     */
050    boolean detach();
051}