owltools.gaf
Class GafObjectsBuilder
java.lang.Object
owltools.gaf.GafObjectsBuilder
public class GafObjectsBuilder
- extends Object
The class builds GafDocument
a gaf file. By default it read the whole
gaf file and builds the GAFDocument.
If a GAF file is large enough, e.g. uniprot file, it cannot be loaded as
whole into memory. In such cases the file can to be split into smaller units,
such that only one unit is loaded into memory.
This class has built-in this split functionality. By creating the instance of
this class through the constructor with int parameter (split size) enable the
split methodology of building the gaf document.
See GafObjectsBuilderTest
class for details how to build GafDocument
object from this class.
- Author:
- Shahid Manzoor
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GafObjectsBuilder
public GafObjectsBuilder()
GafObjectsBuilder
public GafObjectsBuilder(int splitSize)
getSplitSize
public int getSplitSize()
getGafDocument
public GafDocument getGafDocument()
getParser
public GAFParser getParser()
addFilter
public void addFilter(GafLineFilter filter)
- Add a filter to object builder. Multiple filters are executed in the
order of insertion. Any rejection preempts the execution of the remaining
filters.
- Parameters:
filter
-
buildDocument
public GafDocument buildDocument(Reader reader,
String docId,
String path)
throws IOException
- Throws:
IOException
buildDocument
public GafDocument buildDocument(String fileName,
String docId,
String path)
throws IOException,
URISyntaxException
- Throws:
IOException
URISyntaxException
getNextSplitDocument
public GafDocument getNextSplitDocument()
throws IOException
- When this variable reaches the splitSize count, the algorithm in the
getNextSplitDocument()
method stops calling next method of the GafParser
and returns the GafDocument
object build with the number of rows
- Returns:
- gafDocument
- Throws:
IOException
isDocumentSplitted
public boolean isDocumentSplitted()
buildDocument
public GafDocument buildDocument(File gafFilePath)
throws IOException
- Throws:
IOException
buildDocument
public GafDocument buildDocument(String gafFile)
throws IOException,
URISyntaxException
- Throws:
IOException
URISyntaxException
Copyright © 2010-2013. All Rights Reserved.