5198 |
15 Dec 09 |
nicklas |
1 |
/** |
5198 |
15 Dec 09 |
nicklas |
$Id$ |
5198 |
15 Dec 09 |
nicklas |
3 |
|
5198 |
15 Dec 09 |
nicklas |
Copyright (C) 2009 Nicklas Nordborg |
5198 |
15 Dec 09 |
nicklas |
5 |
|
5198 |
15 Dec 09 |
nicklas |
This file is part of BASE - BioArray Software Environment. |
5198 |
15 Dec 09 |
nicklas |
Available at http://base.thep.lu.se/ |
5198 |
15 Dec 09 |
nicklas |
8 |
|
5198 |
15 Dec 09 |
nicklas |
BASE is free software; you can redistribute it and/or |
5198 |
15 Dec 09 |
nicklas |
modify it under the terms of the GNU General Public License |
5198 |
15 Dec 09 |
nicklas |
as published by the Free Software Foundation; either version 3 |
5198 |
15 Dec 09 |
nicklas |
of the License, or (at your option) any later version. |
5198 |
15 Dec 09 |
nicklas |
13 |
|
5198 |
15 Dec 09 |
nicklas |
BASE is distributed in the hope that it will be useful, |
5198 |
15 Dec 09 |
nicklas |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
5198 |
15 Dec 09 |
nicklas |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5198 |
15 Dec 09 |
nicklas |
GNU General Public License for more details. |
5198 |
15 Dec 09 |
nicklas |
18 |
|
5198 |
15 Dec 09 |
nicklas |
You should have received a copy of the GNU General Public License |
5198 |
15 Dec 09 |
nicklas |
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 |
Factory implementations are responsible for creating BFS data writers |
5198 |
15 Dec 09 |
nicklas |
that accepts data for a given owner object. |
5198 |
15 Dec 09 |
nicklas |
29 |
|
5198 |
15 Dec 09 |
nicklas |
@author Nicklas |
5198 |
15 Dec 09 |
nicklas |
@version 2.15 |
5198 |
15 Dec 09 |
nicklas |
@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 |
Create a data writer for writing data that belongs to the |
5198 |
15 Dec 09 |
nicklas |
given owner. The owner is typically a bioassay (serial bfs format) |
5198 |
15 Dec 09 |
nicklas |
or a spot data field (matrix bfs format). The returned writer should |
5198 |
15 Dec 09 |
nicklas |
usually have it's filename ({@link DataWriter#getFilename()}) and |
5198 |
15 Dec 09 |
nicklas |
number of columns ({@link DataWriter#getColumnCount()}) set, since this |
5198 |
15 Dec 09 |
nicklas |
is needed for the metadata generation. |
5198 |
15 Dec 09 |
nicklas |
43 |
|
5198 |
15 Dec 09 |
nicklas |
@param owner The object that "owns" the data that is written |
5198 |
15 Dec 09 |
nicklas |
to the file |
5198 |
15 Dec 09 |
nicklas |
@param suggestedFilename An optional suggested filename, the |
5198 |
15 Dec 09 |
nicklas |
factory may use this string or generate a different filename |
5198 |
15 Dec 09 |
nicklas |
@return A data writer object with the filename and number |
5198 |
15 Dec 09 |
nicklas |
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 |
} |