forked from MattWoelk/DirectedDiffusion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExpDataSend.java
51 lines (44 loc) · 1.1 KB
/
ExpDataSend.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import java.util.Timer;
import java.util.TimerTask;
public class ExpDataSend
{
Timer m_timer=null;
public ExpDataSend(long a_interval, Node a_node, Interest a_interest)
{
if(checkInterest(a_node, a_interest))//If true set the interval for sending Exploratory Data
{
m_timer = new Timer();
m_timer.schedule(new ExpDataSendTimer(a_node), a_interval);//Considering interval sent is long
}
else//If the interest message doesn't match then stop the timer.
{
if(m_timer!=null)
m_timer.cancel();
}
}
public boolean checkInterest(Node a_node, Interest a_interest)
{
if(a_node.getID()==a_interest.getValue())
return true;
return false;
}
public void EDSendFlag()
{
}
class ExpDataSendTimer extends TimerTask
{
Node m_Node;
public ExpDataSendTimer(Node a_Node)
{
m_Node = a_Node;
}
public void run() {
System.out.println("Sending Exploratory Data!");
EDReceive m_Receive = new EDReceive();
m_Receive.addSender(m_Node.getID());//Adding sender information
}
}
public void run()
{
}
}