List of utility methods to do Map to List
List
| mapToList(final TreeMap map To List final int lastIndex = map.lastKey().intValue(); final int capacity = lastIndex + 1; final List<List<T>> list = new ArrayList<>(capacity); for (int i = 0; i < capacity; i++) { list.add(new ArrayList<T>()); for (Map.Entry<Integer, List<T>> entry : map.entrySet()) { list.set(entry.getKey().intValue(), entry.getValue()); ... |
List | mapToList(Map map To List List<K> fields = new ArrayList<K>(); List<V> values = new ArrayList<V>(); Set<Entry<K, V>> set = map.entrySet(); Iterator<Entry<K, V>> iter = set.iterator(); while (iter.hasNext()) { Entry<K, V> entry = (Entry<K, V>) iter.next(); fields.add((K) entry.getKey()); values.add(entry.getValue()); ... |
List | mapToList(Map map To List List<T> list = new ArrayList<T>(); for (Object key : map.keySet()) { list.add((T) map.get(key)); return list; |