Mercurial > hg > Members > shoshi > jungle > jungle-core
changeset 206:f06dc60bd70f
change List add and delete method
author | tatsuki |
---|---|
date | Tue, 19 May 2015 13:09:47 +0900 |
parents | 89df000def32 |
children | 71624cf77dbf |
files | src/main/java/jp/ac/u_ryukyu/ie/cr/list/headNode.java src/test/java/jp/ac/u_ryukyu/ie/cr/tatsuki/list/listAdd.java |
diffstat | 2 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/list/headNode.java Tue May 19 12:59:39 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/list/headNode.java Tue May 19 13:09:47 2015 +0900 @@ -25,7 +25,7 @@ } public Node<T> add(int num, T attribute) { - if (num == 1) { + if (num == 0) { return new DefaultNode<>(attribute, num, this); }
--- a/src/test/java/jp/ac/u_ryukyu/ie/cr/tatsuki/list/listAdd.java Tue May 19 12:59:39 2015 +0900 +++ b/src/test/java/jp/ac/u_ryukyu/ie/cr/tatsuki/list/listAdd.java Tue May 19 13:09:47 2015 +0900 @@ -27,6 +27,9 @@ list = list.add(1000, 1001); num = list.index(5); Assert.assertEquals(num, 5); + list = list.add(0,0); + num = list.index(0); + Assert.assertEquals(num, 0); }