Class CollectionUtils

java.lang.Object
ai.timefold.solver.core.impl.util.CollectionUtils

public final class CollectionUtils extends Object
  • Method Details

    • copy

      public static <E> List<E> copy(List<E> originalList, boolean reverse)
      Creates a copy of the list, optionally in reverse order.
      Type Parameters:
      E - the type of elements in the list
      Parameters:
      originalList - the list to copy, preferably ArrayList
      reverse - true if the resulting list should have its order reversed
      Returns:
      mutable list, never null
    • concat

      public static <T> List<T> concat(List<T> left, List<T> right)
    • toDistinctList

      public static <T> List<T> toDistinctList(Collection<T> collection)
    • newHashSet

      public static <T> Set<T> newHashSet(int size)
    • newLinkedHashSet

      public static <T> Set<T> newLinkedHashSet(int size)
    • newHashMap

      public static <K, V> Map<K,V> newHashMap(int size)
    • newIdentityHashMap

      public static <K, V> Map<K,V> newIdentityHashMap(int size)
    • newLinkedHashMap

      public static <K, V> Map<K,V> newLinkedHashMap(int size)