Class PersistentVector.MutableVector<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 java.util.Collection<F>
        Specified by:
        size in interface java.util.List<F>
        Specified by:
        size in interface Sized
      • append

        public MutableList<F> append​(F val)
        Description copied from interface: MutableList
        Adds one item to the end of the ImList.
        Specified by:
        append in interface BaseList<F>
        Specified by:
        append in interface MutableList<F>
        Parameters:
        val - the value to insert
        Returns:
        a new ImList with the additional item at the end.
      • get

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

        public MutableList<F> replace​(int idx,
                                      F e)
        Description copied from interface: MutableList
        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 MutableList<F>
        Parameters:
        idx - the index where the value should be stored.
        e - the value to store
        Returns:
        a new ImList with the replaced item