Mercurial > hg > Members > shoshi > jungle > jungle-core
changeset 218:0b9807c1c6b4
delete TreeeMap warning
author | tatsuki |
---|---|
date | Tue, 01 Sep 2015 16:14:18 +0900 |
parents | 1b3661be3119 |
children | c86d39eb19d1 |
files | src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/data/treemap/BlackNode.java src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/data/treemap/DefaultComparator.java src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/data/treemap/Node.java src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/data/treemap/RedNode.java |
diffstat | 4 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/data/treemap/BlackNode.java Tue Aug 11 08:16:07 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/data/treemap/BlackNode.java Tue Sep 01 16:14:18 2015 +0900 @@ -83,7 +83,7 @@ return false; } - + @SuppressWarnings("unchecked") @Override public Node<K, V> replaceNode(Node<K, V> parent, Comparator ctr) throws RotateParent { Node<K, V> newNode; @@ -115,7 +115,7 @@ return leftSubTreeNode.deleteBalance(newParent, ctr); } } else { - Node<K, V> leftSubTreeNode = null; + Node<K, V> leftSubTreeNode; try { leftSubTreeNode = this.left().replaceNode(this, ctr);//右の子がいなかった場合、左の子を昇格させるだけで良い。 return createNode(this.left().getKey(), this.left().getValue(), leftSubTreeNode, this.right());
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/data/treemap/DefaultComparator.java Tue Aug 11 08:16:07 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/data/treemap/DefaultComparator.java Tue Sep 01 16:14:18 2015 +0900 @@ -2,11 +2,9 @@ import java.util.Comparator; -/** - * Created by e115731 on 15/08/10. - */ public class DefaultComparator<K> implements Comparator<K>{ @Override + @SuppressWarnings("unchecked") public int compare(K key, K compareKey) { return ((Comparable<? super K>)key).compareTo(compareKey); }
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/data/treemap/Node.java Tue Aug 11 08:16:07 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/data/treemap/Node.java Tue Sep 01 16:14:18 2015 +0900 @@ -79,6 +79,7 @@ } + @SuppressWarnings("unchecked") public Node<K, V> delete(K key, Node<K, V> parent, Comparator ctr, Rotate side) throws RotateParent { if (this.isNotEmpty()) { int result = compare(key, ctr); @@ -120,7 +121,7 @@ return null; // no key } - + @SuppressWarnings("unchecked") public Node<K, V> deleteSubTreeMaxNode(Node<K, V> parent, Comparator ctr, Rotate side) throws RotateParent { Node<K, V> node; try {
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/data/treemap/RedNode.java Tue Aug 11 08:16:07 2015 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/data/treemap/RedNode.java Tue Sep 01 16:14:18 2015 +0900 @@ -56,6 +56,7 @@ } @Override + @SuppressWarnings("unchecked") public Node<K, V> replaceNode(Node<K, V> parent, Comparator ctr) throws RotateParent { Node<K, V> newNode; if (!this.left().isNotEmpty() && !this.right().isNotEmpty()) { //自身を削除する