001/* 002 * BioJava development code 003 * 004 * This code may be freely distributed and modified under the 005 * terms of the GNU Lesser General Public Licence. This should 006 * be distributed with the code. If you do not have a copy, 007 * see: 008 * 009 * http://www.gnu.org/copyleft/lesser.html 010 * 011 * Copyright for this code is held jointly by the individual 012 * authors. These should be listed in @author doc comments. 013 * 014 * For more information on the BioJava project and its aims, 015 * or to join the biojava-l mailing list, visit the home page 016 * at: 017 * 018 * http://www.biojava.org/ 019 * 020 */ 021package org.biojava.nbio.core.search.io; 022 023import java.io.File; 024import java.io.IOException; 025import java.text.ParseException; 026import java.util.List; 027import org.biojava.nbio.core.sequence.template.Sequence; 028 029/** 030 * Designed by Paolo Pavan. 031 * You may want to find my contacts on Github and LinkedIn for code info 032 * or discuss major changes. 033 * https://github.com/paolopavan 034 * 035 * @author Paolo Pavan 036 */ 037 038public interface ResultFactory { 039 /** 040 * returns a list of file extensions associated to this ResultFactory 041 * 042 * @return 043 */ 044 List<String> getFileExtensions(); 045 void setFile(File f); 046 /** 047 * Launch the parsing and get back a list of Result objects representing the 048 * search result in the specified file. 049 * 050 * @param maxEScore 051 * @return 052 * @throws Exception 053 */ 054 List<Result> createObjects(double maxEScore) throws IOException, ParseException; 055 /** 056 * The factory that implements this method will be able to save the Search results 057 * to a file in the same format that it is able to read. 058 * 059 * @param results 060 * @throws Exception 061 */ 062 void storeObjects(List<Result> results) throws IOException, ParseException; 063 064 /** 065 * Specify the collection of sequences objects used as queries in the Search run. 066 * They will be associated back to the query during the construction of the Result object. 067 * @param sequences 068 */ 069 void setQueryReferences(List<Sequence> sequences); 070 /** 071 * Specify the collection of sequences objects used as database in the Search run. 072 * They will be associated back to the Hit during the construction of the Hit object. 073 * @param sequences 074 */ 075 void setDatabaseReferences(List<Sequence> sequences); 076}