当前位置: 首页>>代码示例>>C#>>正文


C# SortedDictionary.EntrySet方法代码示例

本文整理汇总了C#中SortedDictionary.EntrySet方法的典型用法代码示例。如果您正苦于以下问题:C# SortedDictionary.EntrySet方法的具体用法?C# SortedDictionary.EntrySet怎么用?C# SortedDictionary.EntrySet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SortedDictionary的用法示例。


在下文中一共展示了SortedDictionary.EntrySet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: parseTypes

	  // parses a list of MappingCharFilter style rules into a custom byte[] type table
	  private sbyte[] parseTypes(IList<string> rules)
	  {
		SortedMap<char?, sbyte?> typeMap = new SortedDictionary<char?, sbyte?>();
		foreach (string rule in rules)
		{
		  Matcher m = typePattern.matcher(rule);
		  if (!m.find())
		  {
			throw new System.ArgumentException("Invalid Mapping Rule : [" + rule + "]");
		  }
		  string lhs = parseString(m.group(1).Trim());
		  sbyte? rhs = parseType(m.group(2).Trim());
		  if (lhs.Length != 1)
		  {
			throw new System.ArgumentException("Invalid Mapping Rule : [" + rule + "]. Only a single character is allowed.");
		  }
		  if (rhs == null)
		  {
			throw new System.ArgumentException("Invalid Mapping Rule : [" + rule + "]. Illegal type.");
		  }
		  typeMap.put(lhs[0], rhs);
		}

		// ensure the table is always at least as big as DEFAULT_WORD_DELIM_TABLE for performance
		sbyte[] types = new sbyte[Math.Max(typeMap.LastKey() + 1, WordDelimiterIterator.DEFAULT_WORD_DELIM_TABLE.Length)];
		for (int i = 0; i < types.Length; i++)
		{
		  types[i] = WordDelimiterIterator.getType(i);
		}
		foreach (KeyValuePair<char?, sbyte?> mapping in typeMap.EntrySet())
		{
		  types[mapping.Key] = mapping.Value;
		}
		return types;
	  }
开发者ID:paulirwin,项目名称:lucene.net,代码行数:36,代码来源:WordDelimiterFilterFactory.cs

示例2: SimpleTVTermsEnum

 internal SimpleTVTermsEnum(SortedDictionary<BytesRef, SimpleTVPostings> terms)
 {
     _terms = terms;
     _iterator = terms.EntrySet().GetEnumerator();
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:5,代码来源:SimpleTextTermVectorsReader.cs

示例3: SeekCeil

            public override SeekStatus SeekCeil(BytesRef text)
            {
                var newTerms = new SortedDictionary<BytesRef, SimpleTVPostings>();
                foreach (var p in _terms.Where(p => p.Key.CompareTo(text) >= 0))
                    newTerms.Add(p.Key, p.Value);

                _iterator = newTerms.EntrySet().GetEnumerator();

                try
                {
                    _iterator.MoveNext();
                    return _iterator.Current.Key.Equals(text) ? SeekStatus.FOUND : SeekStatus.NOT_FOUND;
                }
                catch
                {
                    return SeekStatus.END;
                }
            }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:18,代码来源:SimpleTextTermVectorsReader.cs

示例4: Authorize

		/// <exception cref="System.IO.IOException"></exception>
		private void Authorize(HttpURLConnection c)
		{
			IDictionary<string, IList<string>> reqHdr = c.GetRequestProperties();
			SortedDictionary<string, string> sigHdr = new SortedDictionary<string, string>();
			foreach (KeyValuePair<string, IList<string>> entry in reqHdr.EntrySet())
			{
				string hdr = entry.Key;
				if (IsSignedHeader(hdr))
				{
					sigHdr.Put(StringUtils.ToLowerCase(hdr), ToCleanString(entry.Value));
				}
			}
			StringBuilder s = new StringBuilder();
			s.Append(c.GetRequestMethod());
			s.Append('\n');
			s.Append(Remove(sigHdr, "content-md5"));
			s.Append('\n');
			s.Append(Remove(sigHdr, "content-type"));
			s.Append('\n');
			s.Append(Remove(sigHdr, "date"));
			s.Append('\n');
			foreach (KeyValuePair<string, string> e in sigHdr.EntrySet())
			{
				s.Append(e.Key);
				s.Append(':');
				s.Append(e.Value);
				s.Append('\n');
			}
			string host = c.GetURL().GetHost();
			s.Append('/');
			s.Append(Sharpen.Runtime.Substring(host, 0, host.Length - DOMAIN.Length - 1));
			s.Append(c.GetURL().AbsolutePath);
			string sec;
			try
			{
				Mac m = Mac.GetInstance(HMAC);
				m.Init(privateKey);
				sec = Base64.EncodeBytes(m.DoFinal(Sharpen.Runtime.GetBytesForString(s.ToString()
					, "UTF-8")));
			}
			catch (NoSuchAlgorithmException e_1)
			{
				throw new IOException(MessageFormat.Format(JGitText.Get().noHMACsupport, HMAC, e_1
					.Message));
			}
			catch (InvalidKeyException e_1)
			{
				throw new IOException(MessageFormat.Format(JGitText.Get().invalidKey, e_1.Message
					));
			}
			c.SetRequestProperty("Authorization", "AWS " + publicKey + ":" + sec);
		}
开发者ID:nickname100,项目名称:monodevelop,代码行数:53,代码来源:AmazonS3.cs


注:本文中的SortedDictionary.EntrySet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。