Class BinnableFiles


  • public class BinnableFiles
    extends Object
    Helper class for binning files.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • BinnableFiles

        public BinnableFiles()
    • Method Detail

      • toBinnableUsingIndex

        public static List<Binnable<String>> toBinnableUsingIndex​(String[] data)
                                                           throws Exception
        Turns strings into a list of binnables using the array index.
        Parameters:
        data - the strings to convert
        Returns:
        the generated list
        Throws:
        Exception - if extraction of index fails
      • toBinnableUsingIndex

        public static List<Binnable<File>> toBinnableUsingIndex​(File[] data)
                                                         throws Exception
        Turns files into a list of binnables using the array index.
        Parameters:
        data - the files to convert
        Returns:
        the generated list
        Throws:
        Exception - if extraction of index fails
      • toStringArray

        public static String[] toStringArray​(List<Binnable<String>> list)
        Turns a binnable list back into a string array.
        Parameters:
        list - the list to convert
        Returns:
        the generated array
      • toFileArray

        public static File[] toFileArray​(List<Binnable<File>> list)
        Turns a binnable list back into a file array.
        Parameters:
        list - the list to convert
        Returns:
        the generated array