owltools.gaf
Class GafObjectsBuilder

java.lang.Object
  extended by 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

Constructor Summary
GafObjectsBuilder()
           
GafObjectsBuilder(int splitSize)
           
 
Method Summary
 GafDocument buildDocument(File gafFilePath)
           
 GafDocument buildDocument(Reader reader, String docId, String path)
           
 GafDocument buildDocument(String gafFile)
           
 GafDocument buildDocument(String fileName, String docId, String path)
           
 GafDocument getGafDocument()
           
 GafDocument getNextSplitDocument()
          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
 GAFParser getParser()
           
 int getSplitSize()
           
 boolean isDocumentSplitted()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GafObjectsBuilder

public GafObjectsBuilder()

GafObjectsBuilder

public GafObjectsBuilder(int splitSize)
Method Detail

getSplitSize

public int getSplitSize()

getGafDocument

public GafDocument getGafDocument()

getParser

public GAFParser getParser()

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.