Interface MutList<E>

    • Method Detail

      • append

        @NotNull
        @NotNull MutList<E> append​(E val)
        Adds one item to the end of the ImList.
        Specified by:
        append in interface BaseList<E>
        Parameters:
        val - the value to insert
        Returns:
        a new ImList with the additional item at the end.
      • appendWhen

        @NotNull
        default @NotNull MutList<E> appendWhen​(@NotNull
                                               @NotNull Fn0<Boolean> test,
                                               E e)
        Adds one item to the end of the ImList.
        Specified by:
        appendWhen in interface BaseList<E>
        e - the value to insert
        Returns:
        a new ImList with the additional item at the end.
      • add

        default boolean add​(E val)
        Ensures that this collection contains the specified element (optional operation). Returns true if this collection changed as a result of the call.
        Specified by:
        add in interface Collection<E>
        Specified by:
        add in interface List<E>
        Specified by:
        add in interface UnmodCollection<E>
        Specified by:
        add in interface UnmodList<E>
      • addAll

        default boolean addAll​(@NotNull
                               @NotNull Collection<? extends E> c)
        Appends all the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator.
        Specified by:
        addAll in interface Collection<E>
        Specified by:
        addAll in interface List<E>
        Specified by:
        addAll in interface UnmodCollection<E>
        Specified by:
        addAll in interface UnmodList<E>
      • immutable

        ImList<E> immutable()
        Returns a immutable version of this mutable list.
      • concat

        @NotNull
        default @NotNull MutList<E> concat​(@Nullable
                                           @Nullable Iterable<? extends E> es)
        Efficiently adds items to the end of this ImList.
        Specified by:
        concat in interface BaseList<E>
        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.
      • replace

        @NotNull
        @NotNull MutList<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.
        Specified by:
        replace in interface BaseList<E>
        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
        default @NotNull MutList<E> reverse()
        Returns a reversed copy of this list.
        Specified by:
        reverse in interface BaseList<E>