Interface BaseList<E>

    • Method Detail

      • append

        @NotNull
        @NotNull BaseList<E> append​(E e)
        Returns a new BaseList with the additional item at the end.
        Parameters:
        e - the value to append
      • appendSome

        @NotNull
        default @NotNull BaseList<E> appendSome​(@NotNull
                                                @NotNull Fn0<? extends @NotNull Option<E>> supplier)
        If supplier returns Some, return a new BaseList with the additional item at the end. If None, just return this BaseList unmodified.
        Parameters:
        supplier - return Option.Some to append, None for a no-op.
      • concat

        @NotNull
        @NotNull BaseList<E> concat​(@Nullable
                                    @Nullable Iterable<? extends E> es)
        Efficiently adds items to the end of this ImList.
        Specified by:
        concat in interface Transformable<E>
        Specified by:
        concat in interface UnmodIterable<E>
        Parameters:
        es - the values to insert
        Returns:
        a new ImList with the additional items at the end.
      • get

        default E get​(int i,
                      E notFound)
        Returns the item at this index.
        Parameters:
        i - the zero-based index to get from the vector.
        notFound - the value to return if the index is out of bounds.
        Returns:
        the value at that index, or the notFound value.
      • head

        @NotNull
        default @NotNull Option<E> head()
        The first item in this iterable.
        Specified by:
        head in interface Transformable<E>
        Specified by:
        head in interface UnmodIterable<E>
        Returns:
        an eagerly evaluated result which is a single item.
      • replace

        @NotNull
        @NotNull BaseList<E> replace​(int idx,
                                     E e)
        Replace the item at the given index. Note: i.replace(i.size(), o) used to be equivalent to i.concat(o), but it probably won't be for the RRB tree implementation, so this will change too.
        Parameters:
        idx - the index where the value should be stored.
        e - the value to store
        Returns:
        a new ImList with the replaced item
      • reverse

        @NotNull
        @NotNull BaseList<E> reverse()
        Returns a reversed copy of this list.