avatar

961

Remove the 'destination' parameter for erase.

by mrs, 21 Jun, 2009 10:10 AM
859 961  
7171     return (List<DBTimeQueue>) findAllBy(DBTimeQueue.class, null, null);
7272   }
7373 
74   public static boolean erase(Object destination, Object payload) {
74   public static boolean erase(Object payload) {
7575     List<DBTimeQueue> targets;
76     if(destination != null) {
76     Object destination = null;
77     if(false && destination != null) {
7778       String[] keys = {"destination", "payload"};
7879       String[] values = {destination.toString(), payload.toString()};
7980       targets = (List<DBTimeQueue>) findAllMulti(DBTimeQueue.class, keys, values, null);
895 961  
5151   }
5252 
5353   @Override
54   public boolean erase(Object destination, Object payload) {
55     return DBTimeQueue.erase(destination, payload);
54   public boolean erase(Object payload) {
55     return DBTimeQueue.erase(payload);
5656   }
5757 
5858   @Override
895 961  
3131   }
3232 
3333   public void remove(Object payload) {
34     mTQM.erase(null, payload);
34     mTQM.erase(payload);
3535   }
3636 
3737   public TimerHandler start() {
896 961  
9090     mTQ.addEvent(when, createCarrier(payload, destination, repeat, howmany));
9191   }
9292 
93   public boolean erase(Object destination, Object payload) {
93   public boolean erase(Object payload) {
9494     List<TimeQueue.QObject> doErase = new ArrayList<TimeQueue.QObject>();
9595     List current = mTQ.getUnsorted();
9696     boolean didErase = false;
9797     for (Iterator it = current.listIterator(); it.hasNext();) {
9898       TimeQueue.QObject tqo = (TimeQueue.QObject) it.next();
9999       TQCarrier event = (TQCarrier) tqo.getEvent();
100       if(event.getPayload() == payload) {
100       if(event.getPayload() == payload || event.getPayload().equals(payload)) {
101101         doErase.add(tqo);
102102         didErase = true;
103103       }