org.decisiondeck.xmcda_oo.aggregators
Interface ICriteriaWithThresholds

All Known Implementing Classes:
Thresholds, ThresholdsView

public interface ICriteriaWithThresholds

Note that objects implementing this interface may be read-only, in which case the methods permitting to modify this object's state will throw UnsupportedOperationException when invoked.

NB no need to accept null thresholds. The only reason is to have criteria without thresholds, but would be better to separate the thresholds data and the criteria data.


Method Summary
 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.
 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.
 

Method Detail

getCriteria

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

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.

isEmpty

boolean isEmpty()

setVetoThreshold

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

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.

getIndifferenceThreshold

Double getIndifferenceThreshold(Criterion criterion)
Retrieves the indifference threshold that has been set for the given criterion. If no indifference threshold has been specified, null is returned.

Parameters:
criterion - not null.
Returns:
the indifference threshold or null if not set.

getVetoThreshold

Double getVetoThreshold(Criterion criterion)
Retrieves the veto threshold that has been set for the given criterion. If no veto threshold has been specified, null is returned.

Parameters:
criterion - not null.
Returns:
the veto threshold or null if not set.

getPreferenceThreshold

Double getPreferenceThreshold(Criterion criterion)
Retrieves the preference threshold that has been set for the given criterion. If no preference threshold has been specified, null is returned.

Parameters:
criterion - not null.
Returns:
the preference threshold or null if not set.

setPreferenceThreshold

boolean setPreferenceThreshold(Criterion criterion,
                               Double threshold)
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.

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

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

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.

getVetoThresholds

Map<Criterion,Double> getVetoThresholds()
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.

Returns:
not null.

getIndifferenceThresholds

Map<Criterion,Double> getIndifferenceThresholds()
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.

Returns:
not null.

getPreferenceThresholds

Map<Criterion,Double> getPreferenceThresholds()
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.

Returns:
not null.


Copyright © 2011. All Rights Reserved.