Class 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 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