public class LinkedListNode<I extends java.lang.Comparable<? super I>>
extends java.lang.Object
Please note that this
interface uses the generic type I which either implements the
Comparable interface
, or some super class of I
implements the
Comparable interface
| Modifier and Type | Field and Description |
|---|---|
private I |
element |
private LinkedListNode<I> |
next |
| Constructor and Description |
|---|
LinkedListNode(I element)
Constructor LinkedListNode class.
|
LinkedListNode(I element,
LinkedListNode<I> next)
Constructor that for the Node class
|
| Modifier and Type | Method and Description |
|---|---|
I |
getElement()
Getter method to obtain a reference to the Object held by the LinkedListNode.
|
LinkedListNode<I> |
getNext()
Getter method to obtain a reference to the next LinkedListNode in the Linked List.
|
void |
setElement(I element)
Setter method to set the reference to the Object held by the LinkedListNode.
|
void |
setNext(LinkedListNode<I> next)
Setter method to set the reference to the next LinkedListNode in the Linked List.
|
private LinkedListNode<I extends java.lang.Comparable<? super I>> next
public LinkedListNode(I element)
null.element - This is the data Object held by the LinkedListNode.public LinkedListNode(I element, LinkedListNode<I> next)
element - This is the data Object held by the Node.next - This is the pointer to the next LinkedListNode in the Linked List.public I getElement()
public void setElement(I element)
element - The reference to the element to be held by the LinkedListNode.public LinkedListNode<I> getNext()
public void setNext(LinkedListNode<I> next)
next - The reference to the next LinkedListNode in the Linked List.