Class SimpleLinkedList<E>

    • Constructor Detail

      • SimpleLinkedList

        public SimpleLinkedList()
    • Method Detail

      • append

        public void append​(E element)
        Description copied from interface: SimpleList
        Appends the given element to the end of the collection.
        Specified by:
        append in interface SimpleList<E>
        Parameters:
        element - the element to append
      • prepend

        public void prepend​(E element)
        Description copied from interface: SimpleList
        Inserts the given element such that it becomes the first element in the collection.
        Specified by:
        prepend in interface SimpleList<E>
        Parameters:
        element - the element to insert
      • remove

        public boolean remove​(E element)
        Description copied from interface: SimpleList
        Removes the given element from the collection.

        Any existing element identical to element is removed

        Specified by:
        remove in interface SimpleList<E>
        Parameters:
        element - the element to remove
        Returns:
        true if a element was removed
      • toList

        public List<E> toList()
        Description copied from interface: SimpleList
        Coerces this list into a List.

        The returned list may be manipulated to update this list.

        Specified by:
        toList in interface SimpleList<E>
        Returns:
        list of elements