|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vanetsim.scenario.KnownMessages
public class KnownMessages
This class stores various messages in multiple separate arrays:
Constructor Summary | |
---|---|
KnownMessages()
|
|
KnownMessages(Vehicle vehicle)
Constructor. |
Method Summary | |
---|---|
void |
addMessage(Message message,
boolean doExecute,
boolean doForward)
Adds a message. |
void |
checkOutdatedMessages(boolean addToOld)
Checks for outdated messages and deletes them. |
void |
clear()
Clears everything from this data structure. |
void |
deleteAllFloodingForwardMessages(boolean addToOld)
Deletes all forward messages which are in flooding/broadcast mode and optionally adds them to the old messages. |
void |
deleteAllForwardMessages(boolean addToOld)
Deletes all forward messages and optionally adds them to the old messages. |
void |
deleteForwardMessage(int position,
boolean addToOld)
Deletes a forward message and optionally adds it to the old messages. |
int |
getFailedForwardCount()
Gets the amount of messages which failed to be forwarded. |
Message[] |
getForwardMessages()
Gets all messages which shall be forwarded. |
int |
getOldMessagesSize()
Gets the amount of old messages stored. |
int |
getSize()
Gets the amount of known messages stored (=forward messages). |
boolean |
hasNewMessages()
Returns if there are news messages which need to be processed. |
void |
processMessages()
Process messages. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KnownMessages(Vehicle vehicle)
vehicle
- the vehicle this data structure belongs topublic KnownMessages()
Method Detail |
---|
public void addMessage(Message message, boolean doExecute, boolean doForward)
message
- the messagedoExecute
- true
if you want the message to be executed, else false
doForward
- true
if you want the message to be forwarded, else false
public void deleteForwardMessage(int position, boolean addToOld)
position
- the positionaddToOld
- true
to add it to the old messages, else false
public void deleteAllForwardMessages(boolean addToOld)
addToOld
- true
to add all to the old messages, else false
public void deleteAllFloodingForwardMessages(boolean addToOld)
addToOld
- true
to add the removed flooding messages to the old messages, else false
public void processMessages()
public void checkOutdatedMessages(boolean addToOld)
addToOld
- true
to add all to outdated forward messages to the old messages, else false
public Message[] getForwardMessages()
public boolean hasNewMessages()
true
if there are new messages, else false
public int getSize()
public int getOldMessagesSize()
public int getFailedForwardCount()
public void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |