5224 |
27 Jan 10 |
nicklas |
1 |
/** |
5224 |
27 Jan 10 |
nicklas |
$Id$ |
5224 |
27 Jan 10 |
nicklas |
3 |
|
5224 |
27 Jan 10 |
nicklas |
Copyright (C) 2009 Nicklas Nordborg |
5224 |
27 Jan 10 |
nicklas |
5 |
|
5224 |
27 Jan 10 |
nicklas |
This file is part of BASE - BioArray Software Environment. |
5224 |
27 Jan 10 |
nicklas |
Available at http://base.thep.lu.se/ |
5224 |
27 Jan 10 |
nicklas |
8 |
|
5224 |
27 Jan 10 |
nicklas |
BASE is free software; you can redistribute it and/or |
5224 |
27 Jan 10 |
nicklas |
modify it under the terms of the GNU General Public License |
5224 |
27 Jan 10 |
nicklas |
as published by the Free Software Foundation; either version 3 |
5224 |
27 Jan 10 |
nicklas |
of the License, or (at your option) any later version. |
5224 |
27 Jan 10 |
nicklas |
13 |
|
5224 |
27 Jan 10 |
nicklas |
BASE is distributed in the hope that it will be useful, |
5224 |
27 Jan 10 |
nicklas |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
5224 |
27 Jan 10 |
nicklas |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5224 |
27 Jan 10 |
nicklas |
GNU General Public License for more details. |
5224 |
27 Jan 10 |
nicklas |
18 |
|
5224 |
27 Jan 10 |
nicklas |
You should have received a copy of the GNU General Public License |
5224 |
27 Jan 10 |
nicklas |
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 |
Interface that it is recommended that all BFS parsers should implement. |
5224 |
27 Jan 10 |
nicklas |
The main purpose is to expose information about the parsing progress to |
5224 |
27 Jan 10 |
nicklas |
interested parties, for example, {@link EventHandler}:s. |
5224 |
27 Jan 10 |
nicklas |
28 |
|
5224 |
27 Jan 10 |
nicklas |
@author Nicklas |
5224 |
27 Jan 10 |
nicklas |
@version 2.15 |
5224 |
27 Jan 10 |
nicklas |
@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 |
Get the filename of the file that is being parsed. |
5224 |
27 Jan 10 |
nicklas |
@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 |
Get the size of the file that is being parsed. |
5225 |
29 Jan 10 |
nicklas |
@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 |
Get the current line number. |
5224 |
27 Jan 10 |
nicklas |
@return The line number, starting at 1 for the first line in the file, or -1 |
5224 |
27 Jan 10 |
nicklas |
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 |
Get the number of parsed bytes so far. |
5225 |
29 Jan 10 |
nicklas |
@return The number of bytes that has been parsed, or -1 if not |
5225 |
29 Jan 10 |
nicklas |
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 |
Close the parser and relase underlying system resources that |
5319 |
20 Apr 10 |
nicklas |
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 |
} |