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


C# Collection.iterator方法代码示例

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


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

示例1: containsAll

		public virtual bool containsAll(Collection c)
		{
			Iterator i = c.iterator();
			while (i.hasNext())
			{
				object val = i.next();
				if (!contains(val))
					return false;
			}
			return true;
		}
开发者ID:jacobraj,项目名称:MAMA,代码行数:11,代码来源:ArrayListCollection.cs

示例2: addAll

		public virtual bool addAll(Collection c)
		{
			int count = size();
			Iterator i = c.iterator();
			while (i.hasNext())
			{
				object val = i.next();
				add(val);
			}
			return count != size();
		}
开发者ID:jacobraj,项目名称:MAMA,代码行数:11,代码来源:ArrayListCollection.cs

示例3: join

 public static string join(string delimiter, Collection values)
 {
   StringBuffer stringBuffer = new StringBuffer();
   Iterator iterator = values.iterator();
   while (iterator.hasNext())
   {
     object obj = iterator.next();
     stringBuffer.append(ParameterizedAssertionError.stringValueOf(obj));
     if (iterator.hasNext())
       stringBuffer.append(delimiter);
   }
   return stringBuffer.toString();
 }
开发者ID:NALSS,项目名称:SmartDashboard.NET,代码行数:13,代码来源:ParameterizedAssertionError.cs

示例4: calculateMean

 public static double calculateMean(Collection values, bool includeNullAndNaN)
 {
   int num1 = includeNullAndNaN ? 1 : 0;
   if (values == null)
   {
     string str = "Null 'values' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else
   {
     int num2 = 0;
     double num3 = 0.0;
     Iterator iterator = values.iterator();
     while (iterator.hasNext())
     {
       object obj = iterator.next();
       if (obj == null)
       {
         if (num1 != 0)
           return double.NaN;
       }
       else if (obj is Number)
       {
         Number number = (Number) obj;
         if (Double.isNaN(number.doubleValue()))
         {
           if (num1 != 0)
             return double.NaN;
         }
         else
         {
           num3 += number.doubleValue();
           ++num2;
         }
       }
     }
     return num3 / (double) num2;
   }
 }
开发者ID:NALSS,项目名称:SmartDashboard.NET,代码行数:40,代码来源:Statistics.cs

示例5: containsAll

			public bool containsAll(Collection c)
			{
				Iterator i = c.iterator();
				while (i.hasNext())
				{
					object key = i.next();
					if (!mHashTable.ContainsKey(key))
						return false;
				}
				return true;
			}
开发者ID:jacobraj,项目名称:MAMA,代码行数:11,代码来源:HashMap.cs

示例6: addAll

			public bool addAll(Collection c)
			{
				bool modified = false;
				int count = mSource.size();
				Iterator i = c.iterator();
				while (i.hasNext())
				{
					object key = i.next();
					object val = mSource.put(key, null);
					if (val != null)
					{
						modified = true;
					}
				}
				return modified || (mSource.size() != count);
			}
开发者ID:jacobraj,项目名称:MAMA,代码行数:16,代码来源:RedBlackTree.cs

示例7: removeAll

				public bool removeAll(Collection c)
				{
					int count = mSource.size();
					Iterator i = c.iterator();
					while (i.hasNext())
					{
						MapEntry e = (MapEntry)i.next();
						mSource.remove(e.getKey());
					}
					return count != mSource.size();
				}
开发者ID:jacobraj,项目名称:MAMA,代码行数:11,代码来源:RedBlackTree.cs

示例8: containsAll

				public bool containsAll(Collection c)
				{
					Iterator i = c.iterator();
					while (i.hasNext())
					{
						MapEntry e = (MapEntry)i.next();
						if (!mSource.containsKey(e.getKey()))
							return false;
					}
					return true;
				}
开发者ID:jacobraj,项目名称:MAMA,代码行数:11,代码来源:RedBlackTree.cs

示例9: deepClone

 public static Collection deepClone(Collection collection)
 {
   if (collection == null)
   {
     string str = "Null 'collection' argument.";
     Throwable.__\u003CsuppressFillInStackTrace\u003E();
     throw new IllegalArgumentException(str);
   }
   else
   {
     Collection collection1 = (Collection) ObjectUtilities.clone((object) collection);
     collection1.clear();
     Iterator iterator = collection.iterator();
     while (iterator.hasNext())
     {
       object @object = iterator.next();
       if (@object != null)
         collection1.add(ObjectUtilities.clone(@object));
       else
         collection1.add((object) null);
     }
     return collection1;
   }
 }
开发者ID:NALSS,项目名称:SmartDashboard.NET,代码行数:24,代码来源:ObjectUtilities.cs

示例10: removeAll

		public bool removeAll(Collection c)
		{
			int count = size();
			Iterator i = c.iterator();
			while (i.hasNext())
			{
				object o = i.next();
				remove(o);
			}
			return count != size();
		}
开发者ID:jacobraj,项目名称:MAMA,代码行数:11,代码来源:TreeSet.cs

示例11: retainAll

			public bool retainAll(Collection c)
			{
				int count = mHashMap.mHashTable.Count;
				Iterator i = c.iterator();
				while (i.hasNext())
				{
					MapEntry me = (MapEntry)i.next();
					object val = mHashMap.mHashTable[me.getKey()];
					if (val != me.getValue())
					{
						if (!mHashMap.mHashTable.ContainsKey(me.getKey()))
							mHashMap.mHashTable.Add(me.getKey(), me.getValue());
						else
							mHashMap.mHashTable.Remove(me.getKey());
					}
				}
				return mHashMap.mHashTable.Count != count;
			}
开发者ID:jacobraj,项目名称:MAMA,代码行数:18,代码来源:HashMap.cs

示例12: removeAll

			public bool removeAll(Collection c)
			{
				int count = mHashMap.mHashTable.Count;
				Iterator i = c.iterator();
				while (i.hasNext())
				{
					MapEntry me = (MapEntry)i.next();
					mHashMap.mHashTable.Remove(me.getKey());
				}
				return mHashMap.mHashTable.Count != count;
			}
开发者ID:jacobraj,项目名称:MAMA,代码行数:11,代码来源:HashMap.cs

示例13: addAll

			public bool addAll(Collection c)
			{
				int count = mHashMap.mHashTable.Count;
				Iterator i = c.iterator();
				while (i.hasNext())
				{
					MapEntry me = (MapEntry)i.next();
					mHashMap.mHashTable[me.getKey()] = me.getValue();
				}
				return mHashMap.mHashTable.Count != count;
			}
开发者ID:jacobraj,项目名称:MAMA,代码行数:11,代码来源:HashMap.cs

示例14: retainAll

		public bool retainAll(Collection c)
		{
			int count = size();
			Iterator i = c.iterator();
			while (i.hasNext())
			{
				object o = i.next();
				if (!contains(o))
					add(o);
				else
					remove(o);
			}
			return count != size();
		}
开发者ID:jacobraj,项目名称:MAMA,代码行数:14,代码来源:TreeSet.cs


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