public virtual void Add(TrieMapMatcher.PartialApproxMatch <K, V> pam)
            {
                IList <Match <K, V> > multiMatchesWithoutOffsets = null;

                if (pam.multimatches != null)
                {
                    multiMatchesWithoutOffsets = new List <Match <K, V> >(pam.multimatches.Count);
                    foreach (Match <K, V> m in pam.multimatches)
                    {
                        multiMatchesWithoutOffsets.Add(new Match <K, V>(m.matched, m.value, 0, 0));
                    }
                }
                Match <K, V> m_1 = new MultiMatch <K, V>(pam.matched, pam.value, pam.begin, pam.end, multiMatchesWithoutOffsets);

                queue[m_1] = pam;
            }
            public override void Add(TrieMapMatcher.PartialApproxMatch <K, V> pam)
            {
                Match <K, V> m   = new MultiMatch <K, V>(pam.matched, pam.value, pam.begin, pam.end, pam.multimatches);
                int          key = (pam.multimatches != null) ? pam.multimatches.Count : 0;

                if (pam.value == null)
                {
                    key = key + 1;
                }
                BoundedCostOrderedMap <Match <K, V>, TrieMapMatcher.PartialApproxMatch <K, V> > mq = multimatchQueues[key];

                if (mq == null)
                {
                    multimatchQueues[key] = mq = new BoundedCostOrderedMap <Match <K, V>, TrieMapMatcher.PartialApproxMatch <K, V> >(MatchCostFunction, maxSize, maxCost);
                }
                mq[m] = pam;
            }