org.hibernate.search.util.impl

## Class CollectionHelper

- java.lang.Object
- - org.hibernate.search.util.impl.CollectionHelper

-     public final class CollectionHelper
      extends Object

  Provides some methods for simplified collection instantiation.
  Author:
    Gunnar Morling, Hardy Ferentschik

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Set<String>` | `asImmutableSet(String[] names)`
    `static <T> Set<T>` | `asSet(T... ts)`
    `static <T> Iterable<T>` | `flatten(Iterable<? extends Iterable<T>> nonFlat)`
    `static <T> Iterator<T>` | `flatten(Iterator<? extends Iterable<T>> nonFlat)`
    `static Iterable<?>` | `iterableFromArray(Object object)` Builds an `Iterable` for a given array.
    `static Iterator<?>` | `iteratorFromArray(Object object)` Builds an `Iterator` for a given array.
    `static <T> ArrayList<T>` | `newArrayList()`
    `static <T> ArrayList<T>` | `newArrayList(int size)`
    `static <K,V> HashMap<K,V>` | `newHashMap()`
    `static <K,V> HashMap<K,V>` | `newHashMap(int size)`
    `static <T> HashSet<T>` | `newHashSet()`
    `static <K,V> SortedMap<K,V>` | `newSortedMap()`
    `static <T> List<T>` | `toImmutableList(Collection<? extends T> c)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### newHashMap

          public static <K,V> HashMap<K,V> newHashMap()

    - #### newHashMap

          public static <K,V> HashMap<K,V> newHashMap(int size)

    - #### newSortedMap

          public static <K,V> SortedMap<K,V> newSortedMap()

    - #### newHashSet

          public static <T> HashSet<T> newHashSet()

    - #### newArrayList

          public static <T> ArrayList<T> newArrayList()

    - #### newArrayList

          public static <T> ArrayList<T> newArrayList(int size)

    - #### asSet

          public static <T> Set<T> asSet(T... ts)

    - #### toImmutableList

          public static <T> List<T> toImmutableList(Collection<? extends T> c)

    - #### asImmutableSet

          public static Set<String> asImmutableSet(String[] names)

    - #### iteratorFromArray

          public static Iterator<?> iteratorFromArray(Object object)

      Builds an `Iterator` for a given array. It is (un)necessarily ugly because we have to deal with array of primitives.
      Parameters:
        `object` - a given array
      Returns:
        an `Iterator` iterating over the array

    - #### iterableFromArray

          public static Iterable<?> iterableFromArray(Object object)

      Builds an `Iterable` for a given array. It is (un)necessarily ugly because we have to deal with array of primitives.
      Parameters:
        `object` - a given array
      Returns:
        an `Iterable` providing iterators over the array

    - #### flatten

          public static <T> Iterable<T> flatten(Iterable<? extends Iterable<T>> nonFlat)

    - #### flatten

          public static <T> Iterator<T> flatten(Iterator<? extends Iterable<T>> nonFlat)

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved