Here you can find the source of add(final Integer id, final TreeMap
Parameter | Description |
---|---|
id | a parameter |
map | a parameter |
object | a parameter |
static <T> void add(final Integer id, final TreeMap<Integer, List<T>> map, T object)
//package com.java2s; /*//from w w w . j av a 2s . c o m * libChEBIj (c) University of Manchester 2015 * * libChEBIj is licensed under the MIT License. * * To view a copy of this license, visit <http://opensource.org/licenses/MIT/>. */ import java.util.*; public class Main { /** * * @param id * @param map * @param object */ static <T> void add(final Integer id, final TreeMap<Integer, List<T>> map, T object) { List<T> list = map.get(id); if (list == null) { list = new ArrayList<>(); map.put(id, list); } list.add(object); } }