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

Code
Comments
Other
Rev Date Author Line
5198 15 Dec 09 nicklas 1 /**
5198 15 Dec 09 nicklas 2   $Id$
5198 15 Dec 09 nicklas 3
5198 15 Dec 09 nicklas 4   Copyright (C) 2009 Nicklas Nordborg
5198 15 Dec 09 nicklas 5
5198 15 Dec 09 nicklas 6   This file is part of BASE - BioArray Software Environment.
5198 15 Dec 09 nicklas 7   Available at http://base.thep.lu.se/
5198 15 Dec 09 nicklas 8
5198 15 Dec 09 nicklas 9   BASE is free software; you can redistribute it and/or
5198 15 Dec 09 nicklas 10   modify it under the terms of the GNU General Public License
5198 15 Dec 09 nicklas 11   as published by the Free Software Foundation; either version 3
5198 15 Dec 09 nicklas 12   of the License, or (at your option) any later version.
5198 15 Dec 09 nicklas 13
5198 15 Dec 09 nicklas 14   BASE is distributed in the hope that it will be useful,
5198 15 Dec 09 nicklas 15   but WITHOUT ANY WARRANTY; without even the implied warranty of
5198 15 Dec 09 nicklas 16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5198 15 Dec 09 nicklas 17   GNU General Public License for more details.
5198 15 Dec 09 nicklas 18
5198 15 Dec 09 nicklas 19   You should have received a copy of the GNU General Public License
5198 15 Dec 09 nicklas 20   along with BASE. If not, see <http://www.gnu.org/licenses/>.
5198 15 Dec 09 nicklas 21 */
5198 15 Dec 09 nicklas 22 package net.sf.basedb.util.bfs;
5198 15 Dec 09 nicklas 23
5198 15 Dec 09 nicklas 24 import java.io.IOException;
5198 15 Dec 09 nicklas 25
5198 15 Dec 09 nicklas 26 /**
5198 15 Dec 09 nicklas 27   Factory implementations are responsible for creating BFS data writers
5198 15 Dec 09 nicklas 28   that accepts data for a given owner object. 
5198 15 Dec 09 nicklas 29
5198 15 Dec 09 nicklas 30   @author Nicklas
5198 15 Dec 09 nicklas 31   @version 2.15
5198 15 Dec 09 nicklas 32   @base.modified $Date$
5198 15 Dec 09 nicklas 33 */
5198 15 Dec 09 nicklas 34 public interface DataWriterFactory<T>
5198 15 Dec 09 nicklas 35 {
5198 15 Dec 09 nicklas 36   /**
5198 15 Dec 09 nicklas 37     Create a data writer for writing data that belongs to the
5198 15 Dec 09 nicklas 38     given owner. The owner is typically a bioassay (serial bfs format)
5198 15 Dec 09 nicklas 39     or a spot data field (matrix bfs format). The returned writer should
5198 15 Dec 09 nicklas 40     usually have it's filename ({@link DataWriter#getFilename()}) and
5198 15 Dec 09 nicklas 41     number of columns ({@link DataWriter#getColumnCount()}) set, since this 
5198 15 Dec 09 nicklas 42     is needed for the metadata generation.
5198 15 Dec 09 nicklas 43     
5198 15 Dec 09 nicklas 44     @param owner The object that "owns" the data that is written
5198 15 Dec 09 nicklas 45       to the file
5198 15 Dec 09 nicklas 46     @param suggestedFilename An optional suggested filename, the
5198 15 Dec 09 nicklas 47       factory may use this string or generate a different filename
5198 15 Dec 09 nicklas 48     @return A data writer object with the filename and number 
5198 15 Dec 09 nicklas 49       of colums set (unless otherwise specified)
5198 15 Dec 09 nicklas 50   */
5198 15 Dec 09 nicklas 51   public DataWriter createDataWriter(T owner, String suggestedFilename)
5198 15 Dec 09 nicklas 52     throws IOException;
5198 15 Dec 09 nicklas 53 }