-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.debug.ui.internal;\r
-\r
-import java.util.ArrayList;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-\r
-public class HashMultiMap<D,R> extends HashMap<D,List<R>> {\r
-\r
- private static final long serialVersionUID = 8928508639019379832L;\r
-\r
- public void add(D a, R b) {\r
- List<R> elements = get(a);\r
- if(elements == null) {\r
- elements = new ArrayList<R>(1);\r
- put(a, elements);\r
- }\r
- elements.add(b);\r
- }\r
- \r
-// public boolean remove(D a, R b) {\r
-// List<R> elements = get(a);\r
-// if(elements == null) \r
-// return false;\r
-// if(elements.remove(b)) {\r
-// // This would makes in some applications\r
-// //if(elements.isEmpty())\r
-// // remove(a);\r
-// return true;\r
-// }\r
-// else\r
-// return false;\r
-// }\r
- \r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.debug.ui.internal;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+public class HashMultiMap<D,R> extends HashMap<D,List<R>> {
+
+ private static final long serialVersionUID = 8928508639019379832L;
+
+ public void add(D a, R b) {
+ List<R> elements = get(a);
+ if(elements == null) {
+ elements = new ArrayList<R>(1);
+ put(a, elements);
+ }
+ elements.add(b);
+ }
+
+// public boolean remove(D a, R b) {
+// List<R> elements = get(a);
+// if(elements == null)
+// return false;
+// if(elements.remove(b)) {
+// // This would makes in some applications
+// //if(elements.isEmpty())
+// // remove(a);
+// return true;
+// }
+// else
+// return false;
+// }
+
+}