Java SortedMap Usage getAll(SortedMap map)

Here you can find the source of getAll(SortedMap map)

Description

Given a sorted map with integer keys and entries of type T[] , this method returns a list of all entries of type T in the induced ordering.

License

Open Source License

Parameter

Parameter Description
map a parameter

Declaration

public static <T> List<T> getAll(SortedMap<Integer, T[]> map) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;
import java.util.List;
import java.util.SortedMap;

public class Main {
    /**/*from ww w  .  j  av  a  2  s.  c  om*/
     * Given a sorted map with integer keys and entries of type <code>T[]</code>
     * , this method returns a list of all entries of type <code>T</code> in the
     * induced ordering.
     * 
     * @param map
     * @return
     */
    public static <T> List<T> getAll(SortedMap<Integer, T[]> map) {
        List<T> array = new ArrayList<T>();
        for (int i : map.keySet()) {
            T[] entry = map.get(i);
            for (T t : entry) {
                array.add(t);
            }
        }
        return array;
    }
}

Related

  1. filterPrefix( SortedMap baseMap, String prefix)
  2. find(SortedMap map, String baseName)
  3. firstElement(Collection c)
  4. firstElement(Collection c)
  5. generatePropertiesFilter(SortedMap propertiesMap)
  6. getObjectSortedMap(SortedMap map, T key)
  7. isCollectionClass(Class clazz)
  8. lastElement(List c)
  9. pruneStartAndEndKeys(SortedMap setOfStartKeyByteArray, List listOfStartKeyByteArray)