Package com.gengoai.collection
Class Indexes
- java.lang.Object
-
- com.gengoai.collection.Indexes
-
public final class Indexes extends Object
Common methods for reading counters from structured files, creating synchronized and unmodifiable wrappers.- Author:
- David B. Bracewell
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <TYPE> Index<TYPE>
indexOf(@NonNull Iterable<TYPE> elements)
Creates a new index using the given set of elementsstatic <TYPE> Index<TYPE>
indexOf(@NonNull Iterator<TYPE> elements)
Creates a new index using the given set of elementsstatic <TYPE> Index<TYPE>
indexOf(@NonNull Stream<TYPE> elements)
Creates a new index using the given set of elementsstatic <TYPE> Index<TYPE>
indexOf(@NonNull TYPE... elements)
Creates a new index using the given set of elements
-
-
-
Method Detail
-
indexOf
@SafeVarargs public static <TYPE> Index<TYPE> indexOf(@NonNull @NonNull TYPE... elements)
Creates a new index using the given set of elements- Type Parameters:
TYPE
- the component type of the index- Parameters:
elements
- the elements to initialize the index with- Returns:
- A new index containing the given elements
-
indexOf
public static <TYPE> Index<TYPE> indexOf(@NonNull @NonNull Iterable<TYPE> elements)
Creates a new index using the given set of elements- Type Parameters:
TYPE
- the component type of the index- Parameters:
elements
- the elements to initialize the index with- Returns:
- A new index containing the given elements
-
indexOf
public static <TYPE> Index<TYPE> indexOf(@NonNull @NonNull Iterator<TYPE> elements)
Creates a new index using the given set of elements- Type Parameters:
TYPE
- the component type of the index- Parameters:
elements
- the elements to initialize the index with- Returns:
- A new index containing the given elements
-
indexOf
public static <TYPE> Index<TYPE> indexOf(@NonNull @NonNull Stream<TYPE> elements)
Creates a new index using the given set of elements- Type Parameters:
TYPE
- the component type of the index- Parameters:
elements
- the elements to initialize the index with- Returns:
- A new index containing the given elements
-
-