Mercurial > hg > Members > shoshi > jungle > jungle-core
changeset 307:67c330ef2472
extends NodePath
author | tatsuki |
---|---|
date | Thu, 26 Jan 2017 03:44:21 +0900 |
parents | a5f7565f3a4b |
children | 201cc75a9984 |
files | src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/nodepath/DefaultNodePath.java src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/nodepath/NodePath.java src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/nodepath/RedBlackTreeNodePath.java src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkNodePath.java |
diffstat | 4 files changed, 103 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/nodepath/DefaultNodePath.java Sun Jan 08 12:23:48 2017 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/nodepath/DefaultNodePath.java Thu Jan 26 03:44:21 2017 +0900 @@ -104,4 +104,16 @@ } return paths; } + + //以下使わない + @Override + public String getKey() { + return null; + } + + @Override + public String getValue() { + return null; + } + }
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/nodepath/NodePath.java Sun Jan 08 12:23:48 2017 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/nodepath/NodePath.java Thu Jan 26 03:44:21 2017 +0900 @@ -11,4 +11,6 @@ public int size(); public Pair<Integer,NodePath> last(); public NodePath addHead(int pos); + public String getKey(); + public String getValue(); }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungle/store/nodepath/RedBlackTreeNodePath.java Thu Jan 26 03:44:21 2017 +0900 @@ -0,0 +1,79 @@ +package jp.ac.u_ryukyu.ie.cr.jungle.store.nodepath; + + +import jp.ac.u_ryukyu.ie.cr.jungle.store.NulIterator; +import jp.ac.u_ryukyu.ie.cr.jungle.util.Pair; + +import java.util.Iterator; + +public class RedBlackTreeNodePath implements NodePath { + + private final String key; + private final String value; + + private RedBlackTreeNodePath(String key,String value) { + this.key = key; + this.value = value; + } + + + @Override + public String getKey() { + return key; + } + + @Override + public String getValue() { + return value; + } + + //以下使わない + @Override + public Iterator<Integer> iterator() { + return new NulIterator<>(); + } + + @Override + public int get(int index) { + return -2; + } + + @Override + public NodePath add(int pos) { + return null; + } + + @Override + public NodePath addHead(int pos) { + return null; + } + + @Override + public Pair<Integer, NodePath> pop() { + return null; + } + + @Override + public Pair<Integer, NodePath> last() { + return null; + } + + @Override + public String toString() { + return key + value ; + } + + @Override + public int size() { + return 0; + } + + + //PATHの一番後ろを取り除いたPATHを新しく作って返す +// EXAMPLE <0,0,3> → <0,0> + @Override + public NodePath tail() { + return null; + } + +}
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkNodePath.java Sun Jan 08 12:23:48 2017 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/jungleNetwork/operations/NetworkNodePath.java Thu Jan 26 03:44:21 2017 +0900 @@ -52,7 +52,6 @@ // return new DefaultNodePath(newPath); } - @Override public Pair<Integer, NodePath> pop() { LinkedList<Integer> cPath = copyPath(); @@ -91,4 +90,14 @@ return new Pair<Integer, NodePath>(num, new NetworkNodePath(path)); } + //以下使わない + @Override + public String getKey() { + return null; + } + + @Override + public String getValue() { + return null; + } }