p_event.java
来自「RFID复杂事件处理系统的研究实验」· Java 代码 · 共 97 行
JAVA
97 行
package test2;
import java.util.LinkedList;
public class P_Event {
protected int id;
protected double timestamp;
protected char type;
protected int attribute;
boolean flag;
public int getid()
{
return id;
}
public double gettimestamp()
{
return timestamp;
}
public char gettype()
{
return type;
}
public P_Event(){}
public P_Event(int num,double t,char c)
{
id=num;
timestamp=t;
type=c;
flag=true;
}
public boolean checkearlier(double t)
{
if(timestamp<t) return true;
else return false;
}
public boolean checkIn(double t1,double t2)
{
if(timestamp>=t1&×tamp<=t2) return true;
else return false;
}
public boolean compareEarly(P_Event e)
{
if(timestamp<=e.gettimestamp()) return true;
else return false;
}
public boolean compareEarly(C_Event e)
{
if(timestamp<=e.gett_start()) return true;
else return false;
}
public boolean getFlag() {
return flag;
}
public void setFlag() {
this.flag = false;
}
public void resetFlag() {
this.flag = true;
}
public static LinkedList<P_Event> product()
{
LinkedList<P_Event> pl=new LinkedList<P_Event>();
pl.addLast(new P_Event(0,1,'A'));
pl.addLast(new P_Event(0,3,'A'));
pl.addLast(new P_Event(0,4,'B'));
pl.addLast(new P_Event(0,5,'C'));
pl.addLast(new P_Event(0,2,'B'));
pl.addLast(new P_Event(0,0,'A'));
/*pl.addLast(new P_Event(0,0,'A'));
pl.addLast(new P_Event(0,0,'A'));
pl.addLast(new P_Event(0,0,'A'));
pl.addLast(new P_Event(0,0,'A'));
pl.addLast(new P_Event(0,0,'A'));
pl.addLast(new P_Event(0,0,'A'));
pl.addLast(new P_Event(0,0,'A'));
pl.addLast(new P_Event(0,0,'A'));
pl.addLast(new P_Event(0,0,'A'));
pl.addLast(new P_Event(0,0,'A'));
pl.addLast(new P_Event(0,0,'A'));*/
return pl;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?