Class PersistentVector.MutVector<F>

    • Method Detail

      • size

        public int size()
        Description copied from interface: Sized
        Returns the number of items in this collection or iterable.
        Specified by:
        size in interface Collection<F>
        Specified by:
        size in interface List<F>
        Specified by:
        size in interface Sized
      • append

        @Contract(mutates="this")
        @NotNull
        public @NotNull MutList<F> append​(F val)
        Description copied from interface: MutList
        Adds the item to the end of this list (mutating it in place).
        Specified by:
        append in interface BaseList<F>
        Specified by:
        append in interface MutList<F>
        Parameters:
        val - the value to append
      • appendSome

        @Contract(mutates="this")
        @NotNull
        public @NotNull MutList<F> appendSome​(@NotNull
                                              @NotNull Fn0<? extends @NotNull Option<F>> supplier)
        If supplier returns Some, append the additional item to the end of this MutList (modifying it in place). If None, just return this MutList unmodified.
        Specified by:
        appendSome in interface BaseList<F>
        Specified by:
        appendSome in interface MutList<F>
        Parameters:
        supplier - return Option.Some to append, None for a no-op.
      • get

        public F get​(int i)
        Specified by:
        get in interface List<F>
      • replace

        @Contract(mutates="this")
        @NotNull
        public @NotNull MutList<F> replace​(int idx,
                                           F e)
        Description copied from interface: MutList
        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<F>
        Specified by:
        replace in interface MutList<F>
        Parameters:
        idx - the index where the value should be stored.
        e - the value to store
        Returns:
        a new ImList with the replaced item