/**
* Remove a NegotiableCapability from this SequentialMap.
*/
void remove(NegotiableCapability capability) {
CaselessStringKey capNameKey =
new CaselessStringKey(capability.getCapabilityName());
int index = keys.indexOf(capNameKey);
if (index == -1) {
throw new IllegalArgumentException(
JaiI18N.getString("NegotiableCapabilitySet2"));
}
Vector v = (Vector)values.elementAt(index);
if (v.remove(capability) == false) {
throw new IllegalArgumentException(
JaiI18N.getString("NegotiableCapabilitySet2"));
}
// If this was the only element in the capabilityName Vector
if (v.isEmpty()) {
keys.remove(capNameKey);
values.remove(index);
}
if (keys.isEmpty())
categories.remove(new CaselessStringKey(
capability.getCategory()));
}