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

    Fields 
    Modifier and Type Field Description
    private java.util.Set<java.lang.Integer> creators
    Creators of the information / Users that have made this information arrive to a given user.
    private int times
    Number of times the information has arrived to an user.
  • 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
    PropagatedInformation clone()  
    java.util.Set<java.lang.Integer> getCreators()
    Obtains the list of propagators.
    int getTimes()
    Obtains the number of times this information has arrived to the user.
    void setCreator​(java.util.List<java.lang.Integer> creators)
    Sets the list of propagators.
    void setTimes​(int times)
    Modifies the set of times a piece of information has arrived to the user.
    PropagatedInformation update​(PropagatedInformation info)
    Updates the propagated information.

    Methods inherited from class es.uam.eps.ir.relison.diffusion.data.Information

    equals, getInfoId, getTimestamp, hashCode, setTimestamp

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • creators

      private java.util.Set<java.lang.Integer> creators
      Creators of the information / Users that have made this information arrive to a given user.
    • times

      private int times
      Number of times the information has arrived to an user.
  • 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

      public PropagatedInformation clone() throws java.lang.CloneNotSupportedException
      Overrides:
      clone in class Information<java.lang.Integer>
      Throws:
      java.lang.CloneNotSupportedException