本文整理汇总了C#中java.util.ArrayList.iterator方法的典型用法代码示例。如果您正苦于以下问题:C# ArrayList.iterator方法的具体用法?C# ArrayList.iterator怎么用?C# ArrayList.iterator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.ArrayList
的用法示例。
在下文中一共展示了ArrayList.iterator方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: clear
public override void clear () {
List names = new ArrayList ();
for (Enumeration e = getAttributeNames (); e.hasMoreElements (); ) {
names.add (e.nextElement ());
}
for (Iterator it = names.iterator (); it.hasNext (); ) {
removeAttribute ((String) it.next ());
}
}
示例2: removeUnusedFields
public virtual void removeUnusedFields()
{
ArrayList arrayList = new ArrayList();
Iterator iterator1 = this.fields.keySet().iterator();
while (iterator1.hasNext())
{
string str = (string) iterator1.next();
if (!this.table.containsKey(str) && !this.table.containsSubTable(str))
arrayList.add((object) str);
}
Iterator iterator2 = arrayList.iterator();
while (iterator2.hasNext())
{
string field = (string) iterator2.next();
this.removeField(field);
this.hiddenFields.remove((object) field);
}
}
示例3: makeExplicitParameterTypeInference
private void makeExplicitParameterTypeInference(ExpressionNode expression, TypeInfo toType,
HashMap<TypeInfo, TypeVariableInfo> typeVariableInfos) {
var method = getInvokeMethod(toType);
if (method == null) {
return;
}
if (expression.ExpressionKind == ExpressionKind.Lambda) {
var lambda = (LambdaExpressionNode)expression;
if (lambda.Parameters.size() != method.Parameters.count()) {
return;
}
}
var rinfo = typeVariableInfos[method.ReturnType];
if (rinfo != null) {
foreach (var p in method.Parameters) {
if (p.Type == method.ReturnType) {
continue;
}
var pinfo = typeVariableInfos[p.Type];
if (pinfo != null) {
rinfo.dependencies.add(pinfo.genericParameterType);
}
}
}
if (expression.ExpressionKind == ExpressionKind.Lambda) {
var lambda = (LambdaExpressionNode)expression;
var fromTypes = new ArrayList<TypeInfo>();
var pit = method.Parameters.iterator();
foreach (var p in lambda.Parameters) {
var ptype = pit.next().Type;
if (p.Type == null) {
if (ptype.IsClosed) {
fromTypes.add(ptype);
} else {
return;
}
} else {
fromTypes.add(CompilerHelper.resolveTypeReference(context, context.CurrentType.PackageName, p.Type));
}
}
context.CodeValidationContext.pushLambdaParameters(fromTypes);
bool success = expressionValidator.handleExpressionNoError(expression, null, true);
context.CodeValidationContext.popLambdaParameters();
var info = expression.getUserData(typeof(ExpressionInfo));
if (info == null) {
return;
}
expression.removeUserData(typeof(ExpressionInfo));
if (!success) {
return;
}
var mit = method.Parameters.iterator();
var fit = fromTypes.iterator();
while (mit.hasNext()) {
makeExactInference(fit.next(), mit.next().Type, typeVariableInfos);
}
makeExactInference(context.CodeValidationContext.LambdaReturnType, method.ReturnType, typeVariableInfos);
} else {
var info = expression.getUserData(typeof(ExpressionInfo));
if (info == null) {
return;
}
var paramTypes = new ArrayList<TypeInfo>();
foreach (var p in method.Parameters) {
paramTypes.add(p.Type);
}
var meth = resolveMethodGroup(info, method, paramTypes);
if (meth == null) {
return;
}
var mit = method.Parameters.iterator();
var cit = meth.Parameters.iterator();
while (mit.hasNext()) {
makeExactInference(cit.next().Type, mit.next().Type, typeVariableInfos);
}
makeExactInference(meth.ReturnType, method.ReturnType, typeVariableInfos);
}
}