package data_model;
|
import java.util.Iterator;
|
import java.util.Vector;
|
import publicclass.GetNowTime;
|
public class Dell_tag {
|
static Vector<Tb_tag> tagvc=new Vector<Tb_tag>();
|
|
/** ͨ¹ý±êÇ©id»ñȡijһ¸ö±êÇ©¶ÔÏó */
|
public static Tb_tag get_tag(String tagid) {
|
Tb_tag tag = null;
|
if (tagvc.size() != 0) {
|
Iterator<Tb_tag> it = tagvc.iterator();
|
while (it.hasNext()) {
|
Tb_tag tag1 = it.next();
|
String idtag = tag1.getTagid();
|
if (tagid.equals(idtag)) {
|
tag = tag1;
|
break;
|
}
|
}
|
}
|
return tag;
|
}
|
|
public static void addtagoraler(String tagid,String anchorid,String door) {
|
Tb_tag tag =get_tag(tagid);
|
if(tag==null) {
|
tag =new Tb_tag();
|
tag.setTagid(tagid);
|
tag.setAnchorid(anchorid);
|
tag.setDoor(door);
|
tag.setTime(GetNowTime.now());
|
tagvc.add(tag);
|
}else {
|
tag.setAnchorid(anchorid);
|
tag.setDoor(door);
|
tag.setTime(GetNowTime.now());
|
}
|
}
|
|
|
public static Vector<Tb_tag> getTagvc() {
|
return tagvc;
|
}
|
}
|