Class PropagatedInformation
java.lang.Object
es.uam.eps.ir.relison.diffusion.data.Information<java.lang.Integer>
es.uam.eps.ir.relison.diffusion.data.PropagatedInformation
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class PropagatedInformation extends Information<java.lang.Integer> implements java.io.Serializable, java.lang.Cloneable
Class that represents the propagated information in a simulation.
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description PropagatedInformation(java.lang.Integer infoId, long timestamp, int creator)Propagated information constructor.PropagatedInformation(java.lang.Integer infoId, long timestamp, int[] creators)Constructor.PropagatedInformation(java.lang.Integer infoId, long timestamp, java.util.Collection<java.lang.Integer> creators)Constructor. -
Method Summary
Modifier and Type Method Description PropagatedInformationclone()java.util.Set<java.lang.Integer>getCreators()Obtains the list of propagators.intgetTimes()Obtains the number of times this information has arrived to the user.voidsetCreator(java.util.List<java.lang.Integer> creators)Sets the list of propagators.voidsetTimes(int times)Modifies the set of times a piece of information has arrived to the user.PropagatedInformationupdate(PropagatedInformation info)Updates the propagated information.Methods inherited from class es.uam.eps.ir.relison.diffusion.data.Information
equals, getInfoId, getTimestamp, hashCode, setTimestamp
-
Field Details
-
Constructor Details
-
PropagatedInformation
public PropagatedInformation(java.lang.Integer infoId, long timestamp, int creator)Propagated information constructor.- Parameters:
infoId- The identifier of the original piece of information.timestamp- The time of arrival of this piece.creator- The user that propagated this in last place.
-
PropagatedInformation
public PropagatedInformation(java.lang.Integer infoId, long timestamp, int[] creators)Constructor.- Parameters:
infoId- Identifier of the information.timestamp- Time of arrival.creators- Array containing the id. of the users that propagated this in last place.
-
PropagatedInformation
public PropagatedInformation(java.lang.Integer infoId, long timestamp, java.util.Collection<java.lang.Integer> creators)Constructor.- Parameters:
infoId- Identifier of the information.timestamp- Time of the arrival.creators- List containing the id. of the user that propagated this in last place.
-
-
Method Details
-
update
Updates the propagated information.- Parameters:
info- new data.- Returns:
- the updated propagated information.
-
getCreators
public java.util.Set<java.lang.Integer> getCreators()Obtains the list of propagators.- Returns:
- The list of users that propagated this info in last place.
-
setCreator
public void setCreator(java.util.List<java.lang.Integer> creators)Sets the list of propagators.- Parameters:
creators- The new list.
-
getTimes
public int getTimes()Obtains the number of times this information has arrived to the user.- Returns:
- the number of times this information has arrived to the user.
-
setTimes
public void setTimes(int times)Modifies the set of times a piece of information has arrived to the user.- Parameters:
times- The number of times a piece of information has arrived to the user.
-
clone
- Overrides:
clonein classInformation<java.lang.Integer>- Throws:
java.lang.CloneNotSupportedException
-