Class LookUpHelper


  • public class LookUpHelper
    extends Object
    Helper class for LookUp related stuff.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • LookUpHelper

        public LookUpHelper()
    • Method Detail

      • newTable

        public static HashMap<String,​Object> newTable()
        Returns an empty new lookup table.
        Returns:
        the empty lookup
      • newTable

        public static HashMap<String,​Object> newTable​(int initialCapacity)
        Returns an empty new lookup table.
        Parameters:
        initialCapacity - the initial capacity for the map
        Returns:
        the empty lookup
      • load

        public static HashMap<String,​Object> load​(SpreadSheet sheet,
                                                        String key,
                                                        String value,
                                                        boolean useNative,
                                                        StringBuilder error)
        Generates a lookup table from the given spreadsheet.
        Parameters:
        sheet - the spreadsheet to use
        key - the key column (or 1-based index)
        value - the value column (or 1-based index)
        useNative - whether to use native objects or just string representation
        error - for storing error messages
        Returns:
        the lookup table, null in case of an error
      • load

        public static HashMap<String,​Object> load​(int initialCap,
                                                        SpreadSheet sheet,
                                                        String key,
                                                        String value,
                                                        boolean useNative,
                                                        StringBuilder error)
        Generates a lookup table from the given spreadsheet.
        Parameters:
        initialCap - the initial capacity to use for the lookup table, <= 0 for default
        sheet - the spreadsheet to use
        key - the key column (or 1-based index)
        value - the value column (or 1-based index)
        useNative - whether to use native objects or just string representation
        error - for storing error messages
        Returns:
        the lookup table, null in case of an error