src/core/net/sf/basedb/util/bfs/EventHandler.java

Code
Comments
Other
Rev Date Author Line
5193 27 Nov 09 nicklas 1 /**
5193 27 Nov 09 nicklas 2   $Id$
5193 27 Nov 09 nicklas 3
5193 27 Nov 09 nicklas 4   Copyright (C) 2009 Nicklas Nordborg
5193 27 Nov 09 nicklas 5
5193 27 Nov 09 nicklas 6   This file is part of BASE - BioArray Software Environment.
5193 27 Nov 09 nicklas 7   Available at http://base.thep.lu.se/
5193 27 Nov 09 nicklas 8
5193 27 Nov 09 nicklas 9   BASE is free software; you can redistribute it and/or
5193 27 Nov 09 nicklas 10   modify it under the terms of the GNU General Public License
5193 27 Nov 09 nicklas 11   as published by the Free Software Foundation; either version 3
5193 27 Nov 09 nicklas 12   of the License, or (at your option) any later version.
5193 27 Nov 09 nicklas 13
5193 27 Nov 09 nicklas 14   BASE is distributed in the hope that it will be useful,
5193 27 Nov 09 nicklas 15   but WITHOUT ANY WARRANTY; without even the implied warranty of
5193 27 Nov 09 nicklas 16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5193 27 Nov 09 nicklas 17   GNU General Public License for more details.
5193 27 Nov 09 nicklas 18
5193 27 Nov 09 nicklas 19   You should have received a copy of the GNU General Public License
5193 27 Nov 09 nicklas 20   along with BASE. If not, see <http://www.gnu.org/licenses/>.
5193 27 Nov 09 nicklas 21 */
5193 27 Nov 09 nicklas 22 package net.sf.basedb.util.bfs;
5193 27 Nov 09 nicklas 23
5193 27 Nov 09 nicklas 24 /**
5193 27 Nov 09 nicklas 25   Event handlers are used for reacting to various parsing events when
5193 27 Nov 09 nicklas 26   parsing BFS files. Different parsers generate different types of events,
5193 27 Nov 09 nicklas 27   and generally, different event handler implementations are needed
5193 27 Nov 09 nicklas 28   for different BFS file types.
5193 27 Nov 09 nicklas 29
5193 27 Nov 09 nicklas 30   @author Nicklas
5193 27 Nov 09 nicklas 31   @version 2.15
5193 27 Nov 09 nicklas 32   @base.modified $Date$
5193 27 Nov 09 nicklas 33 */
5193 27 Nov 09 nicklas 34 public interface EventHandler
5193 27 Nov 09 nicklas 35 {
5193 27 Nov 09 nicklas 36   
5193 27 Nov 09 nicklas 37   /**
5193 27 Nov 09 nicklas 38     The method is called by the parser when it has found something
5193 27 Nov 09 nicklas 39     interesting in a BFS file. See the respective parser documentation
5193 27 Nov 09 nicklas 40     for documentation about the events that it generates. There is
5193 27 Nov 09 nicklas 41     usually some kind of information associated with the event. This
5193 27 Nov 09 nicklas 42     information is sent to the event handler as an object. The parser
5193 27 Nov 09 nicklas 43     should document what kind of information it sends so that event
5193 27 Nov 09 nicklas 44     handler implementation can react and use the information.
5193 27 Nov 09 nicklas 45     <p>
5193 27 Nov 09 nicklas 46     It is recommended that event handlers ignore event types they
5193 27 Nov 09 nicklas 47     don't know about.
5193 27 Nov 09 nicklas 48     
5193 27 Nov 09 nicklas 49     @param eventType The type of event. See the parser documentation
5193 27 Nov 09 nicklas 50       for more information about the event types it generates
5193 27 Nov 09 nicklas 51     @param eventData The data that is associated with the event
5224 27 Jan 10 nicklas 52     @param parser The parser that is resposible for parsing the file
5193 27 Nov 09 nicklas 53   */
5224 27 Jan 10 nicklas 54   public <T> void handleEvent(EventType<T> eventType, T eventData, BfsParser parser);
5193 27 Nov 09 nicklas 55   
5193 27 Nov 09 nicklas 56 }