procope.methods.scores.bootstrap
Class BootstrapClusterings

java.lang.Object
  extended by procope.methods.scores.bootstrap.BootstrapClusterings
All Implemented Interfaces:
Iterable<BootstrapClustering>

public class BootstrapClusterings
extends Object
implements Iterable<BootstrapClustering>

Container for bootstrap MCL clustering lists. Contains methods to write and load these clustering collections to and from the file system.

This class belongs to the helper classes needed for parallelizable bootstrap scores calculation.

Author:
Jan Krumsiek

Constructor Summary
BootstrapClusterings()
          Create empty clusterings list.
BootstrapClusterings(String file)
          Reads a clustering collection from a given file.
BootstrapClusterings(String file, boolean noRealClusterings)
          Reads a clusterings collection from a given file.
 
Method Summary
 void addClustering(BootstrapClustering toAdd)
          Adds a clustering to this clusterings list.
 BootstrapClustering getClustering(int i)
          Returns the clustering at a specific index
 List<BootstrapClustering> getClusterings()
          Returns the list of clusterings contained in this collection.
 Iterator<BootstrapClustering> iterator()
          Returns an iterator of the clusterings
 void writeToFile(String outfile)
          Writes this clustering collection to a given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BootstrapClusterings

public BootstrapClusterings()
Create empty clusterings list.


BootstrapClusterings

public BootstrapClusterings(String file)
                     throws IOException
Reads a clustering collection from a given file.

Parameters:
file - file from which the clusterings will be read
Throws:
IOException - if the file could not be read
ProCopeException - if the file format is invalid

BootstrapClusterings

public BootstrapClusterings(String file,
                            boolean noRealClusterings)
                     throws IOException
Reads a clusterings collection from a given file.

Parameters:
file - file from which the clusterings will be read
noRealClusterings - if true then only the parameters and efficiencies but no actual clusterings will be loaded from the file
Throws:
IOException - if the file could not be read
ProCopeException - if the file format is invalid
Method Detail

addClustering

public void addClustering(BootstrapClustering toAdd)
Adds a clustering to this clusterings list.

Parameters:
toAdd - clustering to be added

getClusterings

public List<BootstrapClustering> getClusterings()
Returns the list of clusterings contained in this collection.

Returns:
list of clusterings

getClustering

public BootstrapClustering getClustering(int i)
Returns the clustering at a specific index

Parameters:
i - index of the clustering
Returns:
clustering at index i

iterator

public Iterator<BootstrapClustering> iterator()
Returns an iterator of the clusterings

Specified by:
iterator in interface Iterable<BootstrapClustering>

writeToFile

public void writeToFile(String outfile)
                 throws IOException
Writes this clustering collection to a given file.

Parameters:
outfile - path of the file the clusterings will be written to
Throws:
IOException - if the file could not be written
See Also:
BootstrapClusterings(String)