diff --git a/btree/BTree.cs b/btree/BTree.cs index 544d062..7c0ad60 100644 --- a/btree/BTree.cs +++ b/btree/BTree.cs @@ -8,6 +8,7 @@ namespace ln.types.btree { public Comparison Comparison { get; } public int Count => count; + public bool Empty => count == 0; public int LeftDepth => headNode != null ? headNode.LeftDepth : 0; public int RightDepth => headNode != null ? headNode.RightDepth : 0; diff --git a/btree/BTreeValueList.cs b/btree/BTreeValueList.cs index 58f6763..d81d226 100644 --- a/btree/BTreeValueList.cs +++ b/btree/BTreeValueList.cs @@ -5,6 +5,8 @@ namespace ln.types.btree { public class BTreeValueList { + public bool Empty => bTree.Empty; + BTree> bTree; public BTreeValueList() @@ -131,6 +133,9 @@ namespace ln.types.btree throw new Exception("Serious BUG"); } + public K First => bTree.First(); + public K Last => bTree.Last(); + public IEnumerable Keys => bTree.Keys; diff --git a/cache/Cache.cs b/cache/Cache.cs index 597a284..966093d 100644 --- a/cache/Cache.cs +++ b/cache/Cache.cs @@ -1,6 +1,7 @@ using System; using ln.types.btree; using ln.types.collections; +using ln.types.odb.ng.storage; namespace ln.types.cache { public class Cache @@ -11,7 +12,7 @@ namespace ln.types.cache BTree> itemTree; LinkedList items = new LinkedList(); - int maxCacheSize = 4096; + int maxCacheSize = 4096; public Cache() {