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 023 024import org.biojava.nbio.core.search.io.Hsp; 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 */ 036public class BlastHitBuilder { 037 private int hitNum; 038 private String hitId; 039 private String hitDef; 040 private String hitAccession; 041 private int hitLen; 042 private Sequence hitSequence; 043 private List<Hsp> hsps; 044 045 public BlastHitBuilder() { 046 } 047 048 public BlastHitBuilder setHitNum(int hitNum) { 049 this.hitNum = hitNum; 050 return this; 051 } 052 053 public BlastHitBuilder setHitId(String hitId) { 054 this.hitId = hitId; 055 return this; 056 } 057 058 public BlastHitBuilder setHitDef(String hitDef) { 059 this.hitDef = hitDef; 060 return this; 061 } 062 063 public BlastHitBuilder setHitAccession(String hitAccession) { 064 this.hitAccession = hitAccession; 065 return this; 066 } 067 068 public BlastHitBuilder setHitLen(int hitLen) { 069 this.hitLen = hitLen; 070 return this; 071 } 072 073 public BlastHitBuilder setHitSequence(Sequence s) { 074 this.hitSequence = s; 075 return this; 076 } 077 078 public BlastHitBuilder setHsps(List<Hsp> hsps) { 079 this.hsps = hsps; 080 return this; 081 } 082 083 public BlastHit createBlastHit() { 084 return new BlastHit(hitNum, hitId, hitDef, hitAccession, hitLen, hsps, hitSequence); 085 } 086 087}