Advertisement
Guest User

Node Class

a guest
Mar 8th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.88 KB | None | 0 0
  1. package jasonandrewsca3;
  2.  
  3. public class Node<E>
  4. {
  5.    private E value;
  6.    public Node current;
  7.    public Node<E> prev;
  8.    public Object data;
  9.    public Node<E> next;
  10.  
  11.    public Node(){
  12.        
  13.    }
  14.    public Node(E value) {
  15.         this.value = value;
  16.     }
  17.    public Node(E value, Node<E> prev, Node<E> next) {
  18.             this.value = value;
  19.             setPrev(prev);
  20.             setNext(next);
  21.     }
  22.    
  23.        void setPrev(Node<E> prev) {
  24.             this.prev = prev;
  25.     }
  26.  
  27.     void setNext(Node<E> next) {
  28.             this.next = next;
  29.     }
  30.    
  31.     void previous(Node<E> prev) {
  32.             this.prev = prev;
  33.     }
  34.  
  35.     void next(Node<E> next) {
  36.             this.next = next;
  37.     }
  38.  
  39.     Node<E> getPrev() {
  40.         return prev;
  41.     }
  42.  
  43.     Node<E> getNext() {
  44.         return next;
  45.     }
  46.  
  47.     E getValue() {
  48.         return value;
  49.     }
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement