public class Query extends Message
currentNode, maxSteps
Constructor and Description |
---|
Query(int maxSteps,
Node node,
int queryId)
Creates a query.
|
Modifier and Type | Method and Description |
---|---|
void |
age()
ages the query one step.
|
boolean |
findRoute()
Find the shortest path for the Query to travel.
|
int |
getAge()
Returns the time the query has been alive.
|
int |
getSendTries()
Return amount of times query has been sent.
|
boolean |
move()
Move the Query one step.
|
void |
trySend()
Increments amount of times query has been tried with 1.
|
void |
update(Node n)
Sets the message handle for the Query.
|
public Query(int maxSteps, Node node, int queryId) throws java.lang.IllegalArgumentException
maxSteps
- max steps of querynode
- node wich spawned queryqueryId
- id of event to be queried.java.lang.IllegalArgumentException
- if the inputs are invalid.public boolean findRoute()
public boolean move()
public void update(Node n)
public void trySend()
public int getSendTries()
public int getAge()
public void age()