Mercurial > hg > Database > jungle-sharp
comparison src/main/csharp/jp.ac.u-ryukyu.ie.cr/jungle/data/list/headNode.cs @ 5:0428c8888abf
Comparison original java code
author | Kazuma |
---|---|
date | Tue, 05 Jul 2016 07:20:41 +0900 |
parents | 79da77797f7e |
children |
comparison
equal
deleted
inserted
replaced
4:79da77797f7e | 5:0428c8888abf |
---|---|
20 public T getAttribute(){ | 20 public T getAttribute(){ |
21 return default(T); | 21 return default(T); |
22 } | 22 } |
23 | 23 |
24 public Node<T> add(int currentNum, int num, T attribute) { | 24 public Node<T> add(int currentNum, int num, T attribute) { |
25 Node<T> newNode; | |
26 if (num == 0) { | 25 if (num == 0) { |
27 newNode = new DefaultNode<T>(attribute, next); | 26 Node<T> newNode = new DefaultNode<T>(attribute, next); |
28 return new headNode<T>(newNode); | 27 return new headNode<T>(newNode); |
29 } | 28 } |
30 newNode = next.add(currentNum + 1, num, attribute); | 29 Node<T> newNodes = next.add(currentNum + 1, num, attribute); |
31 if (newNode == null) { | 30 if (newNodes == null) { |
32 return this; | 31 return this; |
33 } | 32 } |
34 return new headNode<T>(newNode); | 33 return new headNode<T>(newNodes); |
35 } | 34 } |
36 | 35 |
37 public Node<T> addLast(T attribute) { | 36 public Node<T> addLast(T attribute) { |
38 Node<T> node = next.addLast(attribute); | 37 Node<T> node = next.addLast(attribute); |
39 return new headNode<T>(node); | 38 return new headNode<T>(node); |