vanetsim.scenario
Class KnownVehicle

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

public class KnownVehicle
extends java.lang.Object

A known vehicle (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
KnownVehicle(Vehicle vehicle, long ID, int x, int y, int time, double speed, boolean isEncrypted)
          Instantiates a new known vehicle.
 
Method Summary
 long getID()
          Gets the ID.
 int getLastUpdate()
          Gets when this vehicle was last updated.
 KnownVehicle getNext()
          Returns the KnownVehicle after this one.
 KnownVehicle getPrevious()
          Returns the KnownVehicle before this one.
 double getSpeed()
          Gets the speed
 Vehicle getVehicle()
          Gets the vehicle.
 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(KnownVehicle next)
          Sets the KnownVehicle after this one.
 void setPrevious(KnownVehicle previous)
          Sets the KnownVehicle before this one.
 void setSpeed(double speed)
          Updates the speed.
 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

KnownVehicle

public KnownVehicle(Vehicle vehicle,
                    long ID,
                    int x,
                    int y,
                    int time,
                    double speed,
                    boolean isEncrypted)
Instantiates a new known vehicle.

Parameters:
vehicle - the vehicle
ID - the ID of the vehicle
x - the x coordinate
y - the y coordinate
time - the current time
speed - the current speed
isEncrypted - if Beacon was 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

setSpeed

public void setSpeed(double speed)
Updates the speed.

Parameters:
speed - the current speed

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

getSpeed

public double getSpeed()
Gets the speed

Returns:
the speed

getVehicle

public Vehicle getVehicle()
Gets the vehicle.

Returns:
the vehicle

getLastUpdate

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

Returns:
the last update time in milliseconds

getNext

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

Returns:
the next

getPrevious

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

Returns:
the previous

setNext

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

Parameters:
next - the object which comes after this one

setPrevious

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

Parameters:
previous - the object which comes before this one

isEncrypted_

public boolean isEncrypted_()

setEncrypted_

public void setEncrypted_(boolean isEncrypted_)