Node.java 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* File : Node.java
  2. * Program : Handle Reduction Aimation - Applet
  3. * By Jean Fromentin <jfroment@info.unicaen.fr>
  4. * Copyright 2008 Jean Fromentin
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version 2
  9. * of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. */
  16. class Node {
  17. private int value;
  18. private Node next;
  19. private Node previous;
  20. public Node(){
  21. value=0;
  22. }
  23. public Node(int _value){
  24. value=_value;
  25. }
  26. public void setValue(int _value){
  27. value=_value;
  28. }
  29. public void setPrevious(Node _previous){
  30. previous=_previous;
  31. }
  32. public void setNext(Node _next){
  33. next=_next;
  34. }
  35. public int getValue(){
  36. return value;
  37. }
  38. public Node getPrevious(){
  39. return previous;
  40. }
  41. public Node getNext(){
  42. return next;
  43. }
  44. }