public class BasicCollectionReader extends Object implements CollectionReader
Basic collection reader (supporting class for indexing)
Copyright: Copyright (c) 2005
Company: IST, Drexel University
| Modifier and Type | Field and Description |
|---|---|
protected BufferedReader |
br |
protected String |
collectionFile |
protected String |
indexFile |
protected BasicArticleIndex |
indexList |
protected ArticleParser |
parser |
protected RandomAccessFile |
raf |
| Constructor and Description |
|---|
BasicCollectionReader() |
BasicCollectionReader(String collectionFile) |
BasicCollectionReader(String collectionFile,
String indexFile) |
BasicCollectionReader(String collectionFile,
String indexFile,
ArticleParser parser) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the collection reader and releases all occupied resources.
|
Article |
getArticleByKey(String key)
Reads out the article according to its key
|
ArticleParser |
getArticleParser()
Gets the article parser of the collection reader
|
Article |
getNextArticle()
Collection readers only support forward-only read mode.
|
boolean |
loadCollection(String collectionFile,
String indexFile) |
void |
restart()
The collection reader supports forward-only read mode.
|
void |
setArticleParser(ArticleParser parser)
Sets the article parse for the collection reader
|
int |
size()
The size of the collection.
|
boolean |
supportArticleKeyRetrieval()
if the query supports this retrieval mode, one can get articles by calling getArticleByKey method.
|
protected ArticleParser parser
protected BufferedReader br
protected BasicArticleIndex indexList
protected RandomAccessFile raf
protected String collectionFile
protected String indexFile
public BasicCollectionReader()
public BasicCollectionReader(String collectionFile)
public BasicCollectionReader(String collectionFile, String indexFile, ArticleParser parser)
public ArticleParser getArticleParser()
CollectionReadergetArticleParser in interface CollectionReaderpublic void setArticleParser(ArticleParser parser)
CollectionReadersetArticleParser in interface CollectionReaderparser - the article parserpublic Article getArticleByKey(String key)
CollectionReadergetArticleByKey in interface CollectionReaderkey - the unique entry number of the articlepublic Article getNextArticle()
CollectionReadergetNextArticle in interface CollectionReaderpublic void close()
CollectionReaderclose in interface CollectionReaderpublic boolean supportArticleKeyRetrieval()
CollectionReadersupportArticleKeyRetrieval in interface CollectionReaderpublic void restart()
CollectionReaderrestart in interface CollectionReaderpublic int size()
CollectionReadersize in interface CollectionReaderCopyright © 2018 JULIE Lab, Germany. All rights reserved.