Class DatasetHelper


  • public class DatasetHelper
    extends Object
    Helper class for dealing with datasets.
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • DatasetHelper

        public DatasetHelper()
    • Method Detail

      • hasDataChanged

        public static boolean hasDataChanged​(List<String> newDatasets,
                                             ComboBoxModel<String> currentModel)
        Checks whether the data has changed and the model needs updating.
        Parameters:
        newDatasets - the new list of datasets
        currentModel - the current model
        Returns:
        true if changed
      • indexOfDataset

        public static int indexOfDataset​(List<DataContainer> conts,
                                         String oldDataset)
        Determines the index of the old dataset name in the current dataset model.
        Parameters:
        conts - the list of data containers to use
        oldDataset - the old dataset to look for
        Returns:
        the index, -1 if not found
      • generateDatasetList

        public static List<String> generateDatasetList​(List<DataContainer> conts)
        Generates the list of datasets for a combobox.
        Parameters:
        conts - the list of data containers to use
        Returns:
        the list