001package com.hfg.bio.seq.format;
002
003import com.hfg.bio.seq.BioSequence;
004
005import java.io.BufferedReader;
006import java.io.File;
007import java.util.List;
008
009
010//------------------------------------------------------------------------------
011/**
012 Interface for readable sequence formats.
013 <div>
014   @author J. Alex Taylor, hairyfatguy.com
015 </div>
016 */
017//------------------------------------------------------------------------------
018// com.hfg Library
019//
020// This library is free software; you can redistribute it and/or
021// modify it under the terms of the GNU Lesser General Public
022// License as published by the Free Software Foundation; either
023// version 2.1 of the License, or (at your option) any later version.
024//
025// This library is distributed in the hope that it will be useful,
026// but WITHOUT ANY WARRANTY; without even the implied warranty of
027// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
028// Lesser General Public License for more details.
029//
030// You should have received a copy of the GNU Lesser General Public
031// License along with this library; if not, write to the Free Software
032// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
033//
034// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com
035// jataylor@hairyfatguy.com
036//------------------------------------------------------------------------------
037
038public interface ReadableSeqFormat<T extends BioSequence>
039{
040   public List<T> read(File inFile) throws SeqIOException;
041
042   public List<T> read(BufferedReader inFile) throws SeqIOException;
043
044   public T readRecord(CharSequence inString) throws SeqIOException;
045
046   public T readRecord(BufferedReader inReader) throws SeqIOException;
047
048   public boolean isEndOfRecord(String inLine);
049
050   /**
051    A format has a Janus delimiter if the line that indicates that the previous record is over is also part of the
052    next record. Will return true for formats like FASTA.
053    @return whether or not this format's record delimiter is also part of the next record
054    */
055   public boolean hasJanusDelimiter();
056}