org.biomage.tools.helpers
Class ExternalDataCubeIOHelpers
java.lang.Object
org.biomage.tools.helpers.ExternalDataCubeIOHelpers
public class ExternalDataCubeIOHelpers
- extends java.lang.Object
Description:
Class that provides static helper metheds for writing and reading
external cube data to/from a file.
Method Summary |
static double[][][] |
readExternalDataCubeFromFile(int dim1,
int dim2,
int dim3,
java.lang.String filename)
Description:
Method for reading a text file formatted and
written by the saveExternalDataCubeToFile method. |
static void |
saveExternalDataCubeToFile(double[][][] cube,
java.lang.String filename,
boolean tmp)
Description:
Method for writing a cube of doubles to a text file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExternalDataCubeIOHelpers
public ExternalDataCubeIOHelpers()
saveExternalDataCubeToFile
public static void saveExternalDataCubeToFile(double[][][] cube,
java.lang.String filename,
boolean tmp)
- Description:
Method for writing a cube of doubles to a text file.
(Cube : three dimensional matrix)
- Parameters:
cube
- The cube of doubles to be written.filename
- The name of the file.tmp
- Boolean to indicate if file is to be treated
as a temporary file, being deleted upon exit of the
virtual machine if the file still exists.
readExternalDataCubeFromFile
public static double[][][] readExternalDataCubeFromFile(int dim1,
int dim2,
int dim3,
java.lang.String filename)
throws java.lang.Exception
- Description:
Method for reading a text file formatted and
written by the saveExternalDataCubeToFile method.
- Parameters:
dim1
- Size of first dimension of the resultdim2
- Size of second dimension of the resultdim3
- Size of third dimension of the resultfilename
- The name of the file to be loaded
- Returns:
- A cube of doubles (threedimensional matrix) with the same
values as written in the saveExternalDataCubeToFile method.
- Throws:
java.lang.Exception
- IndexOutOfBoundsException if the dimension is
different from the available data in the file.