ou3
Class EventInfo

java.lang.Object
  extended by ou3.EventInfo

public class EventInfo
extends java.lang.Object

Made to contain information to be spread about events.

Author:
tfy11ebn

Field Summary
private  int eventId
          The events unique id, used to identify it.
private  int nrOfSteps
          The number of steps from the current node to the event.
private  Node previousNode
          The node which is the way from the current node towards the event.
 
Constructor Summary
EventInfo(int eventId, Node previousNode, int nrOfSteps)
          Creates an EventInfo.
 
Method Summary
 EventInfo copy()
          Returns a copy of the event info being called by this method.
 boolean equals(java.lang.Object obj)
           
 int getEventId()
          Returns the events id.
 int getNrOfSteps()
          Returns the number of steps from the origin of the event.
 Node getPreviousNode()
          Returns the path towards the origin of the event.
 int hashCode()
           
 java.lang.String toString()
          Returns a string with the contents of this EventInfo, for testing purposes.
 void update(Node previousNode, int nrOfSteps)
          Changes the path towards and the steps from the origin of the event.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

eventId

private int eventId
The events unique id, used to identify it.


previousNode

private Node previousNode
The node which is the way from the current node towards the event.


nrOfSteps

private int nrOfSteps
The number of steps from the current node to the event.

Constructor Detail

EventInfo

public EventInfo(int eventId,
                 Node previousNode,
                 int nrOfSteps)
Creates an EventInfo.

Parameters:
int - id
Position - position
int - timeCreated
Method Detail

getEventId

public int getEventId()
Returns the events id.

Returns:
int eventId

getPreviousNode

public Node getPreviousNode()
Returns the path towards the origin of the event.

Returns:
Position previousNode

getNrOfSteps

public int getNrOfSteps()
Returns the number of steps from the origin of the event.

Returns:
int nrOfSteps

update

public void update(Node previousNode,
                   int nrOfSteps)
Changes the path towards and the steps from the origin of the event.

Parameters:
Node - previousNode
int - nrOfSteps

copy

public EventInfo copy()
Returns a copy of the event info being called by this method.

Returns:
EventInfo

toString

public java.lang.String toString()
Returns a string with the contents of this EventInfo, for testing purposes.

Overrides:
toString in class java.lang.Object
Returns:
String

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object