void applyFilter(final Set<Protocol> enabled, final EnumMap<Protocol, String> supported) { enabled.removeAll(protocols); for (Protocol protocol : protocols) { supported.remove(protocol); } } }
@Override public boolean remove(Object object) { if (object == null) { for (int i = 0; i < enumMap.enumSize; i++) { if (enumMap.hasMapping[i] && enumMap.values[i] == null) { enumMap.remove(enumMap.keys[i]); return true; } } } else { for (int i = 0; i < enumMap.enumSize; i++) { if (enumMap.hasMapping[i] && object.equals(enumMap.values[i])) { enumMap.remove(enumMap.keys[i]); return true; } } } return false; }
public void remove() { checkStatus(); if (enumMap.hasMapping[prePosition]) { enumMap.remove(enumMap.keys[prePosition]); } prePosition = -1; }
@Override @SuppressWarnings("unchecked") public boolean remove(Object object) { if (contains(object)) { enumMap.remove(object); return true; } return false; }
@Override public boolean remove(Object object) { if (contains(object)) { enumMap.remove(((Map.Entry) object).getKey()); return true; } return false; }
private void decStorageTypeCount(StorageType type) { // no locking because the caller is synchronized already int current = storageTypeCounts.get(type); current -= 1; if (current == 0) { storageTypeCounts.remove(type); } else { storageTypeCounts.put(type, current); } }
public synchronized void stop(K timer) { Long st = startTime.get(timer); if (st == null) { throw new IllegalStateException(timer + " not started"); } Long existingTime = totalTime.get(timer); if (existingTime == null) existingTime = 0L; totalTime.put(timer, existingTime + (System.currentTimeMillis() - st)); startTime.remove(timer); }
/** * Called by a child node of the current node to decrement a storage count. * * @param childName the name of the child removing a storage type. * @param type the type being removed. */ public synchronized void childRemoveStorage( String childName, StorageType type) { LOG.debug("child remove storage: {}:{}", childName, type); Preconditions.checkArgument(childrenStorageInfo.containsKey(childName)); EnumMap<StorageType, Integer> typeCount = childrenStorageInfo.get(childName); Preconditions.checkArgument(typeCount.containsKey(type)); if (typeCount.get(type) > 1) { typeCount.put(type, typeCount.get(type) - 1); } else { typeCount.remove(type); } Preconditions.checkArgument(storageTypeCounts.containsKey(type)); if (storageTypeCounts.get(type) > 1) { storageTypeCounts.put(type, storageTypeCounts.get(type) - 1); } else { storageTypeCounts.remove(type); } if (getParent() != null) { ((DFSTopologyNodeImpl)getParent()).childRemoveStorage(getName(), type); } } }
currentCount.remove(st);
childrenStorageInfo.get(dnDescriptor.getName()).remove(type); decStorageTypeCount(type); if (parent != null) {
public void clearMessagesForScope(NuitonValidatorScope scope) { if (messages != null) { messages.remove(scope); } }
/** * Clears an enforced render state index by setting it to null. This allows object specific states to be used. * * @param type * The type of RenderState to clear enforcement on. */ public void clearPassState(final StateType type) { _passStates.remove(type); }
/** * Clear all Tags that are assigned to this Span. */ public void clearTags(Annotation.Source source) { if(tags == null) return; if(!tags.containsKey(source)) return; tags.get(source).clear(); tags.remove(source); }
public void remove() { checkStatus(); if (enumMap.hasMapping[prePosition]) { enumMap.remove(enumMap.keys[prePosition]); } prePosition = -1; }
@Override @SuppressWarnings("unchecked") public boolean remove(Object object) { if (contains(object)) { enumMap.remove(object); return true; } return false; }
@Override @SuppressWarnings("unchecked") public boolean remove(Object object) { if (contains(object)) { enumMap.remove(object); return true; } return false; }
@Nonnull public final EChange removePropertyValue (@Nullable final EXMLParserProperty eProperty) { return EChange.valueOf (eProperty != null && m_aProperties.remove (eProperty) != null); }
@Nonnull public final EChange removeFeature (@Nullable final EXMLParserFeature eFeature) { return EChange.valueOf (eFeature != null && m_aFeatures.remove (eFeature) != null); }
@Override public boolean remove(Object object) { if (contains(object)) { enumMap.remove(((Map.Entry) object).getKey()); return true; } return false; }
private void failSlotWaiters(boolean reallyFailed) { for(RequestType type : RequestType_values) { SlotWaiterList slots; synchronized(routedToLock) { slots = slotWaiters.get(type); if(slots == null) continue; slotWaiters.remove(type); } for(SlotWaiter w : slots.values()) w.onFailed(PeerNode.this, reallyFailed); } }