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.blast;
022
023import org.biojava.nbio.core.search.io.Hit;
024import java.util.HashMap;
025import java.util.List;
026import org.biojava.nbio.core.sequence.template.Sequence;
027
028/**
029 * Designed by Paolo Pavan.
030 * You may want to find my contacts on Github and LinkedIn for code info
031 * or discuss major changes.
032 * https://github.com/paolopavan
033 *
034 * @author Paolo Pavan
035 */
036
037public class BlastResultBuilder {
038        private String program;
039        private String version;
040        private String reference;
041        private String dbFile;
042        private HashMap<String, String> programSpecificParameters;
043        private int iterationNumber;
044        private String queryID;
045        private String queryDef;
046        private int queryLength;
047        private Sequence querySequence;
048        private List<Hit> hits;
049
050        public BlastResultBuilder() {
051        }
052
053        public BlastResultBuilder setProgram(String program) {
054                this.program = program;
055                return this;
056        }
057
058        public BlastResultBuilder setVersion(String version) {
059                this.version = version;
060                return this;
061        }
062
063        public BlastResultBuilder setReference(String reference) {
064                this.reference = reference;
065                return this;
066        }
067
068        public BlastResultBuilder setDbFile(String dbFile) {
069                this.dbFile = dbFile;
070                return this;
071        }
072
073        public BlastResultBuilder setProgramSpecificParameters(HashMap<String, String> programSpecificParameters) {
074                this.programSpecificParameters = programSpecificParameters;
075                return this;
076        }
077
078        public BlastResultBuilder setIterationNumber(int iterationNumber) {
079                this.iterationNumber = iterationNumber;
080                return this;
081        }
082
083        public BlastResultBuilder setQueryID(String queryID) {
084                this.queryID = queryID;
085                return this;
086        }
087
088        public BlastResultBuilder setQueryDef(String queryDef) {
089                this.queryDef = queryDef;
090                return this;
091        }
092
093        public BlastResultBuilder setQueryLength(int queryLength) {
094                this.queryLength = queryLength;
095                return this;
096        }
097
098        public BlastResultBuilder setHits(List<Hit> hits) {
099                this.hits = hits;
100                return this;
101        }
102
103        public BlastResultBuilder setQuerySequence(Sequence s) {
104                this.querySequence = s;
105                return this;
106        }
107
108        public BlastResult createBlastResult() {
109                return new BlastResult(program, version, reference, dbFile, programSpecificParameters, iterationNumber, queryID, queryDef, queryLength, hits, querySequence);
110        }
111
112}