Mercurial > hg > Members > nobuyasu > jungle-network
comparison src/main/java/app/bbs/NetworkJungleBulletinBoard.java @ 130:652a6dff6288
Fixed
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 11 Jan 2014 09:10:02 +0900 |
parents | 1a3edba05f50 |
children | aa98fc3ec85f |
comparison
equal
deleted
inserted
replaced
129:1a3edba05f50 | 130:652a6dff6288 |
---|---|
77 ByteBuffer tBuffer = ByteBuffer.allocate(16); | 77 ByteBuffer tBuffer = ByteBuffer.allocate(16); |
78 either = editor.putAttribute(root.add(0),"timestamp", tBuffer.putLong(timestamp)); | 78 either = editor.putAttribute(root.add(0),"timestamp", tBuffer.putLong(timestamp)); |
79 if(either.isA()){ | 79 if(either.isA()){ |
80 throw new IllegalStateException(); | 80 throw new IllegalStateException(); |
81 } | 81 } |
82 | |
83 editor = either.b(); | 82 editor = either.b(); |
84 Either<Error,JungleTreeEditor> result = editor.success(); | 83 Either<Error,JungleTreeEditor> result = editor.success(); |
85 if(result.isA()){ | 84 if(result.isA()){ |
86 throw new IllegalStateException(); | 85 throw new IllegalStateException(); |
87 } | 86 } |
97 NodeEditor e = new NodeEditor(){ | 96 NodeEditor e = new NodeEditor(){ |
98 public <T extends EditableNode<T>> Either<Error, T> edit(T _e){ | 97 public <T extends EditableNode<T>> Either<Error, T> edit(T _e){ |
99 _e = _e.getAttributes().put("author",ByteBuffer.wrap(_author.getBytes())).b(); | 98 _e = _e.getAttributes().put("author",ByteBuffer.wrap(_author.getBytes())).b(); |
100 _e = _e.getAttributes().put("mes",ByteBuffer.wrap(_initMessage.getBytes())).b(); | 99 _e = _e.getAttributes().put("mes",ByteBuffer.wrap(_initMessage.getBytes())).b(); |
101 _e = _e.getAttributes().put("key",ByteBuffer.wrap(_editKey.getBytes())).b(); | 100 _e = _e.getAttributes().put("key",ByteBuffer.wrap(_editKey.getBytes())).b(); |
102 ByteBuffer t2Buffer = ByteBuffer.allocate(16); | 101 ByteBuffer tBuffer2 = ByteBuffer.allocate(16); |
103 _e = _e.getAttributes().put("timestamp",t2Buffer.putLong(timestamp)).b(); | 102 _e = _e.getAttributes().put("timestamp",tBuffer2.putLong(timestamp)).b(); |
104 return DefaultEither.newB(_e); | 103 return DefaultEither.newB(_e); |
105 } | 104 } |
106 }; | 105 }; |
107 | 106 |
108 either = editor.edit(root.add(0),e); | 107 either = editor.edit(root.add(0),e); |