Remove the 'destination' parameter for erase.
- M jbidwatcher/trunk/src/com/jbidwatcher/util/db/DBTimeQueue.java view
- M jbidwatcher/trunk/src/com/jbidwatcher/util/queue/DBTimeQueueManager.java view
- M jbidwatcher/trunk/src/com/jbidwatcher/util/queue/SuperQueue.java view
- M jbidwatcher/trunk/src/com/jbidwatcher/util/queue/TimeQueueManager.java view
| 859 | 961 | |
|---|---|---|
| 71 | 71 | return (List<DBTimeQueue>) findAllBy(DBTimeQueue.class, null, null); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | public static boolean erase(Object destination, Object payload) { | |
| 74 | public static boolean erase(Object payload) { | |
| 75 | 75 | List<DBTimeQueue> targets; |
| 76 | if(destination != null) { | |
| 76 | Object destination = null; | |
| 77 | if(false && destination != null) { | |
| 77 | 78 | String[] keys = {"destination", "payload"}; |
| 78 | 79 | String[] values = {destination.toString(), payload.toString()}; |
| 79 | 80 | targets = (List<DBTimeQueue>) findAllMulti(DBTimeQueue.class, keys, values, null); |
| 895 | 961 | |
|---|---|---|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | @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); | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | @Override |
| 895 | 961 | |
|---|---|---|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | public void remove(Object payload) { |
| 34 | mTQM.erase(null, payload); | |
| 34 | mTQM.erase(payload); | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | public TimerHandler start() { |
| 896 | 961 | |
|---|---|---|
| 90 | 90 | mTQ.addEvent(when, createCarrier(payload, destination, repeat, howmany)); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | public boolean erase(Object destination, Object payload) { | |
| 93 | public boolean erase(Object payload) { | |
| 94 | 94 | List<TimeQueue.QObject> doErase = new ArrayList<TimeQueue.QObject>(); |
| 95 | 95 | List current = mTQ.getUnsorted(); |
| 96 | 96 | boolean didErase = false; |
| 97 | 97 | for (Iterator it = current.listIterator(); it.hasNext();) { |
| 98 | 98 | TimeQueue.QObject tqo = (TimeQueue.QObject) it.next(); |
| 99 | 99 | TQCarrier event = (TQCarrier) tqo.getEvent(); |
| 100 | if(event.getPayload() == payload) { | |
| 100 | if(event.getPayload() == payload || event.getPayload().equals(payload)) { | |
| 101 | 101 | doErase.add(tqo); |
| 102 | 102 | didErase = true; |
| 103 | 103 | } |
