コード例 #1
0
        private void SplitOne(ZipResult zipResult, TValue value)
        {
            var leftChild = new PatriciaTrieNode <TValue>(zipResult.ThisRest, mValues, mChildren);

            mChildren = new Dictionary <char, PatriciaTrieNode <TValue> >();
            mValues   = new Queue <TValue>();
            AddValue(value);
            mKey = zipResult.CommonHead;

            mChildren.Add(zipResult.ThisRest[0], leftChild);
        }
コード例 #2
0
        protected void GetOrCreateChild(StringPartition key, TValue value)
        {
            PatriciaTrieNode <TValue> child;

            if (!mChildren.TryGetValue(key[0], out child))
            {
                child = new PatriciaTrieNode <TValue>(key, value);
                mChildren.Add(key[0], child);
            }
            else
            {
                child.Add(key, value);
            }
        }
コード例 #3
0
        private void SplitTwo(ZipResult zipResult, TValue value)
        {
            var leftChild  = new PatriciaTrieNode <TValue>(zipResult.ThisRest, mValues, mChildren);
            var rightChild = new PatriciaTrieNode <TValue>(zipResult.OtherRest, value);

            mChildren = new Dictionary <char, PatriciaTrieNode <TValue> >();
            mValues   = new Queue <TValue>();
            mKey      = zipResult.CommonHead;

            char leftKey = zipResult.ThisRest[0];

            mChildren.Add(leftKey, leftChild);
            char rightKey = zipResult.OtherRest[0];

            mChildren.Add(rightKey, rightChild);
        }