001package com.hfg.chem.format;
002
003import java.io.BufferedReader;
004import java.io.File;
005import java.util.List;
006
007import com.hfg.chem.Molecule;
008
009
010//------------------------------------------------------------------------------
011/**
012 Interface for readable chemistry 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 ReadableChemFormat<T extends Molecule>
039{
040   public List<T> read(File inFile) throws ChemIOException;
041
042   public List<T> read(BufferedReader inFile) throws ChemIOException;
043
044   public T readRecord(CharSequence inString) throws ChemIOException;
045
046   public T readRecord(BufferedReader inReader) throws ChemIOException;
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.
053    @return whether or not this format's record delimiter is also part of the next record
054    */
055   public boolean hasJanusDelimiter();
056}