com.compomics.util.experiment.identification.protein_inference.proteintree
Class NodeFactory

java.lang.Object
  extended by com.compomics.util.experiment.identification.protein_inference.proteintree.NodeFactory

public class NodeFactory
extends Object

This factory provides protein trees node contents from indexed text files.

Author:
Marc Vaudel

Field Summary
static String separator
          The separator used to separate line contents.
 
Method Summary
 void close()
          Closes the factory, closes all connection and deletes the file.
 HashMap<String,ArrayList<Integer>> getAccessions(long index)
          Returns the accessions at a given index.
static NodeFactory getInstance()
          Static method returning the instance of the factory.
static NodeFactory getInstance(File folder)
          Static method returning the instance of the factory and setting the serialization folder.
 void initiateFactory()
          Initiates the factory on the sequence factory.
 void saveAccessions(Node node, boolean emptyNode)
          Saves all the downstream accessions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

separator

public static final String separator
The separator used to separate line contents.

See Also:
Constant Field Values
Method Detail

getInstance

public static NodeFactory getInstance(File folder)
Static method returning the instance of the factory and setting the serialization folder.

Parameters:
folder - the serialization folder
Returns:
the instance of the factory

getInstance

public static NodeFactory getInstance()
Static method returning the instance of the factory. Note: the serialization folder should have been already set.

Returns:
the instance of the factory

initiateFactory

public void initiateFactory()
                     throws IOException
Initiates the factory on the sequence factory.

Throws:
IOException

saveAccessions

public void saveAccessions(Node node,
                           boolean emptyNode)
                    throws IOException
Saves all the downstream accessions.

Parameters:
node - the node
emptyNode - boolean indicating whether the node should be emptied (if true the accession mapping will be cleared)
Throws:
IOException

getAccessions

public HashMap<String,ArrayList<Integer>> getAccessions(long index)
                                                 throws IOException
Returns the accessions at a given index.

Parameters:
index - the index of the node
Returns:
the accessions at a given index, null if not found
Throws:
IOException

close

public void close()
           throws IOException
Closes the factory, closes all connection and deletes the file.

Throws:
IOException


Copyright © 2013. All Rights Reserved.