Class SLinked_ListOfString

java.lang.Object
SLinked_ListOfString
All Implemented Interfaces:
ListOfString_Interface

public class SLinked_ListOfString extends Object implements ListOfString_Interface
Singly linked list of Strings
Author:
Dr. Lillis
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private SNode_String
    Reference to the first element in this linked list.
    private int
    Number of elements currently stored in this linked list.
    private SNode_String
    Reference to the last element in this linked list.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs an empty list.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(int i, String str)
    Adds the given element at the given index position i.
    void
    add(String str)
    Adds the given element to the end of this list.
    void
    Adds the given element to the beginning of this list.
    void
    Adds the given element to the end of this list.
    void
    Removes all list elements, if any exist.
    boolean
    Returns true if the specified element in in this list, returns false otherwise.
    int
    Returns the index of the first occurrence of the specified element, -1 if the element is not in this list
    get(int i)
    Returns the element at the given index position.
    Returns the first element in this list.
    Returns the last element in this list.
    boolean
    Returns true if this list is empty, returns false otherwise.
    int
    Returns the index of the last occurrence of the specified element, -1 if the element is not in this list not found.
    remove(int i)
    Removes and returns the element at the specified index position in the list.
    Removes and returns the first occurrence of the specified element.Returns null if the element is not in this list.
    Removes and returns the first element in this list.
    Removes and returns the last element in this list.
    set(int i, String str)
    Replaces the element at the given index position with the given element and returns the old element.
    Replaces the first element with the given element and returns the old element.
    Replaces the last element with the given element and returns the old element.
    int
    Returns the number of elements in this list.
    Returns a string containing each element in this list, separated by commas, enclosed in square brackets.

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait