/** * Utility method for mutable mapping. map[index] U= o */ protected static <T> void mapUsingMutableMapping(MutableMapping<List<T>> map, int index, T o){ List<T> set; if (index <= map.getMaximumIndex()){ set = map.getMappedObject(index); } else { set = null; } if (null == set){ set = new ArrayList<>(); map.put(index, set); } set.add(o); }
/** * Utility method for mutable mapping. map[index] U= o */ protected static <T> void mapUsingMutableMapping(MutableMapping<List<T>> map, int index, T o){ List<T> set; if (index <= map.getMaximumIndex()){ set = map.getMappedObject(index); } else { set = null; } if (null == set){ set = new ArrayList<>(); map.put(index, set); } set.add(o); }