vanetsim.scenario
Class KnownRSU

java.lang.Object
  extended by vanetsim.scenario.KnownRSU

public class KnownRSU
extends java.lang.Object

A known RSU (discovered by receiving a beacon). The variables represent what is known and might differ from the real ones if it hasn't been updated for some time!


Constructor Summary
KnownRSU(RSU rsu, long ID, int x, int y, boolean isEncrypted, int time)
          Instantiates a new known RSU
 
Method Summary
 long getID()
          Gets the ID.
 int getLastUpdate()
          Gets when this RSU was last updated.
 KnownRSU getNext()
          Returns the KnownRSU after this one.
 KnownRSU getPrevious()
          Returns the KnownRSU before this one.
 RSU getRSU()
          Gets the RSU.
 int getX()
          Gets the x coordinate.
 int getY()
          Gets the y coordinate.
 boolean isEncrypted()
           
 void setEncrypted(boolean isEncrypted)
           
 void setLastUpdate(int time)
          Updates the last modification time.
 void setNext(KnownRSU next)
          Sets the KnownRSU after this one.
 void setPrevious(KnownRSU previous)
          Sets the KnownRSU before this one.
 void setX(int x)
          Updates the x coordinate.
 void setY(int y)
          Updates the y coordinate.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KnownRSU

public KnownRSU(RSU rsu,
                long ID,
                int x,
                int y,
                boolean isEncrypted,
                int time)
Instantiates a new known RSU

Parameters:
rsu - the Road-Side-Unit
ID - the ID of the RSU
x - the x coordinate
y - the y coordinate
time - the current time
isEncrypted - if RSU sends encrypted
Method Detail

setX

public void setX(int x)
Updates the x coordinate.

Parameters:
x - the x coordinate

setY

public void setY(int y)
Updates the y coordinate.

Parameters:
y - the y coordinate

setLastUpdate

public void setLastUpdate(int time)
Updates the last modification time.

Parameters:
time - the current time

getX

public int getX()
Gets the x coordinate.

Returns:
the x coordinate

getY

public int getY()
Gets the y coordinate.

Returns:
the y coordinate

getID

public long getID()
Gets the ID.

Returns:
the ID

getRSU

public RSU getRSU()
Gets the RSU.

Returns:
the Road-Side-Unit

getLastUpdate

public int getLastUpdate()
Gets when this RSU was last updated.

Returns:
the last update time in milliseconds

getNext

public KnownRSU getNext()
Returns the KnownRSU after this one.

Returns:
the next

getPrevious

public KnownRSU getPrevious()
Returns the KnownRSU before this one.

Returns:
the previous

setNext

public void setNext(KnownRSU next)
Sets the KnownRSU after this one.

Parameters:
next - the object which comes after this one

setPrevious

public void setPrevious(KnownRSU previous)
Sets the KnownRSU before this one.

Parameters:
previous - the object which comes before this one

isEncrypted

public boolean isEncrypted()

setEncrypted

public void setEncrypted(boolean isEncrypted)