T
- public abstract class DynamicScoringPreferenceAggregator<T> extends java.lang.Object implements DynamicPreferenceAggregator<T>
Modifier and Type | Field and Description |
---|---|
private java.util.ArrayList<UpdateListener<T>> |
_listeners
The list containing the update listeners
|
private WeightVector |
v
The weight vector for the aggregator given via the constructor
|
Constructor and Description |
---|
DynamicScoringPreferenceAggregator(WeightVector v)
Constructor with given weight vector
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(UpdateListener<T> listener)
adds a listener to this dynamic preference aggregator
|
PreferenceOrder<T> |
aggregate(java.util.List<PreferenceOrder<T>> input)
This method aggregates the given preference orders according to the
WeightVector used within construction
|
private void |
fireEvent(UpdateEvent<T> event)
Fires an event every time a change occurred
|
void |
removeListener(UpdateListener<T> listener)
removes a listener from this dynamic preference aggregator
|
PreferenceOrder<T> |
update(Update<T> update,
java.util.List<PreferenceOrder<T>> input)
The update-method for dynamically changing the input for preference
aggregation
|
PreferenceOrder<T> |
update(UpdateStream<T> stream,
java.util.List<PreferenceOrder<T>> input)
this method extends the update-functionality with input-streams
consisting of Update-elements
|
private WeightVector v
private java.util.ArrayList<UpdateListener<T>> _listeners
public DynamicScoringPreferenceAggregator(WeightVector v)
v
- the weight vectorpublic PreferenceOrder<T> aggregate(java.util.List<PreferenceOrder<T>> input)
aggregate
in interface DynamicPreferenceAggregator<T>
input
- the array of preference orders to be aggregatedpublic PreferenceOrder<T> update(Update<T> update, java.util.List<PreferenceOrder<T>> input) throws java.lang.IndexOutOfBoundsException, java.lang.NullPointerException
update
in interface DynamicPreferenceAggregator<T>
update
- the update element containing the changes to be appliedjava.lang.IndexOutOfBoundsException
java.lang.NullPointerException
public PreferenceOrder<T> update(UpdateStream<T> stream, java.util.List<PreferenceOrder<T>> input)
stream
- the input stream with the Update-elementsprivate void fireEvent(UpdateEvent<T> event)
event
- public void addListener(UpdateListener<T> listener)
addListener
in interface DynamicPreferenceAggregator<T>
public void removeListener(UpdateListener<T> listener)
removeListener
in interface DynamicPreferenceAggregator<T>