|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.kit.furia.io.AbstractFuriaInput<O>
public abstract class AbstractFuriaInput<O extends org.ajmm.obsearch.OB>
AbstractFuriaInput is in charge of reading fragment files and creating documents out of them.
| Field Summary | |
|---|---|
static java.lang.String |
fragmentFileName
The name of the file that holds the fragments (words) inside a directory. |
| Constructor Summary | |
|---|---|
AbstractFuriaInput(java.io.File directory)
Creates a new fragment file reader based on the given directory. |
|
| Method Summary | |
|---|---|
Document<O> |
getDocument(java.lang.String id,
java.io.File fragments)
Parses a file that is in the furia-chan fragment file format: "#" starts a comment and it is ignored. |
java.util.Iterator<Document<O>> |
getDocumentsFromDirectory()
This method receives a directory and returns an iterator that will lazily create documents from the given directory. |
boolean |
isParsableLine(java.lang.String line)
Returns true if the given line is not null or if it is not a comment. |
protected abstract O |
readObjectFromStringLine(java.lang.String data)
Reads and creates an O object from the given string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String fragmentFileName
| Constructor Detail |
|---|
public AbstractFuriaInput(java.io.File directory)
directory - | Method Detail |
|---|
protected abstract O readObjectFromStringLine(java.lang.String data)
throws org.ajmm.obsearch.exception.OBException
data - The string to be parsed
org.ajmm.obsearch.exception.OBException - if something goes wrong when parsing the data.
public java.util.Iterator<Document<O>> getDocumentsFromDirectory()
throws java.io.IOException
directory - that will be processed
java.io.IOException - If the given directory does not exist.
public Document<O> getDocument(java.lang.String id,
java.io.File fragments)
throws java.io.IOException,
org.ajmm.obsearch.exception.OBException
fragments - A file in which fragment files can be found.id - The id that the document will hold.
java.io.IOException - If fragments does not exist, or any other error occurs.
org.ajmm.obsearch.exception.OBExceptionpublic boolean isParsableLine(java.lang.String line)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||