Code example for TreeMap

Methods: containsKeygetput

0
	public void add(String keyword, long id){
		List list = null;
		 
		 
		try { 
			if (buffer.containsKey(keyword)){
				list = buffer.get(keyword);
			}else{ 
				list = new ArrayList();
			} 
			 
			 
			if (!list.contains(id)){
				list.add(id);
				buffer.put(keyword, list);
			} 
		} catch (Exception e) {
			System.out.println("Size of list: " + list.size());
			e.printStackTrace();
		} 
Contextual code suggestions in your IDE  Get Codota for Java