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
This class is an implementation of a
Map that has multiple keys and multiple values at the same
time.- See Also:
-
Nested Class Summary
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMultiKeyCoefficientMap(@NonNull String @Nullable [] keys, @Nullable String @Nullable [] values) Creates an empty newMultiKeyCoefficientMapwith the names of the keys and values categories specified byString[]keys andString[]values arguments.MultiKeyCoefficientMap(@NonNull org.apache.commons.collections4.map.AbstractHashedMap map, @NonNull String @Nullable [] keys, @Nullable String @Nullable [] values) Creates a newMultiKeyCoefficientMapwith values stored in map, and with the names of the keys and values categories specified byString[]keys andString[]values arguments. -
Method Summary
Modifier and TypeMethodDescriptionclone()@NonNull String @Nullable []This method allows an instance of theMultiKeyCoefficientMapto provide a clone of the names of the keys.@Nullable ObjectExtracts the value that corresponds tokeyfrom the map.@NonNull String @Nullable []This method allows an instance of theMultiKeyCoefficientMapto provide a clone of the names of the values.voidAdds a value to the map.static @NonNull StringtoStringKey(@NonNull Object value) Convertsvalueto aString.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, removeMultiKeyMethods inherited from class org.apache.commons.collections4.map.AbstractMapDecorator
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, remove, size, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
keys
-
valuesMap
-
-
Constructor Details
-
MultiKeyCoefficientMap
public MultiKeyCoefficientMap(@NonNull @NonNull String @Nullable [] keys, @Nullable @Nullable String @Nullable [] values) Creates an empty newMultiKeyCoefficientMapwith the names of the keys and values categories specified byString[]keys andString[]values arguments.- Parameters:
keys- AStringarray listing the names of the categories of keys.values- AStringarray listing the names of the categories of values.- Throws:
NullPointerException- whenkeysor any of its elements is0.
-
MultiKeyCoefficientMap
public MultiKeyCoefficientMap(@NonNull @NonNull org.apache.commons.collections4.map.AbstractHashedMap map, @NonNull @NonNull String @Nullable [] keys, @Nullable @Nullable String @Nullable [] values) Creates a newMultiKeyCoefficientMapwith values stored in map, and with the names of the keys and values categories specified byString[]keys andString[]values arguments.- Parameters:
map- Contains the values of the MultiKeyCoefficientMap.keys- AStringarray listing the names of the categories of keys.values- AStringarray listing the names of the categories of values.- Throws:
NullPointerException- whenmapisnull.
-
-
Method Details
-
toStringKey
Convertsvalueto aString.- Parameters:
value- An object that can beString,Double, orBoolean.- Returns:
- the string representation of
value. - Throws:
NullPointerException- whenvalueisnull.
-
getValue
Extracts the value that corresponds tokeyfrom the map.- Parameters:
key- A key or an array of keys.- Returns:
- the value that corresponds to
key. - Throws:
NullPointerException- whenkeyisnullor when it's an array containing at least onenullobject.IllegalArgumentException- when the total number of keys inkeyexceeds a certain threshold.
-
putValue
Adds a value to the map.- Parameters:
keyValues- A single key or an array or keys.- Throws:
NullPointerException- when the input isnullor containsnull.IllegalArgumentException- when the number of keys exceeds the limit.
-
getKeysNames
This method allows an instance of theMultiKeyCoefficientMapto provide a clone of the names of the keys. This is especially useful for getting the name of the variables used as keys in themicrosim.statistics.regressionclasses.- Returns:
- a
Stringarray clone of the names of theMultiKeyCoefficientMap's keys.
-
getValuesNames
This method allows an instance of theMultiKeyCoefficientMapto provide a clone of the names of the values.- Returns:
- a
Stringarray clone of the names of theMultiKeyCoefficientMap's values
-
clone
- Overrides:
clonein classorg.apache.commons.collections4.map.MultiKeyMap- Returns:
- a deep clone copy of the
MultiKeyCoefficientMapobject
-