impl: custom linked list node
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package appointmentplanner.customlist;
|
||||
|
||||
public class CustomLinkedListNode<T> {
|
||||
private T item;
|
||||
private CustomLinkedListNode<T> next;
|
||||
|
||||
public CustomLinkedListNode(CustomLinkedListNode<T> next, T item) {
|
||||
this.next = next;
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
public CustomLinkedListNode(T item) {
|
||||
this(null, item);
|
||||
}
|
||||
|
||||
public T getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
public CustomLinkedListNode<T> getNext() {
|
||||
return next;
|
||||
}
|
||||
|
||||
public void setNext(CustomLinkedListNode<T> next) {
|
||||
this.next = next;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user