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()
boolean
equals(java.lang.Object object)
Checks if two elements are equal.I
getInfoId()
Obtains the information identifier.long
getTimestamp()
Obtains the timestamp of the piece.int
hashCode()
void
setTimestamp(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:
equals
in 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:
hashCode
in classjava.lang.Object
-
clone
- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-