Mercurial > hg > Database > jungle-sharp
comparison Main/jungle-main/transaction/DefaultTreeNode.cs @ 31:1466993c104c
byte[] to object Rewrite.
author | Kazuma Takeda |
---|---|
date | Fri, 20 Jan 2017 07:08:03 +0900 |
parents | 1f99e150f336 |
children | f2ea780b3e80 |
comparison
equal
deleted
inserted
replaced
30:236a58985e22 | 31:1466993c104c |
---|---|
2 | 2 |
3 namespace JungleDB { | 3 namespace JungleDB { |
4 public class DefaultTreeNode : TreeNode { | 4 public class DefaultTreeNode : TreeNode { |
5 | 5 |
6 private List<TreeNode> children; | 6 private List<TreeNode> children; |
7 private TreeMap<string,byte[]> attrs; | 7 private TreeMap<string, object> attrs; |
8 private static readonly List<TreeNode> NIL_LIST = new List<TreeNode>(); | 8 private static readonly List<TreeNode> NIL_LIST = new List<TreeNode>(); |
9 | 9 |
10 public DefaultTreeNode() | 10 public DefaultTreeNode() |
11 : this (NIL_LIST, new TreeMap<string,byte[]> ()) | 11 : this (NIL_LIST, new TreeMap<string, object> ()) |
12 { | 12 { |
13 } | 13 } |
14 | 14 |
15 public DefaultTreeNode(List<TreeNode> _children, TreeMap<string, byte[]> _attrs) { | 15 public DefaultTreeNode(List<TreeNode> _children, TreeMap<string, object> _attrs) { |
16 attrs = _attrs; | 16 attrs = _attrs; |
17 children = _children; | 17 children = _children; |
18 } | 18 } |
19 | 19 |
20 public TreeNodeChildren getChildren() { | 20 public TreeNodeChildren getChildren() { |
32 public DefaultTreeNode clone() { | 32 public DefaultTreeNode clone() { |
33 return new DefaultTreeNode(children, attrs); | 33 return new DefaultTreeNode(children, attrs); |
34 } | 34 } |
35 | 35 |
36 public Either<Error, TreeNode> appendRootNode() { | 36 public Either<Error, TreeNode> appendRootNode() { |
37 TreeNodeChildren newRootChildren = new DefaultTreeNodeChildren(NIL_LIST, new TreeMap<string, byte[]>()); | 37 TreeNodeChildren newRootChildren = new DefaultTreeNodeChildren(NIL_LIST, new TreeMap<string, object>()); |
38 Either<Error, TreeNode> either = newRootChildren.addNewChildAt(0,this); | 38 Either<Error, TreeNode> either = newRootChildren.addNewChildAt(0,this); |
39 return either; | 39 return either; |
40 } | 40 } |
41 | 41 |
42 public int compareTo(TreeNode o) { | 42 public int compareTo(TreeNode o) { |