utilities
Class DescriptorsIO

java.lang.Object
  extended by utilities.DescriptorsIO

public class DescriptorsIO
extends java.lang.Object

Utility class for various Descriptor IO operations.

Author:
Eleftherios Spyromitros-Xioufis

Constructor Summary
DescriptorsIO()
           
 
Method Summary
static void binaryToText(java.lang.String descriptorsFolder, java.lang.String descriptorType, int descriptorLength)
          Takes a folder with descriptor files in binary format and converts them to text.
static void main(java.lang.String[] args)
           
static java.util.ArrayList<double[]> readBinary(java.lang.String descriptorsFileName, int descriptorLength)
          Reads descriptors from a binary file and returns them in an ArrayList.
static java.util.ArrayList<double[]> readText(java.lang.String descriptorsFileName, int descriptorLength)
          Reads descriptors from a text file and returns them in an ArrayList.
static void textToBinary(java.lang.String descriptorsFolder, java.lang.String descriptorType, int descriptorLength)
          Takes a folder with descriptor files in text format and converts them to binary.
static void writeBinary(java.lang.String descriptorsFileName, double[][] descriptors)
          Takes a two-dimensional double array with descriptors and writes them in a binary file.
static void writeText(java.lang.String descriptorsFileName, double[][] descriptors)
          Takes a two-dimensional double array with descriptors and writes them in a comma separated text file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DescriptorsIO

public DescriptorsIO()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

readBinary

public static java.util.ArrayList<double[]> readBinary(java.lang.String descriptorsFileName,
                                                       int descriptorLength)
                                                throws java.lang.Exception
Reads descriptors from a binary file and returns them in an ArrayList.

Parameters:
descriptorsFileName - The binary file containing the descriptors.
descriptorLength - The length of each descriptor.
Returns:
Throws:
java.lang.Exception

readText

public static java.util.ArrayList<double[]> readText(java.lang.String descriptorsFileName,
                                                     int descriptorLength)
                                              throws java.lang.Exception
Reads descriptors from a text file and returns them in an ArrayList.

Parameters:
descriptorsFileName - The text file containing the descriptors.
descriptorLength - The length of each descriptor.
Returns:
Throws:
java.lang.Exception

writeBinary

public static void writeBinary(java.lang.String descriptorsFileName,
                               double[][] descriptors)
                        throws java.lang.Exception
Takes a two-dimensional double array with descriptors and writes them in a binary file.

Parameters:
descriptorsFileName - The binary file's name.
descriptors - The descriptors.
Throws:
java.lang.Exception

writeText

public static void writeText(java.lang.String descriptorsFileName,
                             double[][] descriptors)
                      throws java.lang.Exception
Takes a two-dimensional double array with descriptors and writes them in a comma separated text file.

Parameters:
descriptorsFileName - The text file's name.
descriptors - The descriptors.
Throws:
java.lang.Exception

textToBinary

public static void textToBinary(java.lang.String descriptorsFolder,
                                java.lang.String descriptorType,
                                int descriptorLength)
                         throws java.lang.Exception
Takes a folder with descriptor files in text format and converts them to binary.

Parameters:
descriptorsFolder -
descriptorType -
descriptorLength -
Throws:
java.lang.Exception

binaryToText

public static void binaryToText(java.lang.String descriptorsFolder,
                                java.lang.String descriptorType,
                                int descriptorLength)
                         throws java.lang.Exception
Takes a folder with descriptor files in binary format and converts them to text.

Parameters:
descriptorsFolder -
descriptorType -
descriptorLength -
Throws:
java.lang.Exception