/** * Cancels the item in the queue. If the item is scheduled more than once, * cancels the first occurrence. * * @return true if the project was indeed in the queue and was removed. * false if this was no-op. */ public synchronized boolean cancel(Task p) { LOGGER.fine("Cancelling " + p.getFullDisplayName()); for (Iterator<WaitingItem> itr = waitingList.iterator(); itr.hasNext();) { Item item = itr.next(); if (item.task.equals(p)) { itr.remove(); item.onCancelled(); return true; } } // use bitwise-OR to make sure that both branches get evaluated all the time return blockedProjects.cancel(p) != null | buildables.cancel(p) != null; }
/** * Cancels the item in the queue. If the item is scheduled more than once, cancels the first occurrence. * * @return true if the project was indeed in the queue and was removed. * false if this was no-op. */ public synchronized boolean cancel(Task p) { LOGGER.fine("Cancelling " + p.getFullDisplayName()); for (Iterator<WaitingItem> itr = waitingList.iterator(); itr.hasNext();) { Item item = itr.next(); if (item.task.equals(p)) { itr.remove(); item.onCancelled(); return true; } } // use bitwise-OR to make sure that both branches get evaluated all the time return blockedProjects.cancel(p)!=null | buildables.cancel(p)!=null; }
/** * Cancels the item in the queue. If the item is scheduled more than once, cancels the first occurrence. * * @return true if the project was indeed in the queue and was removed. * false if this was no-op. */ public synchronized boolean cancel(Task p) { LOGGER.fine("Cancelling " + p.getFullDisplayName()); for (Iterator<WaitingItem> itr = waitingList.iterator(); itr.hasNext();) { Item item = itr.next(); if (item.task.equals(p)) { itr.remove(); item.onCancelled(); return true; } } // use bitwise-OR to make sure that both branches get evaluated all the time return blockedProjects.cancel(p)!=null | buildables.cancel(p)!=null; }
/** * Cancels the item in the queue. If the item is scheduled more than once, cancels the first occurrence. * * @return true if the project was indeed in the queue and was removed. * false if this was no-op. */ public synchronized boolean cancel(Task p) { LOGGER.fine("Cancelling " + p.getFullDisplayName()); for (Iterator<WaitingItem> itr = waitingList.iterator(); itr.hasNext();) { Item item = itr.next(); if (item.task.equals(p)) { itr.remove(); item.onCancelled(); return true; } } // use bitwise-OR to make sure that both branches get evaluated all the time return blockedProjects.cancel(p)!=null | buildables.cancel(p)!=null; }
/** * Works like {@link #remove(Task)} but also marks the {@link Item} as cancelled. */ public T cancel(Task p) { T x = remove(p); if(x!=null) x.onCancelled(); return x; }
/** * Works like {@link #remove(Object)} but also marks the {@link Item} as cancelled. */ public boolean cancel(Item t) { boolean r = remove(t); if(r) t.onCancelled(); return r; }
public synchronized boolean cancel(Item item) { LOGGER.fine("Cancelling " + item.task.getFullDisplayName() + " item#" + item.id); // use bitwise-OR to make sure that all the branches get evaluated all the time boolean r = (item instanceof WaitingItem && waitingList.remove(item)) | blockedProjects.remove(item) | buildables.remove(item); if(r) item.onCancelled(); return r; }
public void cancelAll() { for (T t : this) t.onCancelled(); clear(); } }
public void cancelAll() { for (T t : this) t.onCancelled(); clear(); } }
public synchronized boolean cancel(Item item) { LOGGER.fine("Cancelling " + item.task.getFullDisplayName() + " item#" + item.id); // use bitwise-OR to make sure that all the branches get evaluated all the time boolean r = (item instanceof WaitingItem && waitingList.remove(item)) | blockedProjects.remove(item) | buildables.remove(item); if(r) item.onCancelled(); return r; }
public void cancelAll() { for (T t : this) { t.onCancelled(); } clear(); } }
/** * Works like {@link #remove(Object)} but also marks the {@link Item} as * canceled. */ public boolean cancel(Item t) { boolean r = remove(t); if (r) { t.onCancelled(); } return r; }
/** * Works like {@link #remove(Object)} but also marks the {@link Item} as cancelled. */ public boolean cancel(Item t) { boolean r = remove(t); if(r) t.onCancelled(); return r; }
/** * Works like {@link #remove(Task)} but also marks the {@link Item} as cancelled. */ public T cancel(Task p) { T x = remove(p); if(x!=null) x.onCancelled(); return x; }
/** * Works like {@link #remove(Object)} but also marks the {@link Item} as cancelled. */ public boolean cancel(Item t) { boolean r = remove(t); if(r) t.onCancelled(); return r; }
/** * Works like {@link #remove(Task)} but also marks the {@link Item} as cancelled. */ public T cancel(Task p) { T x = remove(p); if(x!=null) x.onCancelled(); return x; }
public synchronized boolean cancel(Item item) { LOGGER.fine("Cancelling " + item.task.getFullDisplayName() + " item#" + item.id); // use bitwise-OR to make sure that all the branches get evaluated all the time boolean r = (item instanceof WaitingItem && waitingList.remove(item)) | blockedProjects.remove(item) | buildables.remove(item); if(r) item.onCancelled(); return r; }
public void cancelAll() { for (T t : this) t.onCancelled(); clear(); } }
/** * Works like {@link #remove(Task)} but also marks the {@link Item} as * canceled. */ public T cancel(Task p) { T x = remove(p); if (x != null) { x.onCancelled(); } return x; }
public synchronized boolean cancel(Item item) { LOGGER.fine("Cancelling " + item.task.getFullDisplayName() + " item#" + item.id); // use bitwise-OR to make sure that all the branches get evaluated all the time boolean r = (item instanceof WaitingItem && waitingList.remove(item)) | blockedProjects.remove(item) | buildables.remove(item); if (r) { item.onCancelled(); } return r; }