Package de.elo.utils

Class CollectionUtils

java.lang.Object
de.elo.utils.CollectionUtils

public class CollectionUtils
extends java.lang.Object
Helper functions for Collections.
  • Method Summary

    Modifier and Type Method Description
    static <T> java.util.List<java.util.List<T>> partition​(java.util.Collection<T> coll, int maxPartSize)
    Split a large collection into a list of smaller sub-lists.
    static <T> java.util.List<java.util.List<T>> partition​(java.util.Collection<T> coll, java.util.Comparator<T> comp)
    Teile die Collection in Sub-Listen auf, die gleiche Objekte enthalten.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • partition

      public static <T> java.util.List<java.util.List<T>> partition​(java.util.Collection<T> coll, int maxPartSize)
      Split a large collection into a list of smaller sub-lists.
      Type Parameters:
      T - Type
      Parameters:
      coll - Collection to be splitted
      maxPartSize - maximum number of items in sub-lists.
      Returns:
      List of sub-lists.
    • partition

      public static <T> java.util.List<java.util.List<T>> partition​(java.util.Collection<T> coll, java.util.Comparator<T> comp)
      Teile die Collection in Sub-Listen auf, die gleiche Objekte enthalten.
      Type Parameters:
      T -
      Parameters:
      coll - Collection
      comp - Vergleich von Objekten
      Returns:
      Liste aus Sub-Listen mit jeweils gleichen Objekten