changeset 10:a2c019a77c27

commit
author Shoshi TAMAKI
date Mon, 10 Dec 2012 18:50:53 +0900
parents bb96e631f022
children 5f763f32940e
files .hgignore src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/App.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/Attributes.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/Children.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/Node.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/Tree.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/ChangeSet.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/Command.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/Constants.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/NodePath.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/Result.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/TreeEditor.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/TreeStore.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/AttributesImpl.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/ChangeSetImpl.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/ChildrenImpl.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/ModifiedTreeEditorImpl.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/NodeImpl.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/TreeEditorImpl.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/TreeImpl.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/TreeRepository.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/TreeStoreImpl.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/DefaultEvaluation.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/DefaultTraverseEvaluator.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/DefaultTraverser.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/Evaluation.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/TraverseEvaluator.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/TraverseResult.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/Traverser.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/util/IterableWrapper.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/util/Pair.java src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/util/Triple.java src/main/java/jungle/core/App.java src/main/java/jungle/core/Attributes.java src/main/java/jungle/core/Children.java src/main/java/jungle/core/Editor.java src/main/java/jungle/core/Jungle.java src/main/java/jungle/core/Link.java src/main/java/jungle/core/Links.java src/main/java/jungle/core/Node.java src/main/java/jungle/core/Path.java src/main/java/jungle/core/Tree.java src/main/java/jungle/core/TreeGroup.java src/main/java/jungle/core/TreeNode.java src/main/java/jungle/core/graph/EdgeList.java src/main/java/jungle/core/graph/Graph.java src/main/java/jungle/core/graph/Vertex.java src/main/java/jungle/core/graph/simple/SimpleGraph.java src/main/java/jungle/core/graph/simple/SimpleVertex.java src/main/java/jungle/core/graph/simple/SimpleVertexContext.java src/main/java/jungle/core/graph/simple/SimpleVertexes.java src/main/java/jungle/impl/SimpleAttributes.java src/main/java/jungle/impl/SimpleChildren.java src/main/java/jungle/impl/SimpleEditor.java src/main/java/jungle/impl/SimpleJungle.java src/main/java/jungle/impl/SimpleLink.java src/main/java/jungle/impl/SimpleLinks.java src/main/java/jungle/impl/SimpleTree.java src/main/java/jungle/impl/SimpleTreeGroup.java src/main/java/jungle/impl/SimpleTreeNode.java src/main/java/jungle/impl/Simples.java src/main/java/jungle/kernel/hypertree/Edge.java src/main/java/jungle/kernel/hypertree/HyperTree.java src/main/java/jungle/kernel/hypertree/Node.java src/main/java/jungle/kernel/hypertree/db/HyperTreeDatabaseService.java src/main/java/jungle/parsist/NodeProvider.java src/main/java/jungle/util/Pair.java src/main/java/jungle/util/Triple.java src/test/java/jungle/core/graph/AbstractGraphTest.java src/test/java/jungle/core/graph/AbstractVertexTest.java src/test/java/jungle/core/graph/AbstractVertexesTest.java src/test/java/jungle/core/graph/simple/SimpleGraphTest.java src/test/java/jungle/core/graph/simple/SimpleVertexTest.java src/test/java/jungle/core/graph/simple/SimpleVertexesTest.java src/test/java/jungle/util/PairTest.java
diffstat 75 files changed, 797 insertions(+), 2458 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,9 @@
+
+syntax: regexp
+^target$
+syntax: regexp
+^\.project$
+syntax: regexp
+^\.classpath$
+syntax: regexp
+^\.settings$
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/App.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,13 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core;
+
+/**
+ * Hello world!
+ *
+ */
+public class App 
+{
+    public static void main( String[] args )
+    {
+        System.out.println( "Hello World!" );
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/Attributes.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,8 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core;
+
+import java.nio.ByteBuffer;
+
+public interface Attributes
+{
+	public ByteBuffer get(String _key);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/Children.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,5 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core;
+
+public interface Children extends Iterable<Node>
+{
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/Node.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,7 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core;
+
+public interface Node
+{
+	public Children getChildren();
+	public Attributes getAttributes();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/Tree.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,6 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core;
+
+public interface Tree
+{
+	public Node getRoot();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/ChangeSet.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,14 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store;
+
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Tree;
+
+public interface ChangeSet
+{
+	public Tree getTree();
+	public ChangeSet prev();
+	
+	public String uuid();
+	public long revision();
+	
+	public Iterable<Command> getCommands();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/Command.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,6 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store;
+
+public enum Command
+{
+	APPEND_CHILD_BEHIND,APPEND_CHILD_INFRONT,DELETE_CHILD,PUT_ATTRIBUTE,DELETE_ATTRIBUTE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/Constants.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,7 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store;
+
+public class Constants
+{
+	public static final String DEFAULT_OWNER = "default";
+	public static final long DEFAULT_REVISION_START_NUMBER = 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/NodePath.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,6 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store;
+
+public interface NodePath extends Iterable<Integer>
+{
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/Result.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,12 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store;
+
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.NodePath;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Tree;
+
+public interface Result
+{
+	public Tree getNewTree();
+	public NodePath getClonedPath();
+	public Node getEffect();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/TreeEditor.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,17 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store;
+
+import java.nio.ByteBuffer;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Tree;
+
+public interface TreeEditor
+{
+	public Tree getTree();
+	public Result appendChildBehindOf(NodePath _path);
+	public Result appendChildInfrontOf(NodePath _path);
+	public Result deleteChild(NodePath _path);
+	
+	public Result putAttribute(NodePath _path,ByteBuffer _key,ByteBuffer _value);
+	public Result deleteAttribute(NodePath _path,ByteBuffer _key,ByteBuffer _value);
+	
+	public boolean success();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/TreeStore.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,9 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store;
+
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.traverser.Traverser;
+
+public interface TreeStore
+{
+	public TreeEditor getCurrentTree();
+	public Traverser getTraverser();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/AttributesImpl.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,42 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl;
+
+import java.nio.ByteBuffer;
+
+import fj.Ord;
+import fj.data.Option;
+import fj.data.TreeMap;
+
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Attributes;
+
+public class AttributesImpl implements Attributes
+{
+	private final TreeMap<String,ByteBuffer> attrs;
+	private static final TreeMap<String,ByteBuffer> EMPTY = TreeMap.empty(Ord.stringOrd);
+	
+	public AttributesImpl()
+	{
+		this(EMPTY);
+	}
+	
+	private AttributesImpl(TreeMap<String,ByteBuffer> _attrs)
+	{
+		attrs = _attrs;
+	}
+	
+	public AttributesImpl remove(String _key)
+	{
+		return new AttributesImpl(attrs.delete(_key));
+	}
+	
+	public AttributesImpl put(String _key,ByteBuffer _value)
+	{
+		return new AttributesImpl(attrs.set(_key,_value));
+	}
+
+	@Override
+	public ByteBuffer get(String _key)
+	{
+		Option<ByteBuffer> result = attrs.get(_key);
+		return result.isSome() ? result.some() : null;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/ChangeSetImpl.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,55 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl;
+
+import fj.data.List;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Tree;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.ChangeSet;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command;
+
+public class ChangeSetImpl implements ChangeSet
+{
+	private final ChangeSet prev;
+	private final String uuid;
+	private final long revision;
+	
+	private final List<Command> commands;
+	private final Tree tree;
+	
+	public ChangeSetImpl(Tree _tree,List<Command> _commands,String _uuid,long _revision,ChangeSet _prev)
+	{
+		tree = _tree;
+		commands = _commands;
+		uuid = _uuid;
+		revision = _revision;
+		prev = _prev;
+	}
+
+	@Override
+	public ChangeSet prev()
+	{
+		return prev;
+	}
+
+	@Override
+	public String uuid()
+	{
+		return uuid;
+	}
+
+	@Override
+	public long revision()
+	{
+		return revision;
+	}
+
+	@Override
+	public Iterable<Command> getCommands()
+	{
+		return commands;
+	}
+
+	@Override
+	public Tree getTree()
+	{
+		return tree;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/ChildrenImpl.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,63 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl;
+
+import java.util.Iterator;
+
+import fj.P2;
+import fj.data.List;
+
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Children;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node;
+
+public class ChildrenImpl implements Children
+{
+	private final List<Node> children;
+	private static final List<Node> EMPTY = List.nil();
+	
+	public ChildrenImpl()
+	{
+		this(EMPTY);
+	}
+	
+	public ChildrenImpl(List<Node> _children)
+	{
+		children = _children;
+	}
+	
+	public ChildrenImpl add(Node _newNode)
+	{
+		return new ChildrenImpl(children.snoc(_newNode));
+	}
+	
+	public ChildrenImpl insert(Node _newNode,int _pos) 
+	{
+		check(_pos);
+		
+		P2<List<Node>,List<Node>> split = children.splitAt(_pos);
+		List<Node> newChildren = split._1().snoc(_newNode).append(split._2());
+		
+		return new ChildrenImpl(newChildren);
+	}
+	
+	public ChildrenImpl delete(int _pos)
+	{
+		check(_pos);
+		
+		P2<List<Node>,List<Node>> split = children.splitAt(_pos);
+		List<Node> newChildren = split._1().init().append(split._2());
+		
+		return new ChildrenImpl(newChildren);
+	}
+	
+	public void check(int _pos)
+	{
+		if(children.length() < _pos){
+			throw new IllegalArgumentException("_pos > length");
+		}
+	}
+
+	@Override
+	public Iterator<Node> iterator()
+	{
+		return null;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/ModifiedTreeEditorImpl.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,57 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl;
+
+import java.nio.ByteBuffer;
+
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.NodePath;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Tree;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Result;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.TreeEditor;
+
+public class ModifiedTreeEditorImpl implements TreeEditor
+{
+
+	@Override
+	public Tree getTree() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Result appendChildBehindOf(NodePath _path) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Result appendChildInfrontOf(NodePath _path) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Result deleteChild(NodePath _path) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Result putAttribute(NodePath _path, ByteBuffer _key,
+			ByteBuffer _value) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Result deleteAttribute(NodePath _path, ByteBuffer _key,
+			ByteBuffer _value) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean success() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/NodeImpl.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,28 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl;
+
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Attributes;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Children;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node;
+
+public class NodeImpl implements Node
+{
+	public AttributesImpl attrs;
+	public ChildrenImpl children;
+	
+	public NodeImpl()
+	{
+		attrs = new AttributesImpl();
+	}
+
+	@Override
+	public Children getChildren()
+	{
+		return children;
+	}
+
+	@Override
+	public Attributes getAttributes()
+	{
+		return attrs;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/TreeEditorImpl.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,64 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl;
+
+import java.nio.ByteBuffer;
+
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.NodePath;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Tree;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.ChangeSet;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Result;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.TreeEditor;
+
+public class TreeEditorImpl implements TreeEditor
+{
+	private ChangeSet currentChangeSet;
+	
+	public TreeEditorImpl(ChangeSet _changeSet)
+	{
+		currentChangeSet = _changeSet;
+	}
+
+	@Override
+	public Tree getTree()
+	{
+		return currentChangeSet.getTree();
+	}
+	
+	@Override
+	public Result appendChildBehindOf(NodePath _path)
+	{
+		return null;
+	}
+
+	@Override
+	public Result appendChildInfrontOf(NodePath _path)
+	{
+		return null;
+	}
+
+	@Override
+	public Result deleteChild(NodePath _path)
+	{
+		return null;
+	}
+
+	@Override
+	public Result putAttribute(NodePath _path, ByteBuffer _key,
+			ByteBuffer _value) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Result deleteAttribute(NodePath _path, ByteBuffer _key,
+			ByteBuffer _value) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean success()
+	{
+		return false;
+	}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/TreeImpl.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,22 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl;
+
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Tree;
+
+public class TreeImpl implements Tree
+{
+	private final NodeImpl root;
+	
+	public static final TreeImpl EMPTY = new TreeImpl();
+	
+	public TreeImpl()
+	{
+		root = new NodeImpl();
+	}
+
+	@Override
+	public Node getRoot()
+	{
+		return root;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/TreeRepository.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,33 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl;
+
+import java.util.concurrent.atomic.AtomicReference;
+
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Constants;
+
+import fj.data.List;
+
+public class TreeRepository
+{
+	private final AtomicReference<ChangeSetImpl> changeSet;
+	
+	public TreeRepository()
+	{
+		List<Command> emptyCommands = List.nil();
+		
+		changeSet = new AtomicReference<ChangeSetImpl>(
+				new ChangeSetImpl(TreeImpl.EMPTY,emptyCommands,
+						Constants.DEFAULT_OWNER,Constants.DEFAULT_REVISION_START_NUMBER,null)
+			);
+	}
+	
+	public ChangeSetImpl getCurrentChangeSet()
+	{
+		return changeSet.get();
+	}
+	
+	public boolean commitChangeSet(ChangeSetImpl _newChangeSet,ChangeSetImpl _currentChangeSet)
+	{
+		return changeSet.compareAndSet(_currentChangeSet,_newChangeSet);
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/TreeStoreImpl.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,22 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl;
+
+import java.util.concurrent.atomic.AtomicReference;
+
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.TreeEditor;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.TreeStore;
+
+public class TreeStoreImpl implements TreeStore
+{
+	public TreeRepository repository;
+	
+	public TreeStoreImpl()
+	{
+		repository = new TreeRepository();
+	}
+
+	@Override
+	public TreeEditor getCurrentTree()
+	{
+		return new TreeEditorImpl(repository.getCurrentChangeSet());
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/DefaultEvaluation.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,21 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.traverser;
+
+public class DefaultEvaluation implements Evaluation
+{
+	public DefaultEvaluation(long _result,TraverseEvaluator _evaluator)
+	{
+		
+	}
+
+	@Override
+	public long result() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public TraverseEvaluator evaluator() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/DefaultTraverseEvaluator.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,39 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.traverser;
+
+import java.util.Iterator;
+
+import fj.data.List;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node;
+
+public class DefaultTraverseEvaluator implements TraverseEvaluator , Iterable<Integer>
+{
+	public List<Integer> path;
+	public static List<Integer> EMPTY = List.nil();
+	
+	public DefaultTraverseEvaluator()
+	{
+		this(EMPTY);
+	}
+	
+	private DefaultTraverseEvaluator(List<Integer> _path)
+	{
+		path = _path;
+	}
+	
+	public DefaultTraverseEvaluator add(Integer _next)
+	{
+		
+	}
+
+	@Override
+	public Evaluation eval(Iterable<Node> _currentPosition,Node _child,int _pos)
+	{
+		return ;
+	}
+
+	@Override
+	public Iterator<Integer> iterator()
+	{
+		return path.iterator();
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/DefaultTraverser.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,75 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.traverser;
+
+import java.util.Iterator;
+
+import fj.P;
+import fj.P2;
+import fj.data.List;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Tree;
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.IterableWrapper;
+
+public class DefaultTraverser implements Traverser
+{
+	@Override
+	public Iterable<TraverseResult> traverse(Tree _tree, TraverseEvaluator _evaluator)
+	{
+		Node root = _tree.getRoot();
+		
+		List<Node> current = List.nil();
+		TraverseEvaluator evaluator = _evaluator;
+		
+		List<TraverseResultImpl> totalResult = _traverse(current,root,evaluator);
+		
+		return new IterableWrapper<TraverseResult>(totalResult);
+	}
+	
+	private List<TraverseResultImpl> _traverse(List<Node> _path,Node _current,TraverseEvaluator _evaluator)
+	{
+		List<Node> currentPath = _path.snoc(_current);
+		
+		int pos = 0;
+		List<P2<Node,Evaluation>> accepted = List.nil();
+		
+		for(Node child : _current.getChildren()){
+			Evaluation e = _evaluator.eval(currentPath,child,pos);
+			long result = e.result();
+			
+			if(result == TraverseEvaluator.ACCEPT_AND_CONTINUE ||
+					result == TraverseEvaluator.ACCEPT_AND_BREAK){
+				accepted = accepted.snoc(P.p(child,e));
+			}
+			
+			if(result == TraverseEvaluator.DENY_AND_BREAK || 
+					result == TraverseEvaluator.ACCEPT_AND_BREAK){
+				break;
+			}
+		}
+		
+		List<TraverseResultImpl> totalResult = List.nil();
+		for(P2<Node,Evaluation> next : accepted){
+			Node node = next._1();
+			TraverseEvaluator evaluator = next._2().evaluator();
+			List<TraverseResultImpl> result = _traverse(currentPath,node,evaluator);
+			totalResult = totalResult.append(result);
+		}
+		
+		return totalResult;
+	}
+	
+	public static class TraverseResultImpl implements TraverseResult
+	{
+		private final List<Node> result;
+		
+		public TraverseResultImpl(List<Node> _result)
+		{
+			result = _result;
+		}
+
+		@Override
+		public Iterator<Node> iterator()
+		{
+			return result.iterator();
+		}
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/Evaluation.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,12 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.traverser;
+
+public interface Evaluation
+{
+	public static final long ACCEPT_CONTINUE = 0;
+	public static final long DENY_CONTINUE = 1;
+	public static final long ACCEPT_BREAK = 2;
+	public static final long DENY_BREAK = 3;
+	
+	public long result();
+	public TraverseEvaluator evaluator();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/TraverseEvaluator.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,13 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.traverser;
+
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node;
+
+public interface TraverseEvaluator
+{
+	public static final long ACCEPT_AND_CONTINUE = 0;
+	public static final long DENY_AND_CONTINUE = 1;
+	public static final long ACCEPT_AND_BREAK = 2;
+	public static final long DENY_AND_BREAK = 3;
+	
+	public Evaluation eval(Iterable<Node> _currentPosition,Node _child,int _pos);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/TraverseResult.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,8 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.traverser;
+
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node;
+
+public interface TraverseResult extends Iterable<Node>
+{
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/traverser/Traverser.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,8 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.traverser;
+
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Tree;
+
+public interface Traverser
+{
+	public Iterable<TraverseResult> traverse(Tree _tree,TraverseEvaluator _evaluator);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/util/IterableWrapper.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,47 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util;
+
+import java.util.Iterator;
+
+public class IterableWrapper<T> implements Iterable<T>
+{
+	private final Iterable<? extends T> iterable;
+	
+	public IterableWrapper(Iterable<? extends T> _iterable)
+	{
+		iterable = _iterable;
+	}
+
+	@Override
+	public Iterator<T> iterator()
+	{
+		return new IteratorWrapper();
+	}
+
+	public class IteratorWrapper implements Iterator<T>
+	{
+		private final Iterator<? extends T> iterator;
+		
+		public IteratorWrapper()
+		{
+			iterator = iterable.iterator();
+		}
+
+		@Override
+		public boolean hasNext()
+		{
+			return iterator.hasNext();
+		}
+
+		@Override
+		public T next()
+		{
+			return iterator.next();
+		}
+
+		@Override
+		public void remove()
+		{
+			iterator.remove();
+		}
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/util/Pair.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,23 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util;
+
+public class Pair<L,R>
+{
+	private L left;
+	private R right;
+	
+	public Pair(L _left,R _right)
+	{
+		left = _left;
+		right = _right;
+	}
+	
+	public L left()
+	{
+		return left;
+	}
+	
+	public R right()
+	{
+		return right;
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/util/Triple.java	Mon Dec 10 18:50:53 2012 +0900
@@ -0,0 +1,45 @@
+package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util;
+
+public class Triple<A,B,C>
+{
+	private A a;
+	private B b;
+	private C c;
+	
+	public Triple(A _a,B _b,C _c)
+	{
+		a = _a;
+		b = _b;
+		c = _c;
+	}
+	
+	public A getA()
+	{
+		return a;
+	}
+	
+	public B getB()
+	{
+		return b;
+	}
+	
+	public C getC()
+	{
+		return c;
+	}
+	
+	public void setA(A _a)
+	{
+		a = _a;
+	}
+	
+	public void setB(B _b)
+	{
+		b = _b;
+	}
+	
+	public void setC(C _c)
+	{
+		c = _c;
+	}
+}
--- a/src/main/java/jungle/core/App.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-package jungle.core;
-
-/**
- * Hello world!
- *
- */
-public class App 
-{
-    public static void main( String[] args )
-    {
-        System.out.println( "Hello World!" );
-    }
-}
--- a/src/main/java/jungle/core/Attributes.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-package jungle.core;
-
-public interface Attributes
-{
-	public String get(String _key);
-	public boolean contains(String _key);
-	public int size();
-	
-	public Attributes remove(String _key);
-	public Attributes put(String _key,String _value);
-}
--- a/src/main/java/jungle/core/Children.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-package jungle.core;
-
-public interface Children extends Iterable<TreeNode>
-{
-	public TreeNode getAt(int _pos);
-	public boolean contains(TreeNode n);
-	public int size();
-}
--- a/src/main/java/jungle/core/Editor.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-package jungle.core;
-
-public interface Editor
-{
-	public Tree commit();
-	public Tree rollback();
-	
-	public Link createLinkAt(TreeNode _target,Tree _linkTarget);
-	public void removeLinkAt(TreeNode _target,Link _removeTarget);
-	
-	public TreeNode createChildAt(TreeNode _target);
-	public void removeChildAt(TreeNode _target,TreeNode _removeTarget);
-	
-	public String putPropertyAt(TreeNode _target,String _key,String _value);
-	public String removePropertyAt(TreeNode _target,String _key);
-}
--- a/src/main/java/jungle/core/Jungle.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-package jungle.core;
-
-public interface Jungle
-{
-	public TreeGroup createTreeGroup();
-	public TreeGroup createTreeGroup(String _id);
-	public TreeGroup getTreeGroupByID(String _id);
-}
--- a/src/main/java/jungle/core/Link.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-package jungle.core;
-
-public interface Link extends Node
-{
-	TreeGroup destination();
-}
--- a/src/main/java/jungle/core/Links.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-package jungle.core;
-
-public interface Links extends Iterable<Link>
-{
-	public Link getAt(int _pos);
-	public boolean contains(Link n);
-	public int size();
-}
--- a/src/main/java/jungle/core/Node.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-package jungle.core;
-
-public interface Node
-{
-	String get(String _key);
-}
--- a/src/main/java/jungle/core/Path.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-package jungle.core;
-
-public interface Path extends Iterable<Node>
-{
-	public Path removeAt(int _pos);
-	public Path removeTail();
-	public Path add(Node _tail);
-	public Node getAt(int _pos);
-}
--- a/src/main/java/jungle/core/Tree.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-package jungle.core;
-
-public interface Tree extends TreeNode
-{
-	TreeGroup getGroup();
-	String treeID();
-}
--- a/src/main/java/jungle/core/TreeGroup.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-package jungle.core;
-
-public interface TreeGroup
-{
-	String getID();
-	Tree latestTree();
-}
--- a/src/main/java/jungle/core/TreeNode.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-package jungle.core;
-
-public interface TreeNode extends Node
-{
-	Children children();
-	Links links();
-}
--- a/src/main/java/jungle/core/graph/EdgeList.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-package jungle.core.graph;
-
-import java.util.Collection;
-
-public interface EdgeList extends Iterable<Vertex>
-{
-	public int getLength();
-	public Vertex at(int _i);
-	public Collection<Vertex> asVertexCollection();
-	
-	public void appendVertex(Vertex _vertex);
-	public void appendVertexAt(Vertex _vertex,int _index);
-	public void appendVertexCollection(Collection<Vertex> _collection);
-	
-	public boolean removeFirst(Vertex _vertex);
-	public boolean removeFirst(Collection<Vertex> _collection);
-	public Vertex remove(int _index);
-	
-	public Vertex replace(Vertex _vertex,int _index);
-	public boolean replaceFirst(Vertex _vertex,Vertex _newVertex);
-	
-	public boolean compareAndSwap(int _index,Vertex _vertex,Vertex _newVertex);
-	public boolean contains(Vertex _vertex);
-	
-	public String getName();
-}
--- a/src/main/java/jungle/core/graph/Graph.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-package jungle.core.graph;
-
-/*
- * multiedge property graph
- */
-public interface Graph
-{
-	public Vertex getVertex(String _id);
-	public Vertex createVertex(String _id);
-	public Vertex createVertex();
-	public Vertex cloneVertex(Vertex _base);
-	public Vertex cloneVertex(String _id,Vertex _base);
-	
-	public boolean isSameGraph(Graph _g);
-}
--- a/src/main/java/jungle/core/graph/Vertex.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-package jungle.core.graph;
-
-public interface Vertex
-{
-	public String getID();
-	public boolean isSameVertex();
-	public Graph getOwnerGraph();
-	
-	public String getAttribute(String _key);
-	public void setAttribute(String _key,String _value);
-	public String setAttributeIfAbsent(String _key,String _value);
-	public Iterable<String> getAttributeKeys();
-	public String removeAttribute(String _key);
-	public boolean replaceAttribute(String _key,String _except,String _value);
-	
-	public Vertex getNamedEdgeAt(String _name,int _index);
-	public void appendEdge(String _name,Vertex _vertex);
-	public void insertEdge(String _name,int _index,Vertex _vertex);
-	public void removeEdge(String _name,Vertex _vertex);
-	public void replaceEdge(String _name,Vertex _expectVertex,Vertex _updateVertex);
-	public Iterable<String> getEdgeNames();
-}
--- a/src/main/java/jungle/core/graph/simple/SimpleGraph.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-package jungle.core.graph.simple;
-
-import java.util.Iterator;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicLong;
-
-import jungle.core.graph.Graph;
-import jungle.core.graph.Vertex;
-
-public class SimpleGraph implements Graph
-{
-	private final AtomicLong ids;
-	private final ConcurrentHashMap<String,SimpleVertex> vertexes;
-	
-	public SimpleGraph()
-	{
-		ids = new AtomicLong(0);
-		vertexes = new ConcurrentHashMap<String,SimpleVertex>();
-	}
-
-	@Override
-	public Vertex createVertex()
-	{
-		SimpleVertex vertex,newVertex;
-		do{
-			String id = Long.toString(ids.getAndIncrement());
-			newVertex = new SimpleVertex(this,id);
-			vertex = vertexes.putIfAbsent(id,newVertex);
-		}while(vertex != null);
-		
-		return newVertex;
-	}
-	
-	@Override
-	public boolean isSameGraph(Graph _g)
-	{
-		if(_g instanceof SimpleGraph){
-			return _g == this;
-		}
-		
-		return false;
-	}
-	
-	@Override
-	public Vertex createVertex(String _id)
-	{
-		SimpleVertex vertex = new SimpleVertex(this,_id);
-		SimpleVertex value = vertexes.putIfAbsent(_id,vertex);
-		return value != null ? value : vertex;
-	}
-	
-	@Override
-	public Vertex getVertex(String _id)
-	{
-		return vertexes.get(_id);
-	}
-
-	@Override
-	public Iterator<Vertex> vertexes()
-	{
-		final Iterator<SimpleVertex> itr = vertexes.values().iterator();
-		Iterator<Vertex> wrapper = new Iterator<Vertex>(){
-			@Override
-			public boolean hasNext()
-			{
-				return itr.hasNext();
-			}
-
-			@Override
-			public Vertex next()
-			{
-				return itr.next();
-			}
-
-			@Override
-			public void remove()
-			{
-				throw new UnsupportedOperationException("remove is not supported");
-			}
-		};
-		return wrapper;
-	}
-	
-	@Override
-	public Vertex createVertexFromTemplate(Vertex _template)
-	{
-		String newID = Long.toString(ids.incrementAndGet());
-		
-	}
-
-	@Override
-	public Vertex createVertexFromTemplate(String _id,Vertex _template)
-	{
-		if(_template instanceof SimpleVertex){
-			SimpleVertex template = (SimpleVertex)_template;
-			if(template.getGraph().equals(this)){
-				SimpleVertex newVertex = new SimpleVertex(this,_id,_template);
-				
-			}
-			
-			throw new IllegalArgumentException("_template is a vertex from other graph.");
-		}
-		
-		throw new IllegalArgumentException("_template is not a instance of SimpleVertex");
-	}
-}
--- a/src/main/java/jungle/core/graph/simple/SimpleVertex.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,249 +0,0 @@
-package jungle.core.graph.simple;
-
-import java.util.Iterator;
-import java.util.concurrent.atomic.AtomicReference;
-import fj.Ord;
-import fj.P2;
-import fj.data.Option;
-import fj.data.TreeMap;
-import jungle.core.graph.Graph;
-import jungle.core.graph.Vertex;
-import jungle.core.graph.Vertexes;
-import jungle.util.Pair;
-
-public class SimpleVertex implements Vertex
-{
-	private String id;
-	private final SimpleGraph parent;
-	private final AtomicReference<TreeMap<String,String>> propertiesHolder;
-	private final AtomicReference<TreeMap<String,SimpleVertexes>> relationsHolder;
-	
-	private static final TreeMap<String,String> EMPTY_PROPERTIES_MAP = TreeMap.empty(Ord.stringOrd);
-	private static final TreeMap<String,SimpleVertexes> EMPTY_RELATIONS_MAP = TreeMap.empty(Ord.stringOrd);
-	
-	public SimpleVertex(SimpleGraph _parent,String _id)
-	{
-		id = _id;
-		parent = _parent;
-		propertiesHolder = new AtomicReference<TreeMap<String,String>>(EMPTY_PROPERTIES_MAP);
-		relationsHolder = new AtomicReference<TreeMap<String,SimpleVertexes>>(EMPTY_RELATIONS_MAP);
-	}
-	
-	public SimpleVertex(SimpleGraph _parent,String _id,SimpleVertex _template)
-	{
-		id = _id;
-		parent = _parent;
-		
-		//get snapshot
-		TreeMap<String,String> snapshotProperties = _template.
-		
-		propertiesHolder = new AtomicReference<TreeMap<String,String>>();
-		relationsHolder = new AtomicReference<TreeMap<String,SimpleVertexes>>();
-	}
-	
-	private Pair<TreeMap<String,String>,TreeMap<String,SimpleVertexes>> createVertexSnapshot()
-	{
-		TreeMap<String,String> snapshotProperties = propertiesHolder.get();
-		TreeMap<String,SimpleVertexes> snapshotRelations = relationsHolder.get();
-		
-		return new Pair<TreeMap<Stirng,String>>
-	}
-	
-	void setID(String _id)
-	{
-		id = _id;
-	}
-	
-	@Override
-	public String setPropertyIfAbsent(String _key,String _value)
-	{
-		TreeMap<String,String> current,update;
-		do{
-			current = propertiesHolder.get();
-			Option<String> value = current.get(_key);
-			if(value.isSome()){
-				return value.some();
-			}
-			
-			update = current.set(_key,_value);
-		}while(!propertiesHolder.compareAndSet(current,update));
-		
-		return null;
-	}
-	
-	@Override
-	public String toString()
-	{
-		return id;
-	}
-	
-	@Override
-	public String getID()
-	{
-		return id;
-	}
-
-	@Override
-	public String getProperty(String _key)
-	{
-		TreeMap<String,String> current = propertiesHolder.get();
-		Option<String> nullOrValue = current.get(_key);
-		if(nullOrValue.isNone()){
-			return null;
-		}
-		
-		return nullOrValue.some();
-	}
-
-	@Override
-	public void setProperty(String _key, String _value)
-	{
-		TreeMap<String,String> current , update;
-		do{
-			current = propertiesHolder.get();
-			update = current.set(_key,_value);
-		}while(!propertiesHolder.compareAndSet(current,update));
-	}
-
-	@Override
-	public String removeProperty(String _key)
-	{
-		if(_key == null){
-			throw new NullPointerException("_key is null");
-		}
-		
-		String remove;
-		TreeMap<String,String> current , update;
-		do{
-			current = propertiesHolder.get();
-			Option<String> nullOrValue = current.get(_key);
-			if(nullOrValue.isNone()){
-				return null;
-			}
-			
-			remove = nullOrValue.some();
-			update = current.delete(_key);
-		}while(!propertiesHolder.compareAndSet(current,update));
-		
-		return remove;
-	}
-
-	@Override
-	public Vertexes getVertexes(String _key)
-	{
-		if(_key == null){
-			throw new NullPointerException("_key is null");
-		}
-		
-		TreeMap<String,SimpleVertexes> current = relationsHolder.get();
-		Option<SimpleVertexes> nullOrValue = current.get(_key);
-		if(nullOrValue.isNone()){
-			return null;
-		}
-		
-		return nullOrValue.some();
-	}
-	
-	@Override
-	public Vertexes removeVertexes(String _type)
-	{
-		if(_type == null){
-			throw new NullPointerException("_type is null");
-		}
-		
-		SimpleVertexes remove;
-		TreeMap<String,SimpleVertexes> current , update;
-		do{
-			current = relationsHolder.get();
-			Option<SimpleVertexes> nullOrValue = current.get(_type);
-			if(nullOrValue.isNone()){
-				return null;
-			}
-			
-			remove = nullOrValue.some();
-			update = current.delete(_type);
-		}while(!relationsHolder.compareAndSet(current,update));
-		
-		return remove;
-	}
-
-	@Override
-	public boolean compareAndSwapProprety(String _key,final String _except,final String _value)
-	{
-		if(_key == null || _except == null || _value == null){
-			throw new NullPointerException("_key or _except or _value is null");
-		}
-		
-		TreeMap<String,String> current , update;
-		do{
-			current = propertiesHolder.get();
-			Option<String> nullOrValue = current.get(_key);
-			if(nullOrValue.isNone()){
-				return false;
-			}
-			
-			String value = nullOrValue.some();
-			if(!value.equals(_except)){
-				return false;
-			}
-			
-			update = current.set(_key,_value);
-		}while(!propertiesHolder.compareAndSet(current,update));
-		
-		return true;
-	}
-	
-	@Override
-	public Graph getGraph()
-	{
-		return parent;
-	}
-
-	@Override
-	public Vertexes createVertexes(String _type)
-	{
-		TreeMap<String,SimpleVertexes> current , update;
-		
-		SimpleVertexes newVertexes;
-		do{
-			current = relationsHolder.get();
-			Option<SimpleVertexes> nullOrValue = current.get(_type);
-			if(nullOrValue.isSome()){
-				return null;
-			}
-			
-			newVertexes = new SimpleVertexes(_type,parent);
-			update = current.set(_type,newVertexes);
-		}while(!relationsHolder.compareAndSet(current,update));
-		
-		return newVertexes;
-	}
-
-	@Override
-	public Iterable<Pair<String,String>> getProperties()
-	{
-		final TreeMap<String,String> snapshot = propertiesHolder.get();
-		Iterable<Pair<String,String>> snapshotIterableWrapper = new Iterable<Pair<String,String>>(){
-			@Override
-			public Iterator<Pair<String, String>> iterator(){
-				return new Iterator<Pair<String,String>>(){
-					Iterator<P2<String,String>> snapshotKeyValueIterator = snapshot.iterator();
-					@Override
-					public boolean hasNext(){
-						return snapshotKeyValueIterator.hasNext();
-					}
-					@Override
-					public Pair<String, String> next(){
-						P2<String,String> keyValue = snapshotKeyValueIterator.next();
-						return new Pair<String,String>(keyValue._1(),keyValue._2());
-					}
-					@Override
-					public void remove() {
-						throw new UnsupportedOperationException("removing is not supported.");
-					}
-				};
-			}
-		};
-		return snapshotIterableWrapper;
-	}
-}
--- a/src/main/java/jungle/core/graph/simple/SimpleVertexContext.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-package jungle.core.graph.simple;
-
-import java.util.concurrent.atomic.AtomicReference;
-
-import fj.Ord;
-import fj.data.List;
-import fj.data.TreeMap;
-
-public class SimpleVertexContext
-{
-	private final AtomicReference<TreeMap<String,String>> propertiesHolder;
-	private final AtomicReference<TreeMap<String,List<SimpleVertex>>> relationsHolder;
-	
-	private static final TreeMap<String,String> NIL_PROPERTIES = TreeMap.empty(Ord.stringOrd);
-	private static final TreeMap<String,List<SimpleVertex>> NIL_RELATIONS = TreeMap.empty(Ord.stringOrd);
-	
-	public SimpleVertexContext()
-	{
-		this(NIL_PROPERTIES,NIL_RELATIONS);
-	}
-	
-	public SimpleVertexContext(TreeMap<String,String> _properties,TreeMap<String,List<SimpleVertex>> _relations)
-	{
-		if(_properties == null || _relations == null){
-			throw new NullPointerException("_properties and _relations must not be null.");
-		}
-		
-		propertiesHolder = new AtomicReference<TreeMap<String,String>>(_properties);
-		relationsHolder = new AtomicReference<TreeMap<String,List<SimpleVertex>>>(_relations);
-	}
-	
-	public TreeMap<String,String> getProperties()
-	{
-		return propertiesHolder.get();
-	}
-	
-	public boolean compareAndSwapProperties(TreeMap<String,String> _expect,TreeMap<String,String> _update)
-	{
-		return propertiesHolder.compareAndSet(_expect,_update);
-	}
-	
-	public TreeMap<String,List<SimpleVertex>> getRelations()
-	{
-		return relationsHolder.get();
-	}
-	
-	public boolean compareAndSwapRelations(TreeMap<String,List<SimpleVertex>> _expect,
-			TreeMap<String,List<SimpleVertex>> _update)
-	{
-		return relationsHolder.compareAndSet(_expect,_update);
-	}
-	
-	public SimpleVertexContext snapshot()
-	{
-		TreeMap<String,String> propertiesSnapshot = propertiesHolder.get();
-		TreeMap<String,List<SimpleVertex>> relationsSnapshot = null;
-		
-		do{
-			relationsSnapshot = relationsHolder.get();
-		}while(!(propertiesHolder.get() == propertiesSnapshot));
-		
-		return new SimpleVertexContext(propertiesSnapshot,relationsSnapshot);
-	}
-}
--- a/src/main/java/jungle/core/graph/simple/SimpleVertexes.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,424 +0,0 @@
-package jungle.core.graph.simple;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.concurrent.atomic.AtomicReference;
-
-import fj.Equal;
-import fj.F;
-import fj.P2;
-import fj.data.List;
-import fj.data.Option;
-
-import jungle.core.graph.Graph;
-import jungle.core.graph.Vertex;
-import jungle.core.graph.Vertexes;
-
-public class SimpleVertexes implements Vertexes
-{
-	private final String type;
-	private final SimpleVertexContext context;
-	private final SimpleGraph parent;
-	
-	public SimpleVertexes(String _type,SimpleGraph _parent,SimpleVertexContext _context)
-	{
-		parent = _parent;
-		type = _type;
-		context = _context;
-	}
-	
-	@Override
-	public String toString()
-	{
-		return context.getRelations().get(type).toString();
-	}
-	
-	
-	@Override
-	public Vertex remove(final int _index)
-	{
-		if(_index < 0){
-			throw new IndexOutOfBoundsException("_index < 0");
-		}
-		
-		SimpleVertex head = null;
-		TreeMap<String,List<SimpleVertex>> current = null,update = null;
-		do{
-			Option<List<SimpleVertex>> value = context.getRelations().get(type);
-			
-			if(current.length() < _index + 1){
-				throw new IndexOutOfBoundsException("list.length() < _index");
-			}
-			
-			P2<List<SimpleVertex>,List<SimpleVertex>> slice = current.splitAt(_index);
-			head = slice._2().head();
-			update = slice._1().append(slice._2().drop(1));
-		}while(!vertexes.compareAndSet(current,update));
-		
-		return head;
-	}
-
-	@Override
-	public int size()
-	{
-		return vertexes.get().length();
-	}
-	
-	@Override
-	public Graph getGraph()
-	{
-		return parent;
-	}
-
-	@Override
-	public void add(Vertex _v)
-	{
-		if(_v.getGraph() != parent){
-			throw new IllegalArgumentException("Vertex _v is not belongs to same graph");
-		}
-		
-		if(!(_v instanceof SimpleVertex)){
-			throw new IllegalArgumentException("Vertex _v is not instanceof SimpleVertex");
-		}
-		
-		List<SimpleVertex> cur,update;
-		do{
-			cur = vertexes.get();
-			update = cur.append(List.list((SimpleVertex)_v));
-		}while(!vertexes.compareAndSet(cur,update));
-	}
-	
-	@Override
-	public void add(Vertexes _vs)
-	{
-		if(!(_vs instanceof SimpleVertexes)){
-			throw new IllegalArgumentException("Vertexes _vs is not instanceof SimpleVertex");
-		}
-		
-		List<SimpleVertex> list = ((SimpleVertexes)_vs).vertexes.get();
-		
-		List<SimpleVertex> cur,update;
-		do{
-			cur = vertexes.get();
-			update = cur.append(list);
-		}while(!vertexes.compareAndSet(cur,update));
-	}
-	
-	@Override
-	public boolean contains(final Vertex _v)
-	{
-		if(_v.getGraph() != parent){
-			throw new IllegalArgumentException("Vertex _v is not a member of graph");
-		}
-		
-		List<SimpleVertex> list = vertexes.get();
-		F<SimpleVertex,Boolean> predicate = new F<SimpleVertex,Boolean>(){
-			@Override
-			public Boolean f(SimpleVertex _target)
-			{
-				return _v == _target;
-			}
-		};
-		
-		return list.exists(predicate);
-	}
-	
-	@Override
-	public Iterator<Vertex> iterator()
-	{
-		List<SimpleVertex> list = vertexes.get();
-		final Iterator<SimpleVertex> itr = list.iterator();
-		Iterator<Vertex> wrapper = new Iterator<Vertex>(){
-
-			@Override
-			public boolean hasNext()
-			{
-				return itr.hasNext();
-			}
-
-			@Override
-			public Vertex next()
-			{
-				return itr.next();
-			}
-
-			@Override
-			public void remove()
-			{
-				throw new UnsupportedOperationException("removing is not supported");
-			}
-		};
-		
-		return wrapper;
-	}
-	
-	@Override
-	public String type()
-	{
-		return type;
-	}
-	
-	public static Equal<SimpleVertex> VERTEX_EQUAL = Equal.equal(
-		new F<SimpleVertex,F<SimpleVertex,Boolean>>(){
-			@Override
-			public F<SimpleVertex, Boolean> f(final SimpleVertex _v1){
-				return new F<SimpleVertex,Boolean>(){
-					@Override
-					public Boolean f(SimpleVertex _v2){
-						return _v1 == _v2;
-					}
-				};
-			}
-		});
-
-	@Override
-	public boolean removeFirst(final Vertex _v)
-	{
-		if(_v == null){
-			throw new NullPointerException("_v is null");
-		}
-		
-		if(_v instanceof SimpleVertex){
-			SimpleGraph g = (SimpleGraph)_v.getGraph();
-			if(g != parent){
-				throw new IllegalArgumentException("_v is not a part of graph");
-			}
-		}else{
-			throw new IllegalArgumentException("_v is not instanceof SimpleVertex it was " + _v.getClass().getName());
-		}
-		
-		List<SimpleVertex> list,update;
-		do{
-			list = vertexes.get();
-			update = list.delete((SimpleVertex)_v,VERTEX_EQUAL);
-		}while(!vertexes.compareAndSet(list,update));
-		
-		// list and update 's length are different when removing is succeeded
-		return list.length() != update.length();
-	}
-	
-	public Collection<Vertex> toCollection()
-	{
-		Collection<? extends Vertex> c = vertexes.get().toCollection();
-		return Collections.unmodifiableCollection(c);
-	}
-
-	@Override
-	public boolean removeFirst(Vertexes _vs)
-	{
-		if(_vs == null){
-			throw new NullPointerException("_vs is null");
-		}
-		
-		if(_vs instanceof SimpleVertexes){
-			Collection<Vertex> vs = ((SimpleVertexes)_vs).toCollection();
-			return removeFirst(vs);
-		}
-	
-		throw new IllegalArgumentException("_vs is not a instanceof SimpleVertexes");
-	}
-	
-	@Override
-	public boolean removeFirst(final Collection<Vertex> _vs)
-	{
-		if(_vs == null){
-			throw new NullPointerException("_vs is null");
-		}
-		
-		final HashSet<Vertex> tmp = new HashSet<Vertex>(_vs);
-		F<SimpleVertex,Boolean> predicate = new F<SimpleVertex,Boolean>(){
-			@Override
-			public Boolean f(SimpleVertex _target){
-				return tmp.remove(_target);
-			}
-		};
-		
-		List<SimpleVertex> list,update;
-		do{
-			list = vertexes.get();
-			update = list.removeAll(predicate);
-		}while(!vertexes.compareAndSet(list,update));
-		
-		return list.length() != update.length();
-	}
-
-	@Override
-	public Vertex at(int _index)
-	{
-		List<SimpleVertex> list = vertexes.get();
-		
-		if(_index < 0){
-			throw new IndexOutOfBoundsException("index is muinus.");
-		}
-		
-		if(list.length() < _index + 1){
-			throw new IndexOutOfBoundsException("vertex.length() < _index");
-		}
-		
-		return list.take(_index + 1).last();
-	}
-
-	@Override
-	public void add(Vertex _v, int _index)
-	{
-		
-		if(_v instanceof SimpleVertex){
-			throw new IllegalArgumentException("_v is not a SimpleVertex");
-		}
-		
-		
-		List<SimpleVertex> list = null,update = null;
-		do{
-			list = vertexes.get();
-			if(list.length() < _index){
-				throw new IndexOutOfBoundsException("vertex.length() < _index");
-			}
-			P2<List<SimpleVertex>,List<SimpleVertex>> slice = list.splitAt(_index);
-			
-			update = slice._1().snoc((SimpleVertex)_v).append(slice._2());
-		}while(!vertexes.compareAndSet(list,update));
-	}
-
-	@Override
-	public void add(Collection<Vertex> _vs)
-	{
-		final Iterator<Vertex> itr = _vs.iterator();
-		Iterable<SimpleVertex> wrapper = new Iterable<SimpleVertex>(){
-			@Override
-			public Iterator<SimpleVertex> iterator() {
-				return new Iterator<SimpleVertex>(){
-					@Override
-					public boolean hasNext(){
-						return itr.hasNext();
-					}
-					@Override
-					public SimpleVertex next(){
-						Vertex v = itr.next();
-						if(!(v instanceof SimpleVertex)){
-							throw new IllegalArgumentException("_vs is including not a SimpleVertex instance.");
-						}
-						
-						if(v.getGraph() != parent){
-							throw new IllegalArgumentException("_vs has vertex from other graph instance");
-						}
-						return (SimpleVertex)v;
-					}
-					@Override
-					public void remove(){
-						throw new UnsupportedOperationException("removeing is not supported.");
-					}
-				};
-			}
-		};
-		
-		List<SimpleVertex> a = List.iterableList(wrapper);
-		
-		List<SimpleVertex> current = null,update = null;
-		do{
-			current = vertexes.get();
-			update = current.append(a);
-		}while(!vertexes.compareAndSet(current,update));
-	}
-
-	@Override
-	public Vertex replace(Vertex _v, int _index)
-	{
-		if(_index < 0){
-			throw new IndexOutOfBoundsException("_index is muinus");
-		}
-		
-		if(_v == null){
-			throw new NullPointerException("_v is null");
-		}
-		
-		if(!(_v instanceof SimpleVertex)){
-			throw new IllegalArgumentException("_v is not a instanceof SimpleVertex");
-		}
-		
-		SimpleVertex head = null;
-		List<SimpleVertex> current = null,update = null;
-		do{
-			current = vertexes.get();
-			if(current.length() < _index + 1){
-				throw new IndexOutOfBoundsException("current.length() < _index");
-			}
-		
-			P2<List<SimpleVertex>,List<SimpleVertex>> slice = current.splitAt(_index);
-			head = slice._2().head();
-			update = slice._1().snoc((SimpleVertex)_v).append(slice._2().drop(1));
-		}while(!vertexes.compareAndSet(current,update));
-		
-		return head;
-	}
-
-	@Override
-	public boolean replaceFirst(final Vertex _vertex, Vertex _newVertex)
-	{
-		if(_vertex == null || _newVertex == null){
-			throw new NullPointerException("_vertex or _newVertex is null");
-		}
-		
-		if(!(_vertex instanceof SimpleVertex) || !(_newVertex instanceof SimpleVertex)){
-			throw new IllegalArgumentException("_v is not a instanceof SimpleVertex");
-		}
-		
-		F<SimpleVertex,Boolean> predicate = new F<SimpleVertex,Boolean>(){
-			@Override
-			public Boolean f(SimpleVertex _vertex2){
-				return _vertex != _vertex2;
-			}
-		};
-		
-		List<SimpleVertex> current = vertexes.get(),update = null;
-		do{
-			P2<List<SimpleVertex>,List<SimpleVertex>> slice = current.span(predicate);
-			if(slice._2().length() == 0){
-				// not found.
-				return false;
-			}
-			
-			update = slice._1().append(slice._2().drop(1).cons((SimpleVertex)_newVertex));
-		}while(!vertexes.compareAndSet(current,update));
-		
-		return true;
-	}
-
-	@Override
-	public boolean compareAndSwap(int _index, Vertex _vertex, Vertex _newVertex)
-	{
-		List<SimpleVertex> current = vertexes.get();
-		
-		if(_vertex == null || _newVertex == null){
-			throw new NullPointerException("_vertex or _newVertex is null");
-		}
-		
-		if(current.length() < _index + 1 || _index < 0){
-			throw new IndexOutOfBoundsException("list.length() < _index or _index < 0");
-		}
-		
-		final SimpleVertex v1 = (SimpleVertex)_vertex;
-		SimpleVertex v2 = (SimpleVertex)_newVertex;
-		
-		List<SimpleVertex> update = null;
-		do{
-			P2<List<SimpleVertex>,List<SimpleVertex>> slice = current.splitAt(_index);
-			SimpleVertex head = slice._2().head();
-			if(head != v1){
-				return false;
-			}
-			
-			update = slice._1().append(slice._2().drop(1).cons(v2));
-		}while(!vertexes.compareAndSet(current,update));
-		
-		return true;
-	}
-	
-	@Override
-	public int hashCode()
-	{
-		return context.
-	}
-}
\ No newline at end of file
--- a/src/main/java/jungle/impl/SimpleAttributes.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-package jungle.impl;
-
-import java.util.concurrent.ConcurrentHashMap;
-
-import jungle.core.Attributes;
-
-public class SimpleAttributes implements Attributes
-{
-	private final ConcurrentHashMap<String,String> attrs;
-	
-	public SimpleAttributes()
-	{
-		this(new ConcurrentHashMap<String,String>());
-	}
-	
-	private SimpleAttributes(ConcurrentHashMap<String,String> _attrs)
-	{
-		attrs = _attrs;
-	}
-
-	public String get(String _key)
-	{
-		return attrs.get(_key);
-	}
-
-	public boolean contains(String _key)
-	{
-		return attrs.contains(_key);
-	}
-
-	public int size()
-	{
-		return attrs.size();
-	}
-
-	public Attributes remove(String _key)
-	{
-		ConcurrentHashMap<String,String> copy = copy();
-		copy.remove(_key);
-		return new SimpleAttributes(copy);
-	}
-
-	public Attributes put(String _key, String _value)
-	{
-		ConcurrentHashMap<String,String> copy = copy();
-		copy.put(_key,_value);
-		return new SimpleAttributes(copy);
-	}
-	
-	private ConcurrentHashMap<String,String> copy()
-	{
-		return new ConcurrentHashMap<String,String>(attrs);
-	}
-
-}
--- a/src/main/java/jungle/impl/SimpleChildren.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-package jungle.impl;
-
-import java.util.Iterator;
-import jungle.core.Children;
-import jungle.core.TreeGroup;
-import jungle.core.TreeNode;
-import jungle.core.graph.Graph;
-import jungle.core.graph.Vertex;
-import jungle.core.graph.Vertexes;
-
-public class SimpleChildren implements Children
-{
-	private final SimpleTreeGroup group;
-	private final Graph graph;
-	private final Vertexes children;
-	
-	public SimpleChildren(SimpleTreeGroup _group,Vertexes _children,Graph _graph)
-	{
-		graph = _graph;
-		group = _group;
-		children = _children;
-	}
-	
-	public Iterator<TreeNode> iterator()
-	{
-		return new TreeNodeIteratorWrapper(children.iterator());
-	}
-	
-	private class TreeNodeIteratorWrapper implements Iterator<TreeNode>
-	{
-		private Iterator<Vertex> iterator;
-		
-		public TreeNodeIteratorWrapper(Iterator<Vertex> _iterator)
-		{
-			iterator = _iterator;
-		}
-
-		@Override
-		public boolean hasNext()
-		{
-			return iterator.hasNext();
-		}
-
-		@Override
-		public TreeNode next()
-		{
-			Vertex nextVertex = iterator.next();
-			if(nextVertex != null){
-				return new SimpleTreeNode(group,nextVertex,graph);
-			}
-			
-			return null;
-		}
-
-		@Override
-		public void remove()
-		{
-			throw new UnsupportedOperationException("removing is not supported");
-		}
-	}
-
-	public boolean contains(TreeNode _treeNode)
-	{
-		if(_treeNode instanceof SimpleTreeNode){
-			SimpleTreeNode converted = (SimpleTreeNode)_treeNode;
-			Vertex vertex = converted.getVertex();
-			if(converted.getGroup().equals(group)){
-				return children.contains(vertex);
-			}
-		}
-		
-		return false;
-	}
-
-	public TreeNode getAt(int _position)
-	{
-		if(children.size() < _position || _position < 0){
-			throw new IndexOutOfBoundsException("invalid position value.");
-		}
-		
-		Vertex vertex = children.at(_position);
-		return new SimpleTreeNode(group,vertex,graph);
-	}
-
-	public int size()
-	{
-		return children.size();
-	}
-	
-	@Override
-	public int hashCode()
-	{
-		return children.hashCode();
-	}
-	
-	@Override
-	public boolean equals(Object _obj)
-	{
-		if(_obj instanceof SimpleChildren){
-			SimpleChildren target = (SimpleChildren)_obj;
-			return target.equals(children);
-		}
-		
-		return false;
-	}
-}
--- a/src/main/java/jungle/impl/SimpleEditor.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +0,0 @@
-package jungle.impl;
-
-import java.util.Iterator;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicReference;
-import jungle.core.Editor;
-import jungle.core.Link;
-import jungle.core.Tree;
-import jungle.core.TreeGroup;
-import jungle.core.TreeNode;
-import jungle.core.Node;
-import jungle.core.graph.Graph;
-import jungle.core.graph.Vertex;
-import jungle.util.Pair;
-
-public class SimpleEditor implements Editor
-{
-	private final SimpleTreeGroup group;
-	private final Graph graph;
-	private AtomicReference<SimpleTree> current;
-	
-	public SimpleEditor(SimpleTree _tree,Graph _graph)
-	{
-		graph = _graph;
-		group = (SimpleTreeGroup)_tree.getGroup();
-		current = new AtomicReference<SimpleTree>(_tree);
-	}
-
-	public Tree commit()
-	{
-		return null;
-	}
-
-	public Tree rollback()
-	{
-		return null;
-	}
-	
-	private boolean checkTreeNode(TreeNode _target)
-	{
-		if(_target instanceof SimpleTreeNode){
-			SimpleTreeNode converted = (SimpleTreeNode)_target;
-			return converted.getGroup().equals(group);
-		}
-		
-		return false;
-	}
-	
-	private SimpleTreeNode convertTreeNode(TreeNode _target)
-	{
-		if(_target instanceof SimpleTreeNode){
-			return (SimpleTreeNode)_target;
-		}
-		
-		return null;
-	}
-	
-	private Vertex cloneTreeNode(Iterable<TreeNode> _path)
-	{
-		Iterator<TreeNode> itr = _path.iterator();
-		String newID = group.newTreeID();
-		
-		if(!itr.hasNext()){
-			return null;
-		}
-		
-		SimpleTreeNode root = convertTreeNode(itr.next());
-		if(root == null){
-			return null;
-		}
-		
-		Vertex rootVertex = root.getVertex();
-		
-		
-		for(TreeNode node : _path){
-			if(checkTreeNode(node)){
-			}
-		}
-	}
-	
-	public Link createLinkAt(Iterable<TreeNode> _path,TreeNode _target, Tree _linkTarget)
-	{
-		
-		throw new IllegalArgumentException("wrong tree group.");
-	}
-
-	public void removeLinkAt(TreeNode _target, Link _removeTarget)
-	{
-	}
-
-	public TreeNode createChildAt(TreeNode _target)
-	{
-		return null;
-	}
-
-	public void removeChildAt(TreeNode _target, TreeNode _removeTarget)
-	{
-	}
-
-	public String putPropertyAt(TreeNode _target, String _key, String _value)
-	{
-		return null;
-	}
-
-	public String removePropertyAt(TreeNode _target, String _key)
-	{
-		return null;
-	}
-}
--- a/src/main/java/jungle/impl/SimpleJungle.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-package jungle.impl;
-
-import java.util.UUID;
-import jungle.core.Jungle;
-import jungle.core.TreeGroup;
-import jungle.core.graph.Graph;
-import jungle.core.graph.Vertex;
-
-public class SimpleJungle implements Jungle
-{
-	private final Graph graph;
-	
-	public SimpleJungle(Graph _graph)
-	{
-		graph = _graph;
-	}
-	
-	@Override
-	public TreeGroup createTreeGroup(String _id)
-	{
-		Vertex vertex = graph.createVertex(_id);
-		
-		if(vertex == null){
-			return null;
-		}
-		
-		return new SimpleTreeGroup(_id,vertex,graph);
-	}
-	
-	@Override
-	public TreeGroup getTreeGroupByID(String _id)
-	{
-		Vertex vertex = graph.getVertex(_id);
-		if(vertex != null){
-			return new SimpleTreeGroup(_id,vertex,graph);
-		}
-		
-		return null;
-	}
-
-	@Override
-	public TreeGroup createTreeGroup()
-	{
-		String groupID = null;
-		Vertex vertex = null;
-		do{
-			groupID = UUID.randomUUID().toString();
-			vertex = graph.createVertex(groupID);
-		}while(vertex == null);
-		
-		return new SimpleTreeGroup(groupID,vertex,graph);
-	}
-}
\ No newline at end of file
--- a/src/main/java/jungle/impl/SimpleLink.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-package jungle.impl;
-
-import jungle.core.Link;
-import jungle.core.TreeGroup;
-import jungle.core.graph.Graph;
-import jungle.core.graph.Vertex;
-
-public class SimpleLink implements Link
-{
-	private final Vertex vertex;
-	private final Graph graph;
-	
-	public SimpleLink(Vertex _vertex,Graph _graph)
-	{
-		vertex = _vertex;
-		graph = _graph;
-	}
-
-	@Override
-	public String get(String _key)
-	{
-		return vertex.getProperty(Simples.PROPERTY_KEY_PREFIX + _key);
-	}
-
-	@Override
-	public TreeGroup destination()
-	{
-		String groupID = vertex.getProperty(Simples.LINK_DESTINATION_KEY);
-		Vertex vertex = graph.getVertex(groupID);
-		return new SimpleTreeGroup(groupID,vertex,graph);
-	}
-	
-	public Vertex getVertex()
-	{
-		return vertex;
-	}
-}
--- a/src/main/java/jungle/impl/SimpleLinks.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-package jungle.impl;
-
-import java.util.Iterator;
-import jungle.core.Link;
-import jungle.core.Links;
-import jungle.core.graph.Graph;
-import jungle.core.graph.Vertex;
-import jungle.core.graph.Vertexes;
-
-public class SimpleLinks implements Links
-{
-	@SuppressWarnings("unused")
-	private final SimpleTreeGroup group;
-	private final Vertexes links;
-	private final Graph graph;
-	
-	public SimpleLinks(SimpleTreeGroup _group,Vertexes _links,Graph _graph)
-	{
-		group = _group;
-		links = _links;
-		graph = _graph;
-	}
-	
-	public boolean contains(Link _link)
-	{
-		if(_link instanceof SimpleLink){
-			SimpleLink converted = (SimpleLink)_link;
-			Vertex link = converted.getVertex();
-			return links.contains(link);
-		}
-		
-		return false;
-	}
-
-	public int size()
-	{
-		return links.size();
-	}
-
-	public Iterator<Link> iterator()
-	{
-		return new SimpleLinkIteratorWrapper(links.iterator());
-	}
-	
-	private class SimpleLinkIteratorWrapper implements Iterator<Link>
-	{
-		private final Iterator<Vertex> iterator;
-		
-		public SimpleLinkIteratorWrapper(Iterator<Vertex> _iterator)
-		{
-			iterator = _iterator;
-		}
-		
-		@Override
-		public boolean hasNext()
-		{
-			return iterator.hasNext();
-		}
-
-		@Override
-		public Link next()
-		{
-			Vertex vertex = iterator.next();
-			if(vertex != null){
-				return new SimpleLink(vertex,graph);
-			}
-			
-			return null;
-		}
-
-		@Override
-		public void remove()
-		{
-			throw new UnsupportedOperationException("removing is not supported.");
-		}
-	}
-
-	public Link getAt(int _position)
-	{
-		if(links.size() < _position || _position < 0){
-			throw new IndexOutOfBoundsException("invalid _position value");
-		}
-		
-		return new SimpleLink(links.at(_position),graph);
-	}
-}
--- a/src/main/java/jungle/impl/SimpleTree.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-package jungle.impl;
-
-import jungle.core.Children;
-import jungle.core.Editor;
-import jungle.core.Links;
-import jungle.core.Tree;
-import jungle.core.TreeGroup;
-import jungle.core.graph.Graph;
-import jungle.core.graph.Vertex;
-
-public class SimpleTree implements Tree
-{
-	private final HyperTree group;
-	private final Graph graph;
-	private final Vertex vertex;
-	
-	public SimpleTree(SimpleTreeGroup _group,Vertex _vertex,Graph _graph)
-	{
-		group = _group;
-		graph = _graph;
-		vertex = _vertex;
-		
-		// initialize vertex
-		vertex.createVertexes(Simples.TREENODE_CHILDREN_KEY);
-		vertex.createVertexes(Simples.TREENODE_LINKS_KEY);
-	}
-	
-	public TreeGroup getGroup()
-	{
-		return group;
-	}
-	
-	public String get(String _key)
-	{
-		return vertex.getProperty(_key);
-	}
-
-	public String treeID()
-	{
-		return vertex.getID();
-	}
-	
-	public Children children()
-	{
-		return new SimpleChildren(group,vertex.getVertexes(Simples.TREENODE_CHILDREN_KEY),graph);
-	}
-	
-	public Links links()
-	{
-		return new SimpleLinks(group,vertex.getVertexes(Simples.TREENODE_LINKS_KEY),graph);
-	}
-	
-	public Editor getEditor()
-	{
-		return null;
-	}
-}
--- a/src/main/java/jungle/impl/SimpleTreeGroup.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-package jungle.impl;
-
-import jungle.core.Tree;
-import jungle.core.TreeGroup;
-import jungle.core.graph.Graph;
-import jungle.core.graph.Vertex;
-
-public class SimpleTreeGroup implements TreeGroup
-{
-	private final String groupID;
-	private final Graph graph;
-	private final Vertex vertex;
-	
-	public SimpleTreeGroup(String _groupID,Vertex _vertex,Graph _graph)
-	{
-		groupID = _groupID;
-		graph = _graph;
-		vertex = _vertex;
-		
-		vertex.setPropertyIfAbsent(Simples.TREEGROUP_ID_COUNTER,Simples.TREEGROUP_FIRST_REVISION_ID);
-		
-		String treeID = String.format(Simples.TREEGROUP_TREEID_FORMAT,groupID,Simples.TREEGROUP_FIRST_REVISION_ID);
-		// if not exist , previousID will be null. so then , create new Vertex for new Tree
-		if(vertex.setPropertyIfAbsent(Simples.TREEGROUP_CURRENT_TREE_KEY,treeID) == null){
-			graph.createVertex(treeID);
-		}
-	}
-
-	@Override
-	public String getID()
-	{
-		return groupID;
-	}
-
-	@Override
-	public Tree latestTree()
-	{
-		String currentID = vertex.getProperty(Simples.TREEGROUP_CURRENT_TREE_KEY);
-		Vertex vertex = graph.getVertex(currentID); 
-		SimpleTree currentTree = new SimpleTree(this,vertex,graph);
-		return currentTree;
-	}
-	
-	public String newTreeID()
-	{
-		String currentID;
-		String nextID;
-		
-		do{
-			currentID = vertex.getProperty(Simples.TREEGROUP_ID_COUNTER);
-			nextID = Long.toString(Long.parseLong(currentID) + 1);
-		}while(vertex.compareAndSwapProprety(Simples.TREEGROUP_ID_COUNTER,currentID,nextID));
-		
-		return nextID;
-	}
-	
-	@Override
-	public int hashCode()
-	{
-		return vertex.hashCode();
-	}
-	
-	@Override
-	public boolean equals(Object _obj)
-	{
-		if(_obj instanceof SimpleTreeGroup){
-			SimpleTreeGroup target = (SimpleTreeGroup)_obj;
-			return target.vertex == vertex;
-		}
-		
-		return false;
-	}
-}
--- a/src/main/java/jungle/impl/SimpleTreeNode.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-package jungle.impl;
-
-import jungle.core.Attributes;
-import jungle.core.Children;
-import jungle.core.Links;
-import jungle.core.TreeGroup;
-import jungle.core.TreeNode;
-import jungle.core.graph.Graph;
-import jungle.core.graph.Vertex;
-import jungle.core.graph.Vertexes;
-
-public class SimpleTreeNode implements TreeNode
-{
-	private final Graph graph;
-	private final SimpleTreeGroup group;
-	private final Vertex vertex;
-	
-	public SimpleTreeNode(SimpleTreeGroup _group,Vertex _vertex,Graph _graph)
-	{
-		group = _group;
-		vertex = _vertex;
-		graph = _graph;
-		
-		// initialize vertex
-		vertex.createVertexes(Simples.TREENODE_CHILDREN_KEY);
-		vertex.createVertexes(Simples.TREENODE_LINKS_KEY);
-	}
-	
-	public TreeGroup getGroup()
-	{
-		return group;
-	}
-	
-	public Vertex getVertex()
-	{
-		return vertex;
-	}
-
-	@Override
-	public String get(String _key)
-	{
-		return vertex.getProperty(_key);
-	}
-
-	@Override
-	public Children children()
-	{
-		Vertexes children = vertex.getVertexes(Simples.TREENODE_CHILDREN_KEY);
-		return new SimpleChildren(group,children,graph);
-	}
-
-	@Override
-	public Links links()
-	{
-		Vertexes links = vertex.getVertexes(Simples.TREENODE_LINKS_KEY);
-		return new SimpleLinks(group,links,graph);
-	}
-
-	@Override
-	public int hashCode()
-	{
-		return vertex.hashCode();
-	}
-	
-	@Override
-	public boolean equals(Object _obj)
-	{
-		if(_obj instanceof SimpleTreeNode){
-			SimpleTreeNode converted = (SimpleTreeNode)_obj;
-			if(converted.getGroup() == group){
-				return converted.getVertex().equals(vertex);
-			}
-		}
-		
-		return false;
-	}
-}
--- a/src/main/java/jungle/impl/Simples.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-package jungle.impl;
-
-public class Simples
-{
-	public static final String PROPERTY_KEY_PREFIX = "@";
-	
-	public static final String TREENODE_CHILDREN_KEY = "CHILDREN";
-	public static final String TREENODE_LINKS_KEY = "LINKS";
-	
-	public static final String LINK_DESTINATION_KEY = "DESTINATION";
-	
-	public static final String TREEGROUP_CURRENT_TREE_KEY = "CURRENT";
-	public static final String TREEGROUP_TREEID_FORMAT = "%s@%s";
-	public static final String TREEGROUP_FIRST_REVISION_ID = "0";
-	public static final String TREEGROUP_ID_COUNTER = "CURRENT_ID";
-}
--- a/src/main/java/jungle/kernel/hypertree/Edge.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-package jungle.kernel.hypertree;
-
-import jungle.util.Pair;
-import jungle.util.Triple;
-
-public interface Edge
-{
-	Node getNodeAt(int _index);
-	Triple<HyperTree,Edge,Node> createAnonymousNode(Pair<String,String>... _keyValues);
-	Triple<HyperTree,Edge,Node> createNode(String _id,Pair<String,String>... _keyValues);
-	Pair<HyperTree,Edge> removeNode(Node _node);
-	Triple<HyperTree,Edge,Node> insertAnonymouseNodeAt(int _index);
-}
--- a/src/main/java/jungle/kernel/hypertree/HyperTree.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-package jungle.kernel.hypertree;
-
-public interface HyperTree
-{
-	public Node find(String _id);
-	public Node rootNode();
-}
--- a/src/main/java/jungle/kernel/hypertree/Node.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-package jungle.kernel.hypertree;
-
-import jungle.util.Pair;
-import jungle.util.Triple;
-
-public interface Node
-{
-	String getProperty(String _key);
-	Pair<HyperTree,Node> setProperties(Pair<String,String>... _keyValues);
-	Triple<HyperTree,Node,Edge> createEdge(String... _edgeNames);
-	Edge getEdge(String _edgeName);
-	Pair<HyperTree,Node> removeEdge(String... _edgeNames);
-}
--- a/src/main/java/jungle/kernel/hypertree/db/HyperTreeDatabaseService.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-package jungle.kernel.hypertree.db;
-
-import jungle.kernel.hypertree.HyperTree;
-
-public interface HyperTreeDatabaseService
-{
-	public HyperTree createHyperTree(String _id);
-	public HyperTree getHyperTree(String _id);
-	public void removeHyperTree(String _id);
-	public String askID(HyperTree _tree);
-}
--- a/src/main/java/jungle/parsist/NodeProvider.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-package jungle.parsist;
-
-public interface NodeProvider
-{
-	
-}
--- a/src/main/java/jungle/util/Pair.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-package jungle.util;
-
-public class Pair<L,R>
-{
-	private L left;
-	private R right;
-	
-	public Pair(L _left,R _right)
-	{
-		left = _left;
-		right = _right;
-	}
-	
-	public L left()
-	{
-		return left;
-	}
-	
-	public R right()
-	{
-		return right;
-	}
-}
--- a/src/main/java/jungle/util/Triple.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-package jungle.util;
-
-public class Triple<A,B,C>
-{
-	private A a;
-	private B b;
-	private C c;
-	
-	public Triple(A _a,B _b,C _c)
-	{
-		a = _a;
-		b = _b;
-		c = _c;
-	}
-	
-	public A getA()
-	{
-		return a;
-	}
-	
-	public B getB()
-	{
-		return b;
-	}
-	
-	public C getC()
-	{
-		return c;
-	}
-	
-	public void setA(A _a)
-	{
-		a = _a;
-	}
-	
-	public void setB(B _b)
-	{
-		b = _b;
-	}
-	
-	public void setC(C _c)
-	{
-		c = _c;
-	}
-}
--- a/src/test/java/jungle/core/graph/AbstractGraphTest.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-package jungle.core.graph;
-
-
-import java.util.HashSet;
-import java.util.Iterator;
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-public abstract class AbstractGraphTest extends TestCase
-{
-	public abstract Graph newInstance();
-	
-	public void testGraphIsSame()
-	{
-		Graph g1 = newInstance();
-		Graph g2 = newInstance();
-		
-		Assert.assertTrue(g1.isSame(g1));
-		Assert.assertFalse(g1.isSame(g2));
-	}
-	
-	public void testGetVertex()
-	{
-		Graph g = newInstance();
-		Vertex v = g.createVertex("ONE");
-		Assert.assertEquals(v,g.getVertex("ONE"));
-		Assert.assertNull(g.getVertex("TWO"));
-		
-		Vertex v2 = g.createVertex();
-		String id = v2.getID();
-		Assert.assertEquals(v2,g.getVertex(id));
-	}
-	
-	public void testCreateVertex()
-	{
-		Graph g = newInstance();
-		
-		Vertex v1 = g.createVertex("ONE");
-		Vertex v2 = g.createVertex("TWO");
-		Vertex v3 = g.createVertex("THREE");
-		Vertex v4 = g.createVertex();
-		
-		Assert.assertNotNull(v1);
-		Assert.assertNotNull(v2);
-		Assert.assertNotNull(v3);
-		Assert.assertNotNull(v4);
-	}
-	
-	public void testIterateVertex()
-	{
-		Graph g = newInstance();
-		
-		Vertex v1 = g.createVertex("ONE");
-		Vertex v2 = g.createVertex("TWO");
-		Vertex v3 = g.createVertex("THREE");
-		
-		HashSet<Vertex> vs = new HashSet<Vertex>();
-		vs.add(v1);
-		vs.add(v2);
-		vs.add(v3);
-		
-		Iterator<Vertex> itr = g.vertexes();
-		while(itr.hasNext()){
-			Vertex v = itr.next();
-			Assert.assertTrue(vs.remove(v));
-		}
-	}
-}
--- a/src/test/java/jungle/core/graph/AbstractVertexTest.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-package jungle.core.graph;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-public abstract class AbstractVertexTest extends TestCase
-{
-	public abstract Vertex newInstance();
-	
-	public void testProperty()
-	{
-		Vertex v = newInstance();
-		
-		v.setProperty("KEY","VALUE");
-		Assert.assertEquals("VALUE",v.getProperty("KEY"));
-		
-		v.removeProperty("KEY");
-		Assert.assertNull(v.getProperty("KEY"));
-	}
-	
-	public void testGetGraph()
-	{
-		Vertex v = newInstance();
-		Graph g = v.getGraph();
-		
-		Assert.assertNotNull(g);
-	}
-	
-	public void testGetIDAndTryToResolveFromParentGraph()
-	{
-		Vertex v = newInstance();
-		Graph g = v.getGraph();
-		String id = v.getID();
-		
-		Assert.assertNotNull(id);
-		Assert.assertEquals(v,g.getVertex(id));
-	}
-	
-	public void testGetVertexes()
-	{
-		Vertex v = newInstance();
-		Vertexes vs1 = v.getVertexes("RELATIONS");
-		Assert.assertNull("vs1 is null",vs1);
-		
-		v.createVertexes("RELATIONS");
-		vs1 = v.getVertexes("RELATIONS");
-		Assert.assertNotNull(vs1);
-		
-		Vertexes vs2 = v.getVertexes("RELATIONS");
-		Assert.assertEquals(vs1,vs2);
-	}
-	
-	public void testCreateVertexes()
-	{
-		Vertex v = newInstance();
-		Vertexes vs = v.createVertexes("RELATIONS");
-		// check that vs is correctly created.
-		Assert.assertNotNull(vs);
-		Assert.assertEquals(vs.type(),"RELATIONS");
-		
-		// createVertexes must return null , if vertexes is already exist.
-		Assert.assertNull(v.createVertexes("RELATIONS"));
-	}
-	
-	public void testRemoveVertexes()
-	{
-		Vertex v = newInstance();
-		Vertexes vs1 = v.createVertexes("RELATIONS");
-		Assert.assertNotNull("vs1 is null",vs1);
-		
-		v.removeVertexes("RELATIONS");
-		
-		Assert.assertNull("removed Vertexes must be null",v.getVertexes("RELATIONS"));
-	}
-	
-	public void testRemovePropertyRefuseNull()
-	{
-		Vertex v = newInstance();
-		
-		try{
-			v.removeProperty(null);
-		}catch(NullPointerException _e){
-			return;
-		}
-		
-		Assert.fail();
-	}
-	
-	public void testSetPropertyRefuseNull()
-	{
-		Vertex v = newInstance();
-		
-		try{
-			v.setProperty(null,"VALUE");
-			v.setProperty("KEY",null);
-		}catch(NullPointerException _e){
-			return;
-		}
-		
-		Assert.fail();
-	}
-	
-	public void testGetPropertyRefuseNull()
-	{
-		Vertex v = newInstance();
-		
-		try{
-			v.getProperty(null);
-		}catch(NullPointerException _e){
-			return;
-		}
-		
-		Assert.fail();
-	}
-}
--- a/src/test/java/jungle/core/graph/AbstractVertexesTest.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,430 +0,0 @@
-package jungle.core.graph;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashSet;
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-public abstract class AbstractVertexesTest extends TestCase
-{
-	public abstract Graph newInstance();
-	
-	public static final String RELATION = "RELATION";
-	
-	public void testSize()
-	{
-		Graph g = newInstance();
-		Vertex v = g.createVertex();
-		Vertexes vs = v.createVertexes(RELATION);
-		
-		// first must be zero.
-		Assert.assertEquals(0,vs.size());
-		
-		// add single , size() will be one.
-		vs.add(g.createVertex());
-		Assert.assertEquals(1,vs.size());
-		
-		// add single , size() will be two.
-		vs.add(g.createVertex());
-		Assert.assertEquals(2,vs.size());
-		
-		Vertex c3 = g.createVertex();
-		vs.add(c3);
-		Assert.assertEquals(3,vs.size());
-		
-		// remove , will be two
-		vs.removeFirst(c3);
-		Assert.assertEquals(2,vs.size());
-	}
-	
-	public void testAddFromOtherGraphExceptions()
-	{
-		Graph g1 = newInstance();
-		Graph g2 = newInstance();
-		
-		Vertex v1 = g1.createVertex();
-		Vertex v2 = g2.createVertex(); // belongs to g2
-		
-		Vertexes vs = v1.createVertexes(RELATION);
-		try{
-			// v2 belongs to g2 , but v1 is not belongs to g2
-			vs.add(v2); // should be fail here.
-			Assert.fail("add(Vertex) must fail when vertex from other graph is supplied");
-		}catch(IllegalArgumentException _e){
-			// do nothing.
-		}
-		
-		try{
-			Collection<Vertex> c = Arrays.asList(g2.createVertex(),g2.createVertex());
-			vs.add(c);
-			Assert.fail("add(Collection<Vertex>) must fail when vertex from other graph is supplied");
-		}catch(IllegalArgumentException _e){
-			// do nothing.
-		}
-		
-		return;
-	}
-	
-	public void testAddSingleVertex()
-	{
-		Graph g = newInstance();
-		Vertex v = g.createVertex();
-		Vertex c = g.createVertex();
-		Vertexes vs = v.createVertexes(RELATION);
-		
-		vs.add(c);
-		
-		for(Vertex i : vs){
-			Assert.assertEquals(c,i);
-		}
-	}
-	
-	public void testAddExceptions()
-	{
-		Graph g = newInstance();
-		Vertex v = g.createVertex();
-		Vertexes vs = v.createVertexes(RELATION);
-		
-		try{
-			vs.add((Vertex)null);
-			Assert.fail("vs.add(Vertex) didnt throw null pointer exception");
-		}catch(NullPointerException _e){
-			// do nothing.
-		}
-		
-		try{
-			vs.add((Collection<Vertex>)null);
-			Assert.fail("vs.add(Collection<Vertex> didnt throw null pointer exception");
-		}catch(NullPointerException _e){
-			return;
-		}
-	}
-	
-	public void testAddVertexCollection()
-	{
-		Graph g = newInstance();
-		Vertex v = g.createVertex();
-		Vertexes vs = v.createVertexes(RELATION);
-		
-		HashSet<Vertex> set = new HashSet<Vertex>();
-		set.add(g.createVertex());
-		set.add(g.createVertex());
-		set.add(g.createVertex());
-		
-		vs.add(set);
-		Assert.assertEquals(3,vs.size());
-		
-		for(Vertex x : vs){
-			Assert.assertTrue("adding collection to Vertexes , but verification was failed.",set.contains(x));
-		}
-	}
-	
-	public void testAt()
-	{
-		Graph g = newInstance();
-		Vertex v = g.createVertex();
-		Vertexes vs = v.createVertexes(RELATION);
-		
-		Vertex c = g.createVertex();
-		
-		vs.add(g.createVertex());  // 0
-		vs.add(g.createVertex());  // 1
-		vs.add(c);  // 2
-		vs.add(g.createVertex());  // 3
-		vs.add(g.createVertex());  // 4
-		
-		Vertex two = vs.at(2);
-		Assert.assertEquals(c,two);
-	}
-	
-	public void testAtExceptions()
-	{
-		Graph g = newInstance();
-		Vertex v = g.createVertex();
-		Vertexes vs = v.createVertexes(RELATION);
-		
-		vs.add(g.createVertex()); // 0
-		vs.add(g.createVertex()); // 1
-		vs.add(g.createVertex()); // 2
-		vs.add(g.createVertex()); // 3
-		
-		try{
-			// try muinus value
-			vs.at(-1);
-			Assert.fail("Vertexes.at() must throw IndexOutOfBoundsException when muinus value supplied.");
-		}catch(IndexOutOfBoundsException _e){
-			// ???
-		}
-		
-		try{
-			// try large value , maximum index is 3 
-			vs.at(4);
-			Assert.fail("Vertexes.at() must throw IndexOutOfBoundsException when large value supplied.");
-		}catch(IndexOutOfBoundsException _e){
-			// ???
-		}
-	}
-	
-	public void testReplace()
-	{
-		Graph g = newInstance();
-		Vertex v = g.createVertex();
-		Vertexes vs = v.createVertexes(RELATION);
-		Vertex a = g.createVertex("a");
-		Vertex c = g.createVertex("c");
-		
-		vs.add(Arrays.asList(g.createVertex(),g.createVertex(),c,g.createVertex()));
-		Assert.assertEquals(c,vs.replace(a,2));
-		Assert.assertEquals(a,vs.at(2));
-	}
-	
-	public void testReplaceExceptions()
-	{
-		Graph g = newInstance();
-		Vertex v = g.createVertex();
-		Vertexes vs = v.createVertexes(RELATION);
-		
-		Vertex a = g.createVertex("a");
-		vs.add(Arrays.asList(g.createVertex(),a,g.createVertex()));
-		
-		try{
-			vs.replace(a,-1);
-			Assert.fail("Vertex.replate(Vertex,int) must throw IndexOutOfBoundsException when muinus value supplied.");
-		}catch(IndexOutOfBoundsException _e){
-			// nothing
-		}
-		
-		try{
-			vs.replace(a,3);
-			Assert.fail("Vertex.replate(Vertex,int) must throw IndexOutOfBoundsException when large value supplied.");
-		}catch(IndexOutOfBoundsException _e){
-			// nothing
-		}
-		
-		try{
-			vs.replace(null,0);
-			Assert.fail("Vertex.replate(Vertex,int) must throw NullPointerException when null value supplied.");
-		}catch(NullPointerException _e){
-			// nothing
-		}
-	}
-	
-	public void testReplaceFirst()
-	{
-		Graph g = newInstance();
-		Vertex v = g.createVertex();
-		Vertexes vs = v.createVertexes(RELATION);
-		Vertex a = g.createVertex("a");
-		Vertex c = g.createVertex("c");
-		
-		vs.add(Arrays.asList(g.createVertex(),g.createVertex(),c,g.createVertex(),c,c));
-		Assert.assertTrue(vs.replaceFirst(c,a));
-		Assert.assertEquals(a,vs.at(2));
-		Assert.assertEquals(c,vs.at(4));
-		Assert.assertEquals(c,vs.at(5));
-	}
-	
-	public void testReplaceFirstExceptions()
-	{
-		Graph g = newInstance();
-		Vertex v = g.createVertex();
-		Vertexes vs = v.createVertexes(RELATION);
-		Vertex c = g.createVertex("c");
-		
-		vs.add(Arrays.asList(g.createVertex(),g.createVertex(),c,g.createVertex(),c,c));
-		
-		try{
-			vs.replaceFirst(null,c);
-			Assert.fail("Vertexes.replaceFirst(Vertex,Vertex) must throw null when null value supplied.");
-		}catch(NullPointerException _e){
-			// nothing.
-		}
-		
-		try{
-			vs.replaceFirst(c,null);
-			Assert.fail("Vertexes.replaceFirst(Vertex,Vertex) must throw null when null value supplied.");
-		}catch(NullPointerException _e){
-			// nothing.
-		}
-	}
-	
-	public void testCompareAndSwap()
-	{
-		Graph g = newInstance();
-		Vertex v = g.createVertex();
-		Vertexes vs = v.createVertexes(RELATION);
-		Vertex a = g.createVertex("a");
-		Vertex c = g.createVertex("c");
-		
-		vs.add(Arrays.asList(g.createVertex(),g.createVertex(),c,g.createVertex(),c,c));
-		Assert.assertTrue(vs.compareAndSwap(2,c,a));
-		Assert.assertEquals(a,vs.at(2));
-		Assert.assertFalse(vs.compareAndSwap(2,c,a));
-	}
-	
-	public void testCompareAndSwapExceptions()
-	{
-		Graph g = newInstance();
-		Vertex v = g.createVertex();
-		Vertexes vs = v.createVertexes(RELATION);
-		Vertex a = g.createVertex("a");
-		Vertex c = g.createVertex("c");
-		
-		vs.add(Arrays.asList(g.createVertex(),g.createVertex(),c,g.createVertex(),c,c));
-		try{
-			vs.compareAndSwap(-1,a,c);
-			Assert.fail("Vertexes.compareAndSwap(int,Vertex,Vertex) must throw IndexOutOfBoundsException when muinus value supplied.");
-		}catch(IndexOutOfBoundsException _e){
-			// nothing.
-		}
-		
-		try{
-			vs.compareAndSwap(6,a,c);
-			Assert.fail("Vertexes.compareAndSwap(int,Vertex,Vertex) must throw IndexOutOfBoundsException when large value supplied.");
-		}catch(IndexOutOfBoundsException _e){
-			// nothing.
-		}
-		
-		try{
-			vs.compareAndSwap(2,null,c);
-			Assert.fail("Vertexes.compareAndSwap(int,Vertex,Vertex) must throw NullPointerException when null value supplied.");
-		}catch(NullPointerException _e){
-			// nothing.
-		}
-		
-		try{
-			vs.compareAndSwap(2,c,null);
-			Assert.fail("Vertexes.compareAndSwap(int,Vertex,Vertex) must throw NullPointerException when null value supplied.");
-		}catch(NullPointerException _e){
-			// nothing.
-		}
-	}
-	
-	public void testGetGraph()
-	{
-		Graph g = newInstance();
-		Vertex v = g.createVertex();
-		Vertexes vs = v.createVertexes(RELATION);
-		
-		Assert.assertEquals(g,vs.getGraph());
-	}
-	
-	public void testRemoveSingleVertex()
-	{
-		Graph g = newInstance();
-		Vertex v = g.createVertex();
-		Vertexes vs = v.createVertexes("RELATIONS");
-		
-		HashSet<Vertex> set = new HashSet<Vertex>();
-		set.add(g.createVertex());
-		set.add(g.createVertex());
-		set.add(g.createVertex());
-		
-		Vertex c = g.createVertex();
-		vs.add(set);
-		vs.add(c);
-		Assert.assertEquals(4,vs.size());
-		
-		vs.removeFirst(c);
-		Assert.assertEquals(3,vs.size());
-		
-		for(Vertex x : vs){
-			Assert.assertTrue(set.remove(x));
-		}
-		
-		Assert.assertEquals(0,set.size());
-	}
-	
-	public void testRemoveVertexExceptions()
-	{
-		Graph g = newInstance();
-		Vertexes vs = g.createVertex().createVertexes("RELATIONS");
-		
-		vs.add(Arrays.asList(g.createVertex(),g.createVertex(),g.createVertex()));
-		try{
-			vs.remove(-1);
-			Assert.fail("Vertexes.remove(int) must throw IndexOutOfBoundsException when muinus value supplied.");
-		}catch(IndexOutOfBoundsException _e){
-			// do nothing.
-		}
-		
-		try{
-			vs.remove(10);
-			Assert.fail("Vertexes.remove(int) must throw IndexOutOfBoundsException when large value supplied.");
-		}catch(IndexOutOfBoundsException _e){
-			// do nothing.
-		}
-		
-		try{
-			vs.removeFirst((Vertex)null);
-			Assert.fail("vs.remove(Vertex) didnt throw null pointer exception");
-		}catch(NullPointerException _e){
-			// do nothing.
-		}
-		
-		try{
-			vs.removeFirst((Vertexes)null);
-			Assert.fail("vs.remove(Vertexes) didnt throw null pointer exception");
-		}catch(NullPointerException _e){
-			// do nothing.
-		}
-		
-		try{
-			vs.removeFirst((Collection<Vertex>)null);
-			Assert.fail("vs.remove(Collection<Vertex> didnt throw null pointer exception");
-		}catch(NullPointerException _e){
-			return;
-		}
-	}
-	
-	public void testRemoveVertexCollection()
-	{
-		Graph g = newInstance();
-		Vertexes vs = g.createVertex().createVertexes("RELATIONS");
-		
-		HashSet<Vertex> set = new HashSet<Vertex>();
-		set.add(g.createVertex());
-		set.add(g.createVertex());
-		set.add(g.createVertex());
-		
-		vs.add(set);
-		Assert.assertEquals(3,vs.size());
-		
-		vs.removeFirst(set);
-		Assert.assertEquals(0,vs.size());
-	}
-	
-	public void testContains()
-	{
-		Graph g = newInstance();
-		Vertexes vs = g.createVertex().createVertexes("RELATIONS");
-		
-		Vertex v = g.createVertex();
-		vs.add(v);
-		vs.add(g.createVertex());
-		
-		Assert.assertTrue(vs.contains(v));
-	}
-	
-	public void testContainsExceptions()
-	{
-		Graph g = newInstance();
-		Vertexes vs = g.createVertex().createVertexes("RELATIONS");
-		
-		try{
-			vs.contains(null);
-			Assert.fail("Vertexes.contains(Vertex) must throw NullPointerException when null value supplied.");
-		}catch(NullPointerException _e){
-			return;
-		}
-	}
-	
-	public void testVertexType()
-	{
-		Graph g = newInstance();
-		Vertexes vs = g.createVertex().createVertexes("RELATIONS");
-		
-		Assert.assertEquals("RELATIONS",vs.type());
-	}
-}
--- a/src/test/java/jungle/core/graph/simple/SimpleGraphTest.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-package jungle.core.graph.simple;
-
-import jungle.core.graph.AbstractGraphTest;
-import jungle.core.graph.Graph;
-
-public class SimpleGraphTest extends AbstractGraphTest
-{
-	@Override
-	public Graph newInstance()
-	{
-		return new SimpleGraph();
-	}
-}
--- a/src/test/java/jungle/core/graph/simple/SimpleVertexTest.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-package jungle.core.graph.simple;
-
-import jungle.core.graph.AbstractVertexTest;
-import jungle.core.graph.Vertex;
-
-public class SimpleVertexTest extends AbstractVertexTest
-{
-	private final SimpleGraph g;
-	
-	public SimpleVertexTest()
-	{
-		g = new SimpleGraph();
-	}
-	
-	@Override
-	public Vertex newInstance()
-	{
-		return g.createVertex();
-	}
-}
--- a/src/test/java/jungle/core/graph/simple/SimpleVertexesTest.java	Fri Jul 06 21:43:45 2012 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-package jungle.core.graph.simple;
-
-import jungle.core.graph.AbstractVertexesTest;
-import jungle.core.graph.Graph;
-
-public class SimpleVertexesTest extends AbstractVertexesTest
-{
-	@Override
-	public Graph newInstance()
-	{
-		return new SimpleGraph();
-	}
-}
--- a/src/test/java/jungle/util/PairTest.java	Fri Jul 06 21:43:45 2012 +0900
+++ b/src/test/java/jungle/util/PairTest.java	Mon Dec 10 18:50:53 2012 +0900
@@ -1,5 +1,6 @@
 package jungle.util;
 
+import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Pair;
 import junit.framework.Assert;
 import junit.framework.Test;
 import junit.framework.TestCase;