Class MergerUpdateMechanism
java.lang.Object
es.uam.eps.ir.relison.diffusion.update.MergerUpdateMechanism
- All Implemented Interfaces:
UpdateMechanism
public class MergerUpdateMechanism extends java.lang.Object implements UpdateMechanism
Updates the previously received elements with information obtained from the new ones.
Merges both pieces of propagated information.
-
Constructor Summary
Constructors Constructor Description MergerUpdateMechanism()
-
Method Summary
Modifier and Type Method Description PropagatedInformation
updateDiscarded(PropagatedInformation oldInfo, PropagatedInformation newInfo)
Updates a piece of information which was previously discarded.PropagatedInformation
updateSeen(PropagatedInformation oldInfo, PropagatedInformation newInfo)
Updates a piece of information which has been newly seen.
-
Constructor Details
-
MergerUpdateMechanism
public MergerUpdateMechanism()
-
-
Method Details
-
updateSeen
public PropagatedInformation updateSeen(PropagatedInformation oldInfo, PropagatedInformation newInfo)Description copied from interface:UpdateMechanism
Updates a piece of information which has been newly seen.- Specified by:
updateSeen
in interfaceUpdateMechanism
- Parameters:
oldInfo
- piece of information with old info.newInfo
- piece of information with new info.- Returns:
- the updated piece of information.
-
updateDiscarded
public PropagatedInformation updateDiscarded(PropagatedInformation oldInfo, PropagatedInformation newInfo)Description copied from interface:UpdateMechanism
Updates a piece of information which was previously discarded.- Specified by:
updateDiscarded
in interfaceUpdateMechanism
- Parameters:
oldInfo
- piece of information with the discarded info.newInfo
- piece of information with the new info.- Returns:
- the updated piece of information.
-