Class Information<I>
java.lang.Object
es.uam.eps.ir.relison.diffusion.data.Information<I>
- Type Parameters:
I- type of the information id
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
PropagatedInformation
public class Information<I>
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Piece of information.
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Information(I infoId, long timestamp)Creates a basic piece of information. -
Method Summary
Modifier and Type Method Description Information<I>clone()booleanequals(java.lang.Object object)Checks if two elements are equal.IgetInfoId()Obtains the information identifier.longgetTimestamp()Obtains the timestamp of the piece.inthashCode()voidsetTimestamp(long timestamp)Modifies the timestamp of the piece.
-
Field Details
-
Constructor Details
-
Information
Creates a basic piece of information.- Parameters:
infoId- Information id.timestamp- Time of creation of the information / Time of arrival.
-
-
Method Details
-
getInfoId
Obtains the information identifier.- Returns:
- The identifier of the information.
-
getTimestamp
public long getTimestamp()Obtains the timestamp of the piece.- Returns:
- The timestamp.
-
setTimestamp
public void setTimestamp(long timestamp)Modifies the timestamp of the piece.- Parameters:
timestamp- the new timestamp.
-
equals
public boolean equals(java.lang.Object object)Checks if two elements are equal. It only compares the information piece identifier.- Overrides:
equalsin classjava.lang.Object- Parameters:
object- the object to check equality with.- Returns:
- true if the object is an information piece and the ids are equal, false if not.
-
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
-
clone
- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-