org.decisiondeck.xmcda_oo.aggregators
Class ThresholdsView

java.lang.Object
  extended by org.decisiondeck.xmcda_oo.aggregators.ThresholdsView
All Implemented Interfaces:
ICriteriaWithThresholds

public class ThresholdsView
extends Object
implements ICriteriaWithThresholds


Constructor Summary
ThresholdsView(ICriteriaWithThresholds delegate)
           
ThresholdsView(ICriteriaWithThresholds delegate, Predicate<Criterion> criteriaPredicate)
           
 
Method Summary
 boolean equals(Object obj)
           
 Set<Criterion> getCriteria()
          Note that the returned set read-through this object: it reflects the criteria contained in this object.
 Double getIndifferenceThreshold(Criterion criterion)
          Retrieves the indifference threshold that has been set for the given criterion.
 Map<Criterion,Double> getIndifferenceThresholds()
          Retrieves a view of the indifference thresholds.
 Double getPreferenceThreshold(Criterion criterion)
          Retrieves the preference threshold that has been set for the given criterion.
 Map<Criterion,Double> getPreferenceThresholds()
          Retrieves a view of the preference thresholds.
 Double getVetoThreshold(Criterion criterion)
          Retrieves the veto threshold that has been set for the given criterion.
 Map<Criterion,Double> getVetoThresholds()
          Retrieves a view of the veto thresholds.
 int hashCode()
           
 boolean isEmpty()
           
 boolean setIndifferenceThreshold(Criterion criterion, Double threshold)
          Binds a threshold to the given criterion, or remove it from the criterion.
 boolean setPreferenceThreshold(Criterion criterion, Double threshold)
          Binds a preference threshold to the given criterion, or remove it from the criterion.
 boolean setVetoThreshold(Criterion criterion, Double threshold)
          Binds a threshold to the given criterion, or remove it from the criterion.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThresholdsView

public ThresholdsView(ICriteriaWithThresholds delegate,
                      Predicate<Criterion> criteriaPredicate)
Parameters:
delegate - not null.
criteriaPredicate - not null.

ThresholdsView

public ThresholdsView(ICriteriaWithThresholds delegate)
Parameters:
delegate - not null.
Method Detail

getCriteria

public Set<Criterion> getCriteria()
Description copied from interface: ICriteriaWithThresholds
Note that the returned set read-through this object: it reflects the criteria contained in this object.

Specified by:
getCriteria in interface ICriteriaWithThresholds
Returns:
a read-only view of the set of criteria contained in this object, i.e., each criterion to which at least one non null threshold value is bound.

getIndifferenceThreshold

public Double getIndifferenceThreshold(Criterion criterion)
Description copied from interface: ICriteriaWithThresholds
Retrieves the indifference threshold that has been set for the given criterion. If no indifference threshold has been specified, null is returned.

Specified by:
getIndifferenceThreshold in interface ICriteriaWithThresholds
Parameters:
criterion - not null.
Returns:
the indifference threshold or null if not set.

getPreferenceThreshold

public Double getPreferenceThreshold(Criterion criterion)
Description copied from interface: ICriteriaWithThresholds
Retrieves the preference threshold that has been set for the given criterion. If no preference threshold has been specified, null is returned.

Specified by:
getPreferenceThreshold in interface ICriteriaWithThresholds
Parameters:
criterion - not null.
Returns:
the preference threshold or null if not set.

getVetoThreshold

public Double getVetoThreshold(Criterion criterion)
Description copied from interface: ICriteriaWithThresholds
Retrieves the veto threshold that has been set for the given criterion. If no veto threshold has been specified, null is returned.

Specified by:
getVetoThreshold in interface ICriteriaWithThresholds
Parameters:
criterion - not null.
Returns:
the veto threshold or null if not set.

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface ICriteriaWithThresholds

setPreferenceThreshold

public boolean setPreferenceThreshold(Criterion criterion,
                                      Double threshold)
Description copied from interface: ICriteriaWithThresholds
Binds a preference threshold to the given criterion, or remove it from the criterion. If null, the existing preference threshold is removed if it existed.

Specified by:
setPreferenceThreshold in interface ICriteriaWithThresholds
Parameters:
criterion - not null.
threshold - if null, if a threshold was bound to the criterion, it will be removed.
Returns:
true iff the preference threshold bound to the given criterion has been changed.

setIndifferenceThreshold

public boolean setIndifferenceThreshold(Criterion criterion,
                                        Double threshold)
Description copied from interface: ICriteriaWithThresholds
Binds a threshold to the given criterion, or remove it from the criterion. If null, the existing indifference threshold is removed if it existed.

Specified by:
setIndifferenceThreshold in interface ICriteriaWithThresholds
Parameters:
criterion - not null.
threshold - if null, if a threshold was bound to the criterion, it will be removed.
Returns:
true iff the threshold bound to the given criterion has been changed.

setVetoThreshold

public boolean setVetoThreshold(Criterion criterion,
                                Double threshold)
Description copied from interface: ICriteriaWithThresholds
Binds a threshold to the given criterion, or remove it from the criterion. If null, the existing veto threshold is removed if it existed.

Specified by:
setVetoThreshold in interface ICriteriaWithThresholds
Parameters:
criterion - not null.
threshold - if null, if a threshold was bound to the criterion, it will be removed.
Returns:
true iff the threshold bound to the given criterion has been changed.

getPreferenceThresholds

public Map<Criterion,Double> getPreferenceThresholds()
Description copied from interface: ICriteriaWithThresholds
Retrieves a view of the preference thresholds. The view is read-only iff this object is read-only. Setting the returned map has the same effect as setting this object. The map does not accept null key or value.

Specified by:
getPreferenceThresholds in interface ICriteriaWithThresholds
Returns:
not null.

getIndifferenceThresholds

public Map<Criterion,Double> getIndifferenceThresholds()
Description copied from interface: ICriteriaWithThresholds
Retrieves a view of the indifference thresholds. The view is read-only iff this object is read-only. Setting the returned map has the same effect as setting this object. The map does not accept null key or value.

Specified by:
getIndifferenceThresholds in interface ICriteriaWithThresholds
Returns:
not null.

getVetoThresholds

public Map<Criterion,Double> getVetoThresholds()
Description copied from interface: ICriteriaWithThresholds
Retrieves a view of the veto thresholds. The view is read-only iff this object is read-only. Setting the returned map has the same effect as setting this object. The map does not accept null key or value.

Specified by:
getVetoThresholds in interface ICriteriaWithThresholds
Returns:
not null.

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2011. All Rights Reserved.