Mercurial > hg > Members > shoshi > jungle > jungle-core
changeset 74:3a3622cf2eef
remove error but have a error test program
and LoggingChildren.iterator is bad
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/DefaultJungle.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/DefaultJungle.java Wed Aug 27 05:07:50 2014 +0900 @@ -2,6 +2,7 @@ import java.util.Iterator; import java.util.concurrent.ConcurrentHashMap; + import fj.data.List; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeList; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.Journal; @@ -10,6 +11,7 @@ import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.TreeEditor; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultNodePath; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultTreeEditor; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.TreeOperation; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultChangeSet; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultTreeContext; @@ -18,16 +20,16 @@ import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; -public class DefaultJungle implements Jungle +public class DefaultJungle<T extends TreeNode<T>> implements Jungle { private Journal journal; private ConcurrentHashMap<String,JungleTree> trees; private String uuid; private TreeEditor editor; - public static void main(String _args[]) + public static <T extends TreeNode<T>>void main(String _args[]) { - DefaultJungle j = new DefaultJungle(null,"hoge",new DefaultTreeEditor(new DefaultTraverser())); + DefaultJungle<T> j = new DefaultJungle(null,"hoge",new DefaultTreeEditor(new DefaultTraverser())); JungleTree t = j.createNewTree("fuga"); JungleTreeEditor e1 = t.getTreeEditor(); @@ -76,7 +78,7 @@ }; DefaultTreeNode root = new DefaultTreeNode(); - ChangeSet set = new DefaultChangeSet(root.getAsNode(),null,list,uuid,_name,0); + ChangeSet<T> set = new DefaultChangeSet(root,null,list,uuid,_name,0); DefaultTreeContext<DefaultTreeNode> tc = new DefaultTreeContext<DefaultTreeNode>(root,set); JungleTree newTree = new DefaultJungleTree<DefaultTreeNode>(tc,uuid,journal.getWriter(),editor); if(trees.putIfAbsent(_name,newTree) != null){
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/DefaultJungleTree.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/DefaultJungleTree.java Wed Aug 27 05:07:50 2014 +0900 @@ -1,6 +1,5 @@ package jp.ac.u_ryukyu.ie.cr.shoshi.jungle; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeListWriter; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.ChangeSet; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.TreeEditor; @@ -41,10 +40,10 @@ } @Override - public Node getRootNode() + public TreeNode<T> getRootNode() { TreeContext<T> tc = repository.get(); - ChangeSet cs = tc.getChangeSet(); + ChangeSet<T> cs = tc.getChangeSet(); return cs.getRoot(); } }
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/JungleTree.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/JungleTree.java Wed Aug 27 05:07:50 2014 +0900 @@ -1,10 +1,10 @@ package jp.ac.u_ryukyu.ie.cr.shoshi.jungle; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; -public interface JungleTree +public interface JungleTree<T extends TreeNode<T>> { public JungleTreeEditor getTreeEditor(); public JungleTreeEditor getLocalTreeEditor(); - public Node getRootNode(); + public TreeNode<T> getRootNode(); }
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/JungleTreeEditor.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/JungleTreeEditor.java Wed Aug 27 05:07:50 2014 +0900 @@ -1,23 +1,24 @@ package jp.ac.u_ryukyu.ie.cr.shoshi.jungle; import java.nio.ByteBuffer; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; + import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.NodePath; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.NodeEditor; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; -public interface JungleTreeEditor +public interface JungleTreeEditor<T extends TreeNode<T>> { - public Node getRoot(); + public TreeNode<T> getRoot(); - public Either<Error,JungleTreeEditor> addNewChildAt(NodePath _path,int _pos); - public Either<Error,JungleTreeEditor> deleteChildAt(NodePath _path,int _pos); - public Either<Error,JungleTreeEditor> putAttribute(NodePath _path,String _key,ByteBuffer _value); - public Either<Error,JungleTreeEditor> deleteAttribute(NodePath _path,String _key); - public Either<Error,JungleTreeEditor> edit(NodePath _path,NodeEditor _editor); + public Either<Error,JungleTreeEditor<T>> addNewChildAt(NodePath _path,int _pos); + public Either<Error,JungleTreeEditor<T>> deleteChildAt(NodePath _path,int _pos); + public Either<Error,JungleTreeEditor<T>> putAttribute(NodePath _path,String _key,ByteBuffer _value); + public Either<Error,JungleTreeEditor<T>> deleteAttribute(NodePath _path,String _key); + public Either<Error,JungleTreeEditor<T>> edit(NodePath _path,NodeEditor _editor); - public Either<Error,JungleTreeEditor> success(); + public Either<Error,JungleTreeEditor<T>> success(); public String getID(); public String getRevision(); }
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/App.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/core/App.java Wed Aug 27 05:07:50 2014 +0900 @@ -1,11 +1,13 @@ package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core; import java.nio.ByteBuffer; + import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.DefaultJungle; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTree; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTreeEditor; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultNodePath; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultTreeEditor; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.traverser.DefaultTraverser; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; @@ -16,7 +18,7 @@ */ public class App { - public static void main( String[] args ) + public static <T extends TreeNode<T>>void main( String[] args ) { DefaultJungle jungle = new DefaultJungle(null,"sample",new DefaultTreeEditor(new DefaultTraverser())); jungle.createNewTree("hoge"); @@ -32,7 +34,7 @@ e.success(); - Node root = tree.getRootNode(); + TreeNode<T> root = tree.getRootNode(); ByteBuffer v = root.getAttributes().get(key); String str = new String(v.array()); System.out.println(str);
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/ChangeSet.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/ChangeSet.java Wed Aug 27 05:07:50 2014 +0900 @@ -1,13 +1,14 @@ 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.persistent.ChangeList; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.TreeOperation; -public interface ChangeSet +public interface ChangeSet<T extends TreeNode<T>> { - public Node getRoot(); - public ChangeSet prev(); + public TreeNode<T> getRoot(); + public ChangeSet<T> prev(); public ChangeList getChangeList(); public String uuid();
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/DefaultChildren.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/DefaultChildren.java Wed Aug 27 05:07:50 2014 +0900 @@ -4,18 +4,17 @@ import java.util.Iterator; 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; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.NodeEditorError; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.DefaultEither; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.IterableWrapper; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; -public class DefaultChildren implements Children<Node> +public class DefaultChildren<T extends TreeNode<T>> implements Children<TreeNode<T>> { - private final List<DefaultNode> children; + private final List<TreeNode<T>> children; - public DefaultChildren(List<DefaultNode> _children) + public DefaultChildren(List<TreeNode<T>> _children) { children = _children; } @@ -75,25 +74,25 @@ */ @Override - public Either<Error,Node> at(int _pos) + public Either<Error,TreeNode<T>> at(int _pos) { - DefaultNode target = children.index(_pos); + TreeNode<T> target = children.index(_pos); if(target == null){ return DefaultEither.newA(NodeEditorError.INDEX_OUT_OF_BOUNDS); // TODO } - Node ret = target; + TreeNode<T> ret = target; return DefaultEither.newB(ret); } - public List<DefaultNode> getChildrenAsRawList() + public List<TreeNode<T>> getChildrenAsRawList() { return children; } @Override - public Iterator<Node> iterator() + public Iterator<TreeNode<T>> iterator() { - return (new IterableWrapper<Node>(children)).iterator(); + return (new IterableWrapper<TreeNode<T>>(children)).iterator(); } }
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/DefaultNode.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/DefaultNode.java Wed Aug 27 05:07:50 2014 +0900 @@ -1,4 +1,4 @@ -package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl; +/*package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl; import java.nio.ByteBuffer; import fj.Ord; @@ -42,3 +42,4 @@ return new DefaultAttributes(attrs); } } +*/ \ No newline at end of file
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/EditableNodeWrapper.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/EditableNodeWrapper.java Wed Aug 27 05:07:50 2014 +0900 @@ -3,7 +3,7 @@ import java.nio.ByteBuffer; import java.util.Iterator; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; + import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.EditableAttributes; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.EditableChildren; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.EditableNode; @@ -90,15 +90,15 @@ } @Override - public Either<Error,Node> at(int _pos) + public Either<Error, EditableNodeWrapper<T>> at(int _pos) { Either<Error,T> either = children.at(_pos); if(either.isA()){ return DefaultEither.newA(either.a()); } - + T target = either.b(); - Node newWrapper = new NodeWrapper<T>(target); + EditableNodeWrapper<T> newWrapper = new EditableNodeWrapper<T>(target); return DefaultEither.newB(newWrapper); } @@ -109,17 +109,17 @@ } @Override - public Iterator<Node> iterator() + public Iterator<EditableNodeWrapper<T>> iterator() { - IterableConverter.Converter<Node,T> converter = new IterableConverter.Converter<Node,T>(){ + IterableConverter.Converter<EditableNodeWrapper<T>,T> converter = new IterableConverter.Converter<EditableNodeWrapper<T>,T>(){ @Override - public Node conv(T _b){ - return new NodeWrapper<T>(_b); + public EditableNodeWrapper<T> conv(T _b){ + return new EditableNodeWrapper<T>(_b); } }; - return new IterableConverter<Node,T>(children,converter).iterator(); + return new IterableConverter<EditableNodeWrapper<T>,T>(children,converter).iterator(); } @Override
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/NodeWrapper.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/NodeWrapper.java Wed Aug 27 05:07:50 2014 +0900 @@ -1,4 +1,4 @@ -package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl; +/*package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl; import java.util.Iterator; @@ -74,3 +74,4 @@ } } } +*/ \ No newline at end of file
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/TreeNode.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/TreeNode.java Wed Aug 27 05:07:50 2014 +0900 @@ -1,7 +1,6 @@ package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.AttributesContainer; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Parent; public interface TreeNode<T extends TreeNode<T>> extends Parent<T> , AttributesContainer
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/logger/LoggingChildren.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/impl/logger/LoggingChildren.java Wed Aug 27 05:07:50 2014 +0900 @@ -1,7 +1,6 @@ package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger; import java.util.Iterator; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.AppendChildAtOperation; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.DeleteChildAtOperation; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.NodeOperation; @@ -30,10 +29,10 @@ } @Override - public Iterator<Node> iterator() + public Iterator<LoggingNode<T>> iterator() { EditableChildren<T> children = wrap.getChildren(); - return children.iterator(); + return (Iterator<LoggingNode<T>>) children.iterator(); } public Either<Error,LoggingNode<T>> edit(NodeOperation _op) @@ -64,15 +63,15 @@ } @Override - public Either<Error,Node> at(int _pos) + public Either<Error,LoggingNode<T>> at(int _pos) { EditableChildren<T> children = wrap.getChildren(); - Either<Error,Node> either = children.at(_pos); + Either<Error,T> either = children.at(_pos); if(either.isA()){ return DefaultEither.newA(either.a()); } - Node node = either.b(); - return DefaultEither.newB(node); + T node = either.b(); + return DefaultEither.newB(new LoggingNode<T>(node)); } }
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/trasnformer/EditableChildren.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/trasnformer/EditableChildren.java Wed Aug 27 05:07:50 2014 +0900 @@ -1,13 +1,12 @@ package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Children; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Parent; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.DefaultError; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; -public interface EditableChildren<T extends Parent<Node>> extends Children<Node> +public interface EditableChildren<T extends Parent<T>> extends Children<T> { public Either<Error,T> addNewChildAt(int _pos); public Either<Error,T> deleteChildAt(int _pos);
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/trasnformer/EditableNode.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/store/trasnformer/EditableNode.java Wed Aug 27 05:07:50 2014 +0900 @@ -1,10 +1,10 @@ package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.AttributesContainer; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Parent; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; -public interface EditableNode<T extends Parent<Node>> extends AttributesContainer , Parent<Node> +public interface EditableNode<T extends Parent<T>> extends AttributesContainer , Parent<T> { public EditableAttributes<T> getAttributes(); public EditableChildren<T> getChildren();
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultChangeSet.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultChangeSet.java Wed Aug 27 05:07:50 2014 +0900 @@ -1,20 +1,20 @@ package jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeList; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.ChangeSet; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.TreeOperation; -public class DefaultChangeSet implements ChangeSet +public class DefaultChangeSet<T extends TreeNode<T>> implements ChangeSet<T> { - private final Node root; - private final ChangeSet previous; + private final TreeNode<T> root; + private final ChangeSet<T> previous; private final ChangeList changeList; private final String uuid; private final String treeName; private final long revision; - public DefaultChangeSet(Node _node,ChangeSet _prev,ChangeList _log,String _uuid, String _treeName, long _revision) + public DefaultChangeSet(TreeNode<T> _node,ChangeSet<T> _prev,ChangeList _log,String _uuid, String _treeName, long _revision) { root = _node; previous = _prev; @@ -25,13 +25,13 @@ } @Override - public Node getRoot() + public TreeNode<T> getRoot() { return root; } @Override - public ChangeSet prev() + public ChangeSet<T> prev() { return previous; }
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultJungleTreeEditor.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultJungleTreeEditor.java Wed Aug 27 05:07:50 2014 +0900 @@ -2,7 +2,6 @@ import java.nio.ByteBuffer; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTreeEditor; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.NodePath; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.TreeEditor; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; @@ -130,7 +129,7 @@ } @Override - public Node getRoot() + public TreeNode<T> getRoot() { return null; }
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultTransactionManager.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultTransactionManager.java Wed Aug 27 05:07:50 2014 +0900 @@ -34,7 +34,7 @@ @Override public Either<Error,TransactionManager<T>> commit(T _newRoot,final TreeOperationLog _log) { - ChangeSet cs = tip.getChangeSet(); + ChangeSet<T> cs = tip.getChangeSet(); long currentRevision = cs.revision(); long nextRevision = currentRevision + 1; @@ -54,8 +54,7 @@ } }; - Node root = _newRoot.getAsNode(); - DefaultChangeSet newCs = new DefaultChangeSet(root,cs,list,uuid, _treeName, nextRevision); + DefaultChangeSet<T> newCs = new DefaultChangeSet(_newRoot,cs,list,uuid, _treeName, nextRevision); DefaultTreeContext<T> newContext = new DefaultTreeContext<T>(_newRoot,newCs); @SuppressWarnings("rawtypes") @@ -81,7 +80,7 @@ @Override public long getRevision() { - ChangeSet cs = tip.getChangeSet(); + ChangeSet<T> cs = tip.getChangeSet(); return cs.revision(); } }
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultTreeNode.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultTreeNode.java Wed Aug 27 05:07:50 2014 +0900 @@ -6,7 +6,6 @@ import fj.data.List; import fj.data.TreeMap; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; public class DefaultTreeNode implements TreeNode<DefaultTreeNode>
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultTreeNodeAttribute.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultTreeNodeAttribute.java Wed Aug 27 05:07:50 2014 +0900 @@ -7,7 +7,6 @@ import fj.data.TreeMap; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultAttributes; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultChildren; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNodeAttributes; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.NodeEditorError; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.DefaultEither;
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultTreeNodeChildren.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/DefaultTreeNodeChildren.java Wed Aug 27 05:07:50 2014 +0900 @@ -8,7 +8,6 @@ import fj.data.TreeMap; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultAttributes; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultChildren; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNodeChildren; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.NodeEditorError; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.DefaultEither;
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/TreeContext.java Tue Aug 26 07:41:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/transaction/TreeContext.java Wed Aug 27 05:07:50 2014 +0900 @@ -5,6 +5,6 @@ public interface TreeContext<T extends TreeNode<T>> { - public ChangeSet getChangeSet(); + public ChangeSet<T> getChangeSet(); public T getTreeNode(); }