public class TwitterJSONCollection extends Object implements Collection
| Modifier and Type | Field and Description | 
|---|---|
| protected Document | currentDocumentThe current document | 
| protected String | currentFilenameThe name of the current file | 
| protected BufferedReader | currentTweetStreamThe underlying file stream reading tweets from the current file | 
| protected boolean | endOfCollectionHave we reached the end of the collection yet? | 
| protected int | FileNumberThe index in the FilesToProcess of the currently processed file. | 
| protected ArrayList<String> | FilesToProcessThe list of files to process. | 
| protected com.google.gson.JsonStreamParser | JSONStreamThe JSON stream containing the tweets | 
| protected static org.slf4j.Logger | loggerlogger for this class | 
| protected boolean | SkipFileA boolean which is true when a new file is open. | 
| Constructor and Description | 
|---|
| TwitterJSONCollection() | 
| TwitterJSONCollection(String CollectionSpecFile) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addFileToProcess(String JSONFile) | 
| void | close() | 
| boolean | endOfCollection()Returns true if the end of the collection has been reached | 
| Document | getDocument()Get the document object representing the current document. | 
| void | init() | 
| protected void | loadJSON(String file) | 
| boolean | nextDocument()Move the collection to the start of the next document. | 
| boolean | openNextFile()Opens the next document from the collection specification. | 
| protected void | readCollectionSpec(String CollectionSpecFilename) | 
| com.google.gson.JsonObject | readTweet() | 
| void | reset()Resets the Collection iterator to the start of the collection. | 
protected static final org.slf4j.Logger logger
protected boolean SkipFile
protected com.google.gson.JsonStreamParser JSONStream
protected BufferedReader currentTweetStream
protected Document currentDocument
protected String currentFilename
protected int FileNumber
protected boolean endOfCollection
public TwitterJSONCollection(String CollectionSpecFile)
public TwitterJSONCollection()
public void init()
protected void loadJSON(String file) throws IOException
IOExceptionpublic void addFileToProcess(String JSONFile)
protected void readCollectionSpec(String CollectionSpecFilename)
public boolean openNextFile()
                     throws IOException
IOException - if there is an exception while opening the 
                 collection files.public void close()
           throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic boolean nextDocument()
CollectionnextDocument in interface Collectionpublic com.google.gson.JsonObject readTweet()
public Document getDocument()
CollectiongetDocument in interface Collectionpublic boolean endOfCollection()
CollectionendOfCollection in interface Collectionpublic void reset()
Collectionreset in interface CollectionTerrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow