diff --git a/common/source/java/ch/systemsx/cisd/common/collections/TableMap.java b/common/source/java/ch/systemsx/cisd/common/collections/TableMap.java index fc0f06d1ccf72425ac257d5ee1b7270a010e477f..2752ec4294fa21a3fe07aa8df848b3b4b34817de 100644 --- a/common/source/java/ch/systemsx/cisd/common/collections/TableMap.java +++ b/common/source/java/ch/systemsx/cisd/common/collections/TableMap.java @@ -189,6 +189,22 @@ public class TableMap<K, E> implements Iterable<E> { return Collections.unmodifiableSet(map.keySet()); } + + /** + * Removes and returns the row for the specified key. + * + * @return stored row. + */ + public E remove(K key) + { + E row = map.remove(key); + if (row == null) + { + throw new IllegalArgumentException("Couldn't remove row for key '" + key + + "' because there was no row."); + } + return row; + } // // Object