Class Tools


  • public abstract class Tools
    extends Object
    • Constructor Detail

      • Tools

        public Tools()
    • Method Detail

      • newHashMap

        public static <K,​V> Map<K,​V> newHashMap()
      • newHashSet

        public static <E> Set<E> newHashSet()
      • newLinkedHashMap

        public static <K,​V> Map<K,​V> newLinkedHashMap()
      • iteratorToList

        public static <T> List<T> iteratorToList​(Iterator<T> iter)
      • collectionToList

        public static <X> List<X> collectionToList​(Collection<X> collection)
      • listToIndexElementPairList

        public static <T> List<Pair<Integer,​T>> listToIndexElementPairList​(List<T> list)
        Transforms a list of arbitrary elements to a list of index-element pairs.
        Parameters:
        list - List to transform.
        Returns:
        A list of pairs: ((0, element_at_index_0), (1, element_at_index_1), ...)