Exemple #1
0
        public void TrieContractMoveToNode2()
        {
            ITrie <String, char, String> trie = this.GetInstance();

            ITrieNode <char, String> node = trie.MoveToNode("test");

            Assert.IsNotNull(node);
            Assert.AreEqual(4, trie.Count);

            node = trie.MoveToNode("test");
            Assert.IsNotNull(node);
            Assert.AreEqual(4, trie.Count);
        }
 /// <summary>
 /// Creates a URI interning it if interning is enabled via the <see cref="Options.InternUris">Options.InternUris</see>
 /// </summary>
 /// <param name="uri">String URI</param>
 /// <returns></returns>
 /// <remarks>
 /// When URI interning is disabled this is equivalent to just invoking the constructor of the <see cref="Uri">Uri</see> class
 /// </remarks>
 public static Uri Create(String uri)
 {
     if (Options.InternUris)
     {
         ITrieNode <char, Uri> node = _uris.MoveToNode(uri);
         if (node.HasValue)
         {
             return(node.Value);
         }
         Uri u = new Uri(uri);
         node.Value = u;
         return(node.Value);
     }
     return(new Uri(uri));
 }