org.decisiondeck.xmcda_oo.structure
Class EvaluationsByRows

java.lang.Object
  extended by org.decisiondeck.xmcda_oo.structure.EvaluationsByRows
All Implemented Interfaces:
IEvaluations, IFloatMatrix<Alternative,Criterion>, IRdEvaluations, IRdFloatMatrix<Alternative,Criterion>

public class EvaluationsByRows
extends Object
implements IEvaluations


Constructor Summary
EvaluationsByRows()
           
 
Method Summary
 boolean approxEquals(IRdFloatMatrix<Alternative,Criterion> m2, double imprecision)
          Two matrix are "approximately equal" to a given degree of precision iff they contain values for the same mappings and the value they contain for each mapping are not more different than the given allowed imprecision.
 boolean contains(AlternativeEvaluations evaluations)
           
 IZeroToOneMatrix<Alternative,Criterion> getAsFuzzy()
          Produces a fuzzy matrix view of this matrix.
 Set<Criterion> getColumns()
          Returns a read-only view of the columns existing in this matrix.
 Double getEntry(Alternative row, Criterion column)
          Returns the value at the position composed by the given row and column, or null if there is none.
 Set<Alternative> getRows()
          Returns a view of the rows existing in this matrix.
 int getValueCount()
           Gets the number of values in this matrix.
 boolean isComplete()
           A matrix is complete iff it contains a value for every possible position (row, column) where row and column are rows and columns existing in this matrix (i.e. corresponding to at least one value).
 boolean isEmpty()
          Checks whether this matrix contains no value.
 boolean isFuzzy()
          Tells whether this matrix may be converted to a fuzzy matrix.
 void put(Alternative row, AlternativeEvaluations evaluations)
           
 void put(Alternative row, Criterion column, double value)
          Puts a value in this matrix at the position specified by the given row and column.
 Double remove(Alternative row, Criterion column)
          Remove the value in this matrix at the position specified by the given row and column.
 Collection<AlternativeEvaluations> values()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.decisiondeck.xmcda_oo.utils.matrix.IRdFloatMatrix
equals
 

Constructor Detail

EvaluationsByRows

public EvaluationsByRows()
Method Detail

values

public Collection<AlternativeEvaluations> values()

contains

public boolean contains(AlternativeEvaluations evaluations)

put

public void put(Alternative row,
                AlternativeEvaluations evaluations)

getAsFuzzy

public IZeroToOneMatrix<Alternative,Criterion> getAsFuzzy()
Description copied from interface: IFloatMatrix
Produces a fuzzy matrix view of this matrix. Note that if that call returns a fuzzy view, this matrix may not be used any more afterwards to put non-fuzzy values as this would break the underlying fuzzy matrix's contract.

Specified by:
getAsFuzzy in interface IFloatMatrix<Alternative,Criterion>
Returns:
a fuzzy matrix containing the same values as this matrix, and reflecting changes in this matrix, or null if this matrix cannot be converted to a fuzzy matrix.

isFuzzy

public boolean isFuzzy()
Description copied from interface: IFloatMatrix
Tells whether this matrix may be converted to a fuzzy matrix.

Specified by:
isFuzzy in interface IFloatMatrix<Alternative,Criterion>
Returns:
true iff all the values contained in this matrix are between zero and one.

put

public void put(Alternative row,
                Criterion column,
                double value)
Description copied from interface: IFloatMatrix
Puts a value in this matrix at the position specified by the given row and column.

Specified by:
put in interface IFloatMatrix<Alternative,Criterion>
Parameters:
row - not null.
column - not null.
value - any double.

remove

public Double remove(Alternative row,
                     Criterion column)
Description copied from interface: IFloatMatrix
Remove the value in this matrix at the position specified by the given row and column. If there was no value at that position, this method has no effect.

Specified by:
remove in interface IFloatMatrix<Alternative,Criterion>
Parameters:
row - not null.
column - not null.
Returns:
the value which was previously at the given position. Returns null iff there was no value at that position (and, hence, nothing was removed).

approxEquals

public boolean approxEquals(IRdFloatMatrix<Alternative,Criterion> m2,
                            double imprecision)
Description copied from interface: IRdFloatMatrix
Two matrix are "approximately equal" to a given degree of precision iff they contain values for the same mappings and the value they contain for each mapping are not more different than the given allowed imprecision.

Specified by:
approxEquals in interface IRdFloatMatrix<Alternative,Criterion>
Parameters:
m2 - the matrix to which to compare this object for approximate equality. If null, this method returns false.
imprecision - the maximal imprecision allowed.
Returns:
true iff the given matrix is approximately equal to this one.

getColumns

public Set<Criterion> getColumns()
Description copied from interface: IRdFloatMatrix
Returns a read-only view of the columns existing in this matrix. The returned set "read through" to the matrix, thus modifications of this matrix are reflected in the returned set.

Specified by:
getColumns in interface IRdFloatMatrix<Alternative,Criterion>
Returns:
the objects such that at least one value exists in this matrix at a position having the object as column. Not null. Empty iff this matrix is empty.

getEntry

public Double getEntry(Alternative row,
                       Criterion column)
Description copied from interface: IRdFloatMatrix
Returns the value at the position composed by the given row and column, or null if there is none.

Specified by:
getEntry in interface IRdFloatMatrix<Alternative,Criterion>
Parameters:
row - not null.
column - not null.
Returns:
the double value at that position, or null.

getRows

public Set<Alternative> getRows()
Description copied from interface: IRdFloatMatrix
Returns a view of the rows existing in this matrix. The returned set "read through" to the matrix, thus modifications of this matrix are reflected in the returned set. The view may be read-only (some objects may also support objects removal from the returned set).

Specified by:
getRows in interface IRdFloatMatrix<Alternative,Criterion>
Returns:
the objects such that at least one value exists in this matrix at a position having the object as row. Not null. Empty iff this matrix is empty.

getValueCount

public int getValueCount()
Description copied from interface: IRdFloatMatrix

Gets the number of values in this matrix.

Note that the word "size" is not used here because the size of the matrix could be understood as meaning its row count times its column count, which is the same as its value count only if it is complete.

Specified by:
getValueCount in interface IRdFloatMatrix<Alternative,Criterion>
Returns:
the count of values.

isComplete

public boolean isComplete()
Description copied from interface: IRdFloatMatrix

A matrix is complete iff it contains a value for every possible position (row, column) where row and column are rows and columns existing in this matrix (i.e. corresponding to at least one value). An empty matrix is complete.

Specified by:
isComplete in interface IRdFloatMatrix<Alternative,Criterion>
Returns:
true iff this matrix is complete.

isEmpty

public boolean isEmpty()
Description copied from interface: IRdFloatMatrix
Checks whether this matrix contains no value.

Specified by:
isEmpty in interface IRdFloatMatrix<Alternative,Criterion>
Returns:
true iff the matrix contains no value.


Copyright © 2011. All Rights Reserved.