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
-
Constructor Summary
ConstructorDescriptionMultiKeyCoefficientMap
(@NonNull String @Nullable [] keys, @Nullable String @Nullable [] values) Creates an empty newMultiKeyCoefficientMap
with 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 newMultiKeyCoefficientMap
with 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 theMultiKeyCoefficientMap
to provide a clone of the names of the keys.@Nullable Object
Extracts the value that corresponds tokey
from the map.@NonNull String @Nullable []
This method allows an instance of theMultiKeyCoefficientMap
to provide a clone of the names of the values.void
Adds a value to the map.static @NonNull String
toStringKey
(@NonNull Object value) Convertsvalue
to 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, 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
Methods 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 newMultiKeyCoefficientMap
with the names of the keys and values categories specified byString
[]
keys andString
[]
values arguments.- Parameters:
keys
- AString
array listing the names of the categories of keys.values
- AString
array listing the names of the categories of values.- Throws:
NullPointerException
- whenkeys
or 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 newMultiKeyCoefficientMap
with 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
- AString
array listing the names of the categories of keys.values
- AString
array listing the names of the categories of values.- Throws:
NullPointerException
- whenmap
isnull
.
-
-
Method Details
-
toStringKey
Convertsvalue
to aString
.- Parameters:
value
- An object that can beString
,Double
, orBoolean
.- Returns:
- the string representation of
value
. - Throws:
NullPointerException
- whenvalue
isnull
.
-
getValue
Extracts the value that corresponds tokey
from the map.- Parameters:
key
- A key or an array of keys.- Returns:
- the value that corresponds to
key
. - Throws:
NullPointerException
- whenkey
isnull
or when it's an array containing at least onenull
object.IllegalArgumentException
- when the total number of keys inkey
exceeds 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 isnull
or containsnull
.IllegalArgumentException
- when the number of keys exceeds the limit.
-
getKeysNames
This method allows an instance of theMultiKeyCoefficientMap
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 themicrosim.statistics.regression
classes.- Returns:
- a
String
array clone of the names of theMultiKeyCoefficientMap
's keys.
-
getValuesNames
This method allows an instance of theMultiKeyCoefficientMap
to provide a clone of the names of the values.- Returns:
- a
String
array clone of the names of theMultiKeyCoefficientMap
's values
-
clone
- Overrides:
clone
in classorg.apache.commons.collections4.map.MultiKeyMap
- Returns:
- a deep clone copy of the
MultiKeyCoefficientMap
object
-