Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. package CatenaDoppia;
  2.  
  3.  
  4. /* Class Node */
  5.  
  6. public class Node {
  7. private int data;
  8. private String informazione;
  9. private Node next, prev;
  10.  
  11. /* Constructor */
  12. public Node() {
  13. next = null;
  14. prev = null;
  15. data = 0;
  16. informazione = null;
  17. }
  18.  
  19.  
  20. public Node(String k,int i, Node n, Node p) {
  21. informazione = k;
  22. data = i;
  23. next = n;
  24. prev = p;
  25. }
  26.  
  27. /* Function to set link to next node */
  28. public void setLinkNext (Node n) {
  29. next = n;
  30. }
  31.  
  32. public void getNode(Node n){
  33. Node head = n;
  34. }
  35. /* Function to set link to previous node */
  36. public void setLinkPrev(Node p) {
  37. prev = p;
  38. }
  39.  
  40. /* Function to get link to next node */
  41. public Node getNext() {
  42. return next;
  43. }
  44. public void getFirst(Node n){
  45. Node head = n;
  46. }
  47.  
  48. /* Function to get link to previous node */
  49. public Node getPrev() {
  50. return prev;
  51. }
  52. /* Function to set information to node */
  53. public void setInformazione(String i) {
  54. informazione = i;
  55. }
  56.  
  57. /* Function to get data from node */
  58. public String getInformazione() {
  59. return informazione;
  60. }
  61. /* Function to set data to node */
  62. public void setData(int d) {
  63. data = d;
  64. }
  65.  
  66. /* Function to get data from node */
  67. public int getData() {
  68. return data;
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement