src/core/net/sf/basedb/util/bfs/BfsParser.java

Code
Comments
Other
Rev Date Author Line
5224 27 Jan 10 nicklas 1 /**
5224 27 Jan 10 nicklas 2   $Id$
5224 27 Jan 10 nicklas 3
5224 27 Jan 10 nicklas 4   Copyright (C) 2009 Nicklas Nordborg
5224 27 Jan 10 nicklas 5
5224 27 Jan 10 nicklas 6   This file is part of BASE - BioArray Software Environment.
5224 27 Jan 10 nicklas 7   Available at http://base.thep.lu.se/
5224 27 Jan 10 nicklas 8
5224 27 Jan 10 nicklas 9   BASE is free software; you can redistribute it and/or
5224 27 Jan 10 nicklas 10   modify it under the terms of the GNU General Public License
5224 27 Jan 10 nicklas 11   as published by the Free Software Foundation; either version 3
5224 27 Jan 10 nicklas 12   of the License, or (at your option) any later version.
5224 27 Jan 10 nicklas 13
5224 27 Jan 10 nicklas 14   BASE is distributed in the hope that it will be useful,
5224 27 Jan 10 nicklas 15   but WITHOUT ANY WARRANTY; without even the implied warranty of
5224 27 Jan 10 nicklas 16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5224 27 Jan 10 nicklas 17   GNU General Public License for more details.
5224 27 Jan 10 nicklas 18
5224 27 Jan 10 nicklas 19   You should have received a copy of the GNU General Public License
5224 27 Jan 10 nicklas 20   along with BASE. If not, see <http://www.gnu.org/licenses/>.
5224 27 Jan 10 nicklas 21 */
5224 27 Jan 10 nicklas 22 package net.sf.basedb.util.bfs;
5224 27 Jan 10 nicklas 23
5224 27 Jan 10 nicklas 24 /**
5224 27 Jan 10 nicklas 25   Interface that it is recommended that all BFS parsers should implement.
5224 27 Jan 10 nicklas 26   The main purpose is to expose information about the parsing progress to
5224 27 Jan 10 nicklas 27   interested parties, for example, {@link EventHandler}:s.
5224 27 Jan 10 nicklas 28
5224 27 Jan 10 nicklas 29   @author Nicklas
5224 27 Jan 10 nicklas 30   @version 2.15
5224 27 Jan 10 nicklas 31   @base.modified $Date$
5224 27 Jan 10 nicklas 32 */
5224 27 Jan 10 nicklas 33 public interface BfsParser
7551 12 Dec 18 nicklas 34   extends AutoCloseable
5224 27 Jan 10 nicklas 35 {
5224 27 Jan 10 nicklas 36   /**
5224 27 Jan 10 nicklas 37     Get the filename of the file that is being parsed.
5224 27 Jan 10 nicklas 38     @return The filename or null if not known
5224 27 Jan 10 nicklas 39   */
5224 27 Jan 10 nicklas 40   public String getFilename();
5224 27 Jan 10 nicklas 41
5224 27 Jan 10 nicklas 42   /**
5225 29 Jan 10 nicklas 43     Get the size of the file that is being parsed.
5225 29 Jan 10 nicklas 44     @return The size of the file or -1 if not known
5225 29 Jan 10 nicklas 45   */
5225 29 Jan 10 nicklas 46   public long getFileSize();
5225 29 Jan 10 nicklas 47
5225 29 Jan 10 nicklas 48   
5225 29 Jan 10 nicklas 49   /**
5224 27 Jan 10 nicklas 50     Get the current line number.
5224 27 Jan 10 nicklas 51     @return The line number, starting at 1 for the first line in the file, or -1
5224 27 Jan 10 nicklas 52       if not known
5224 27 Jan 10 nicklas 53   */
5224 27 Jan 10 nicklas 54   public int getCurrentLine();
5225 29 Jan 10 nicklas 55   
5225 29 Jan 10 nicklas 56   /**
5225 29 Jan 10 nicklas 57     Get the number of parsed bytes so far.
5225 29 Jan 10 nicklas 58     @return The number of bytes that has been parsed, or -1 if not
5225 29 Jan 10 nicklas 59       known
5225 29 Jan 10 nicklas 60   */
5225 29 Jan 10 nicklas 61   public long getParsedBytes();
5225 29 Jan 10 nicklas 62   
5319 20 Apr 10 nicklas 63   /**
5319 20 Apr 10 nicklas 64     Close the parser and relase underlying system resources that
5319 20 Apr 10 nicklas 65     are associated with it.
5319 20 Apr 10 nicklas 66   */
7551 12 Dec 18 nicklas 67   @Override
5319 20 Apr 10 nicklas 68   public void close();
5319 20 Apr 10 nicklas 69   
5224 27 Jan 10 nicklas 70 }