Package microsim.data

Class MultiKeyCoefficientMap

java.lang.Object
org.apache.commons.collections4.map.AbstractIterableMap<K,V>
org.apache.commons.collections4.map.AbstractMapDecorator<org.apache.commons.collections4.keyvalue.MultiKey<? extends K>,V>
org.apache.commons.collections4.map.MultiKeyMap
microsim.data.MultiKeyCoefficientMap
All Implemented Interfaces:
Serializable, Cloneable, Map, org.apache.commons.collections4.Get, org.apache.commons.collections4.IterableGet, org.apache.commons.collections4.IterableMap, org.apache.commons.collections4.Put

public class MultiKeyCoefficientMap extends org.apache.commons.collections4.map.MultiKeyMap
Multi key coefficient map.
Author:
Ross Richardson
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface java.util.Map

    Map.Entry<K extends Object,V extends Object>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String[]
     
    protected Map<String,Integer>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an empty new MultiKeyCoefficientMap with the names of the keys and values categories specified by String[] keys and String[] values arguments.
    MultiKeyCoefficientMap(org.apache.commons.collections4.map.AbstractHashedMap map, String[] keys, String[] values)
    Creates a new MultiKeyCoefficientMap with values stored in map, and with the names of the keys and values categories specified by String[] keys and String[] values arguments.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a deep clone copy of the MultiKeyCoefficientMap object
    This method allows the instance of the MultiKeyCoefficientMap to provide a clone of the names of the keys.
    OBTAIN VALUE BY ROW AND COLUMN REFERENCE; ASSUMES 2D TABLE
    getValue(Object... key)
     
    This method allows the instance of the MultiKeyCoefficientMap to provide a clone of the names of the values.
    void
    putValue(Object... keyValues)
     
    void
    replaceValue(Object... keyValues)
     
    static String
     

    Methods inherited from class org.apache.commons.collections4.map.MultiKeyMap

    checkKey, containsKey, containsKey, containsKey, containsKey, decorated, get, get, get, get, hash, hash, hash, hash, isEqualKey, isEqualKey, isEqualKey, isEqualKey, mapIterator, multiKeyMap, put, put, put, put, put, putAll, removeAll, removeAll, removeAll, removeAll, removeMultiKey, removeMultiKey, removeMultiKey, removeMultiKey

    Methods inherited from class org.apache.commons.collections4.map.AbstractMapDecorator

    clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, remove, size, toString, values

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • MultiKeyCoefficientMap

      public MultiKeyCoefficientMap(String[] keys, String[] values)
      Creates an empty new MultiKeyCoefficientMap with the names of the keys and values categories specified by String[] keys and String[] values arguments.
      Parameters:
      keys - - a String array listing the names of the categories of keys
      values - - a String array listing the names of the categories of values
    • MultiKeyCoefficientMap

      public MultiKeyCoefficientMap(org.apache.commons.collections4.map.AbstractHashedMap map, String[] keys, String[] values)
      Creates a new MultiKeyCoefficientMap with values stored in map, and with the names of the keys and values categories specified by String[] keys and String[] values arguments.
      Parameters:
      map - - contains the values of the MultiKeyCoefficientMap.
      keys - - a String array listing the names of the categories of keys
      values - - a String array listing the names of the categories of values
  • Method Details

    • toStringKey

      public static String toStringKey(Object value)
    • getValue

      public Object getValue(Object... key)
    • getRowColumnValue

      public Object getRowColumnValue(Object row, String col)
      OBTAIN VALUE BY ROW AND COLUMN REFERENCE; ASSUMES 2D TABLE
      Parameters:
      row -
      col -
      Returns:
    • putValue

      public void putValue(Object... keyValues)
    • replaceValue

      public void replaceValue(Object... keyValues)
    • getKeysNames

      public String[] getKeysNames()
      This method allows the instance of the MultiKeyCoefficientMap to provide a clone of the names of the keys. This is especially useful for getting the name of the variables used as keys in the Regression classes (in package microsim.statistics.regression)
      Returns:
      a String array clone of the names of the MultiKeyCoefficientMap's keys
    • getValuesNames

      public String[] getValuesNames()
      This method allows the instance of the MultiKeyCoefficientMap to provide a clone of the names of the values. This is especially useful for cases where the size of valueColumns > 1, for instance to extract the names of the Type array (T[] events) for RegressionUtils.event(T[] events, double[] prob) method (in package microsim.statistics.regression)
      Returns:
      a String array clone of the names of the MultiKeyCoefficientMap's values
    • clone

      public MultiKeyCoefficientMap clone()
      Returns a deep clone copy of the MultiKeyCoefficientMap object
      Overrides:
      clone in class org.apache.commons.collections4.map.MultiKeyMap