org.decisiondeck.xmcda_oo.structure
Class Criterion

java.lang.Object
  extended by org.decisiondeck.xmcda_oo.structure.Criterion
All Implemented Interfaces:
Comparable<Criterion>

public class Criterion
extends Object
implements Comparable<Criterion>

A criterion object. Has a unique id (not null) and possibly an indication of whether it should be maximized or minimized.

A criterion may also represent an attribute, the difference is simply whether it has a preference direction. And after all, the preference direction should be removed from the criterion, thus it really should be taken as representing either an attribute or a criterion depending on the context. An advantage is that a matrix of evaluation of alternatives against criteria may also be used to represent evaluations of alternatives against attributes. The difference exists when more context is known.

Objects of this type are immutable.

A criterion equals(Object) an other one iff they have the same id.


Nested Class Summary
static class Criterion.PreferenceDirection
           
 
Constructor Summary
Criterion(Criterion criterion)
          Creates a new criterion by copying the one given.
Criterion(String id)
           
Criterion(String id, Criterion.PreferenceDirection dir)
           
 
Method Summary
 int compareTo(Criterion o)
           
 boolean equals(Object obj)
           
 String getId()
           
 Criterion.PreferenceDirection getPreferenceDirection()
          Indicates whether this criterion should be maximized (i.e. the values associated with it are set such that the higher, the better) or minimized (or if this information is not known).
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Criterion

public Criterion(String id)
Parameters:
id - not null.

Criterion

public Criterion(Criterion criterion)
Creates a new criterion by copying the one given.

Parameters:
criterion - not null.

Criterion

public Criterion(String id,
                 Criterion.PreferenceDirection dir)
Parameters:
id - not null.
dir - not null.
Method Detail

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getId

public String getId()

getPreferenceDirection

public Criterion.PreferenceDirection getPreferenceDirection()
Indicates whether this criterion should be maximized (i.e. the values associated with it are set such that the higher, the better) or minimized (or if this information is not known).

Returns:
May be Criterion.PreferenceDirection.UNKNOWN, but not null.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(Criterion o)
Specified by:
compareTo in interface Comparable<Criterion>


Copyright © 2011. All Rights Reserved.