public class Matrix<DIMENSION,VALUE_TYPE> extends LinkedHashMap<Coord<DIMENSION,DIMENSION>,QualifiedValues<VALUE_TYPE>> implements HasDescription, CommonAttributes, Serializable
QualifiedValues as cells' values.
This implementation of Map does not allow null values for keys or values.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
Matrix() |
| Modifier and Type | Method and Description |
|---|---|
<U> void |
checkConversion(Class<U> clazz) |
<U> Matrix<DIMENSION,U> |
convertTo(Class<U> clazz)
Converts the matrix' values to the specified type.
|
QualifiedValues<VALUE_TYPE> |
get(DIMENSION row,
DIMENSION column) |
Type[] |
getCellsType()
Returns the cells' type of a non-empty,
homogeneous matrix |
Set<Type[]> |
getCellsTypes()
Returns the types used in this matrix' cells.
|
Set<DIMENSION> |
getColumns() |
Description |
getDescription() |
Set<DIMENSION> |
getRows() |
Scale |
getValuation() |
Set<Type> |
getValuesTypes()
Returns the types of the values contained in the matrix.
|
boolean |
hasMissingValues()
Returns
true if there is at least one undefined cell. |
String |
id() |
boolean |
isHomogeneous()
Returns
true if this matrix is homogeneous in term of types of its cells' values. |
boolean |
isHomogeneous(List<Type[]> types)
Returns
true if this matrix is homogeneous in term of types of its cells' values. |
boolean |
isNumeric()
A performance table is said to be numeric if all its values are numeric
|
boolean |
isSimple()
Returns
true if none of its cells has more than one value. |
String |
mcdaConcept() |
String |
name() |
QualifiedValues<VALUE_TYPE> |
put(Coord<DIMENSION,DIMENSION> key,
QualifiedValues<VALUE_TYPE> value)
Maps the specified
key to the specified value. |
void |
put(DIMENSION row,
DIMENSION column,
QualifiedValue<VALUE_TYPE> qvalue) |
void |
put(DIMENSION row,
DIMENSION column,
QualifiedValues<VALUE_TYPE> qvalues) |
void |
put(DIMENSION row,
DIMENSION column,
VALUE_TYPE value) |
void |
putAll(Map<? extends Coord<DIMENSION,DIMENSION>,? extends QualifiedValues<VALUE_TYPE>> m) |
QualifiedValues<VALUE_TYPE> |
putIfAbsent(Coord<DIMENSION,DIMENSION> key,
QualifiedValues<VALUE_TYPE> value)
If the specified key is not already associated with a value, associates it with the given value and returns null, else returns the current value.
|
void |
setDescription(Description description) |
void |
setId(String id) |
void |
setMcdaConcept(String mcdaConcept) |
void |
setName(String name) |
void |
setValuation(Scale valuation) |
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, remove, remove, replace, replace, sizeequals, hashCode, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, remove, remove, replace, replace, sizeprotected Scale valuation
public Scale getValuation()
public void setValuation(Scale valuation)
valuation - the valuation to setpublic QualifiedValues<VALUE_TYPE> get(DIMENSION row, DIMENSION column)
public void put(DIMENSION row, DIMENSION column, QualifiedValues<VALUE_TYPE> qvalues)
public void put(DIMENSION row, DIMENSION column, QualifiedValue<VALUE_TYPE> qvalue)
public void put(DIMENSION row, DIMENSION column, VALUE_TYPE value)
public boolean isNumeric()
public <U> void checkConversion(Class<U> clazz) throws ValueConverters.ConversionException
public Set<Type[]> getCellsTypes()
QualifiedValues which contains one or more values. ThegetValuesTypes()public Set<Type> getValuesTypes()
getCellsTypes()public Type[] getCellsType()
homogeneous matrixHashMap.isEmpty(),
isHomogeneous()public boolean hasMissingValues()
true if there is at least one undefined cell. More formally, returns ture if there
exists a row r and a column c for which this.containsKey(new Coord(r,c))==falsetrue if at least a cell in the matrix is undefined.public boolean isHomogeneous()
true if this matrix is homogeneous in term of types of its cells' values. More formally, it
returns true if and only if the set of its cells' types has exactly one
element. In particular, an empty matrix is not homogeneous.true if the matrix is not empty and the cells have all the same set of types.getCellsTypes(),
HashMap.isEmpty(),
#isHomogeneous(Set),
isSimple()public boolean isHomogeneous(List<Type[]> types)
true if this matrix is homogeneous in term of types of its cells' values. More formally, it
returns true if and only if the set of its cells' types has exactly one
element. In particular, an empty matrix is not homogeneous.cell's types are added to the provided list.types - the list into which the cells' types are added. It may be null.true if the cells have all the same set of types.getCellsTypes(),
HashMap.isEmpty(),
isHomogeneous(),
isSimple()public boolean isSimple()
true if none of its cells has more than one value.true if every cell has only one valueHashMap.isEmpty(),
isHomogeneous(),
isSimple()public <U> Matrix<DIMENSION,U> convertTo(Class<U> clazz) throws ValueConverters.ConversionException
ConversionException is raised, and the values are left untouched.U - class of the converted valuesclazz - the expected class of the converted valuesValueConverters.ConversionException - if at least one element cannot be converted; in this case, the values are left
unmodified.public String id()
id in interface CommonAttributespublic void setId(String id)
setId in interface CommonAttributespublic String name()
name in interface CommonAttributespublic String mcdaConcept()
mcdaConcept in interface CommonAttributespublic void setName(String name)
setName in interface CommonAttributespublic void setMcdaConcept(String mcdaConcept)
setMcdaConcept in interface CommonAttributespublic void setDescription(Description description)
setDescription in interface HasDescriptionpublic Description getDescription()
getDescription in interface HasDescriptionpublic QualifiedValues<VALUE_TYPE> put(Coord<DIMENSION,DIMENSION> key, QualifiedValues<VALUE_TYPE> value)
key to the specified value. Neither the key nor the value can be
null.
The value can be retrieved by calling the get method with a key that is equal to the original key.
put in interface Map<Coord<DIMENSION,DIMENSION>,QualifiedValues<VALUE_TYPE>>put in class HashMap<Coord<DIMENSION,DIMENSION>,QualifiedValues<VALUE_TYPE>>NullPointerException - if the key or value is nullpublic void putAll(Map<? extends Coord<DIMENSION,DIMENSION>,? extends QualifiedValues<VALUE_TYPE>> m)
putAll in interface Map<Coord<DIMENSION,DIMENSION>,QualifiedValues<VALUE_TYPE>>putAll in class HashMap<Coord<DIMENSION,DIMENSION>,QualifiedValues<VALUE_TYPE>>NullPointerException - if the specified map is null, or if one or its key or value is
null.public QualifiedValues<VALUE_TYPE> putIfAbsent(Coord<DIMENSION,DIMENSION> key, QualifiedValues<VALUE_TYPE> value)
putIfAbsent in interface Map<Coord<DIMENSION,DIMENSION>,QualifiedValues<VALUE_TYPE>>putIfAbsent in class HashMap<Coord<DIMENSION,DIMENSION>,QualifiedValues<VALUE_TYPE>>NullPointerException - if the key or value is nullCopyright © 2013–2021 Sébastien Bigaret, Patrick Meyer. All rights reserved.