Hashmap2List.java
Go to the documentation of this file.
00001 package edu.tum.cs.ias.knowrob.util.datastructures;
00002 
00003 import java.util.HashMap;
00004 import java.util.Vector;
00005 
00006 public class Hashmap2List<KeyT, ValueT> {
00007         protected HashMap<KeyT, Vector<ValueT>> map = new HashMap<KeyT, Vector<ValueT>>();
00008         
00009         public void put(KeyT key, ValueT value) {
00010                 Vector<ValueT> v;
00011                 if(!map.containsKey(key)) { 
00012                         v = new Vector<ValueT>();
00013                         map.put(key, v);
00014                 }
00015                 else
00016                         v = map.get(key);
00017                 v.add(value);
00018         }
00019         
00020         public Vector<ValueT> get(KeyT key) {
00021                 return map.get(key);
00022         }
00023 }


mod_vis
Author(s): Moritz Tenorth, Jakob Engel
autogenerated on Mon Oct 6 2014 01:30:00