public class LinkedList
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected LinkedNode |
firstNode |
protected LinkedNode |
lastNode |
Constructor and Description |
---|
LinkedList()
Base constructor.
|
Modifier and Type | Method and Description |
---|---|
LinkedNode |
Delete(char character)
Deletes node with given character.
|
LinkedNode |
Delete(int index)
Deletes node with given index.
|
LinkedNode |
firstNode()
Getter for first node in list.
|
java.lang.Boolean |
Insert(char character,
int index)
Inserts new new node at given index in linked list.
|
LinkedNode |
lastNode()
Getter for last node in list.
|
LinkedNode |
Retrieve(int index)
Retrieves node from indicated index.
|
protected LinkedNode firstNode
protected LinkedNode lastNode
public LinkedNode firstNode()
public LinkedNode lastNode()
public LinkedNode Retrieve(int index)
index
- Index of node to retrieve.public java.lang.Boolean Insert(char character, int index)
character
- Character for node to hold.index
- Index of new node.public LinkedNode Delete(int index)
index
- Index of node to delete.public LinkedNode Delete(char character)
character
- Character to delete.