Mercurial > hg > Members > shoshi > jungle > bulletinboard
changeset 18:1515eeb54784
NodeEditor change
author | one |
---|---|
date | Wed, 03 Sep 2014 23:52:10 +0900 |
parents | d253ca4d92ca |
children | 8e44d61b8a65 |
files | src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/bbs/JungleBulletinBoard.java |
diffstat | 1 files changed, 5 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/bbs/JungleBulletinBoard.java Sun Aug 31 07:33:35 2014 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/shoshi/jungle/bbs/JungleBulletinBoard.java Wed Sep 03 23:52:10 2014 +0900 @@ -35,7 +35,7 @@ public Iterable<String> getBoards() { JungleTree tree = jungle.getTreeByName("boards"); TreeNode node = tree.getRootNode(); - Children<TreeNode> chs = node.getChildren(); + Children chs = node.getChildren(); IterableConverter.Converter<String, TreeNode> converter = new IterableConverter.Converter<String, TreeNode>() { public String conv(TreeNode _b) { @@ -83,8 +83,7 @@ NodeEditor e = new NodeEditor() { - public <T extends TreeNode> Either<Error, TreeNode> edit(T _e) { - TreeNode node = new DefaultTreeNode(); + public Either<Error, TreeNode> edit(TreeNode node) { node = node.getAttributes().put("author", ByteBuffer.wrap(_author.getBytes())).b(); node = node.getAttributes().put("mes", ByteBuffer.wrap(_initMessage.getBytes())).b(); node = node.getAttributes().put("key", ByteBuffer.wrap(_editKey.getBytes())).b(); @@ -132,8 +131,7 @@ editor = either.b(); NodeEditor e = new NodeEditor() { - public <T extends TreeNode> Either<Error, TreeNode> edit(T _e) { - TreeNode node = new DefaultTreeNode(); + public Either<Error, TreeNode> edit(TreeNode node) { node = node.getAttributes().put("author", ByteBuffer.wrap(_author.getBytes())).b(); node = node.getAttributes().put("mes", ByteBuffer.wrap(_message.getBytes())).b(); node = node.getAttributes().put("key", ByteBuffer.wrap(_editKey.getBytes())).b(); @@ -170,8 +168,7 @@ editor = tree.getTreeEditor(); NodeEditor e = new NodeEditor() { - public <T extends TreeNode> Either<Error, TreeNode> edit(T _e) { - TreeNode node = new DefaultTreeNode(); + public Either<Error, TreeNode> edit(TreeNode node) { node = node.getAttributes().put("author", ByteBuffer.wrap(_author.getBytes())).b(); node = node.getAttributes().put("mes", ByteBuffer.wrap(_message.getBytes())).b(); node = node.getAttributes().put("key", ByteBuffer.wrap(_editKey.getBytes())).b(); @@ -200,7 +197,7 @@ public Iterable<BoardMessage> getMessages(String _boardName) { JungleTree tree = jungle.getTreeByName(_boardName); TreeNode node = tree.getRootNode(); - Children<TreeNode> chs = node.getChildren(); + Children chs = node.getChildren(); final AtomicInteger counter = new AtomicInteger(0); IterableConverter.Converter<BoardMessage, TreeNode> converter = new IterableConverter.Converter<BoardMessage, TreeNode>() {