Java Utililty Methods Map to List

List of utility methods to do Map to List

Description

The list of methods to do Map to List are organized into topic(s).

Method

List>mapToList(final TreeMap> map)
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());
...
ListmapToList(Map 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());
...
ListmapToList(Map map)
map To List
List<T> list = new ArrayList<T>();
for (Object key : map.keySet()) {
    list.add((T) map.get(key));
return list;