From 830987e80a58222568f29551ee62efa82c64bf35 Mon Sep 17 00:00:00 2001 From: Kevin Glynn Date: Mon, 18 Apr 2011 19:27:23 +0200 Subject: [PATCH] firtle with enumerators and collection templates --- .../Collections/Generic/IEnumerator'1.xml | 8 +++++--- .../Collections/Generic/KeyCollection'1.xml | 2 +- .../System/Collections/ICollection.xml | 14 +++++++++----- .../System/Collections/IEnumerable.xml | 18 +++++++++++------- .../System/Collections/IEnumerator.xml | 16 +++++++++++++--- .../Collections/Generic/EnumeratorSupport.java | 5 +++++ 6 files changed, 44 insertions(+), 19 deletions(-) diff --git a/CS2JLibrary/NetFramework/System/Collections/Generic/IEnumerator'1.xml b/CS2JLibrary/NetFramework/System/Collections/Generic/IEnumerator'1.xml index c8926fd..a7e1b6c 100644 --- a/CS2JLibrary/NetFramework/System/Collections/Generic/IEnumerator'1.xml +++ b/CS2JLibrary/NetFramework/System/Collections/Generic/IEnumerator'1.xml @@ -20,8 +20,10 @@ ${expr} - E - Current> - ${this:16}.getcurrent() + + E + Current + ${this:16}.getCurrent() + jEYi0rdl/kMLr7uBNG0M9LMlbCQ=C/hbBQnMGlWnPvwE61XrMusMlyKT+K792pEYR7D7CnpO7Td1gFgCCfkSdFVZ1axk+sLzebWIQKH8+NFRC6+hlNpViODt46v/300e+fi2Yx8BWhpq5e51zfNAhHIdaUemMqHMHNG5BMOngpFx1yrO/zxHvj7HPJqGBwJV7w8yPtU= diff --git a/CS2JLibrary/NetFramework/System/Collections/Generic/KeyCollection'1.xml b/CS2JLibrary/NetFramework/System/Collections/Generic/KeyCollection'1.xml index 8165edd..fc67239 100644 --- a/CS2JLibrary/NetFramework/System/Collections/Generic/KeyCollection'1.xml +++ b/CS2JLibrary/NetFramework/System/Collections/Generic/KeyCollection'1.xml @@ -47,7 +47,7 @@ CS2JNet.JavaSupport.Collections.Generic.EnumeratorSupport - new EnumeratorSupport*[T]*(${this}.iterator()) + new EnumeratorSupport*[T]*(${this:16}.iterator()) GetEnumerator diff --git a/CS2JLibrary/NetFramework/System/Collections/ICollection.xml b/CS2JLibrary/NetFramework/System/Collections/ICollection.xml index 4966293..f83a1f0 100644 --- a/CS2JLibrary/NetFramework/System/Collections/ICollection.xml +++ b/CS2JLibrary/NetFramework/System/Collections/ICollection.xml @@ -1,4 +1,4 @@ - + - - Iterable + + CS2JNet.System.Collections.Generic.ICollectionSupport + + ICollectionSupport System.Collections.ICollection System.Object - - ${this:16}.iterator() + + CS2JNet.JavaSupport.Collections.Generic.EnumeratorSupport + + EnumeratorSupport.mk(${this:16}.iterator()) GetEnumerator System.IEnumerator diff --git a/CS2JLibrary/NetFramework/System/Collections/IEnumerable.xml b/CS2JLibrary/NetFramework/System/Collections/IEnumerable.xml index 581c222..fbc5989 100644 --- a/CS2JLibrary/NetFramework/System/Collections/IEnumerable.xml +++ b/CS2JLibrary/NetFramework/System/Collections/IEnumerable.xml @@ -1,4 +1,4 @@ - + - - Iterable - System.Collections.IEnumerable + + CS2JNet.System.Collections.Generic.IEnumeratorSupport + + IEnumeratorSupport + System.Collections.IEnumerator System.Object - - ${this:16}.iterator() + + CS2JNet.JavaSupport.Collections.Generic.EnumeratorSupport + + EnumeratorSupport.mk(${this:16}.iterator()) GetEnumerator - System.IEnumerator + System.Collections.IEnumerator diff --git a/CS2JLibrary/NetFramework/System/Collections/IEnumerator.xml b/CS2JLibrary/NetFramework/System/Collections/IEnumerator.xml index fab0041..30ab6bb 100644 --- a/CS2JLibrary/NetFramework/System/Collections/IEnumerator.xml +++ b/CS2JLibrary/NetFramework/System/Collections/IEnumerator.xml @@ -12,9 +12,19 @@ IEnumeratorSupport System.Collections.IEnumerator + + + ${this:16}.MoveNext() + + MoveNext + System.Boolean + + - System.Object - Current> - ${this:16}.getcurrent() + + System.Object + Current + ${this:16}.getCurrent() + jEYi0rdl/kMLr7uBNG0M9LMlbCQ=C/hbBQnMGlWnPvwE61XrMusMlyKT+K792pEYR7D7CnpO7Td1gFgCCfkSdFVZ1axk+sLzebWIQKH8+NFRC6+hlNpViODt46v/300e+fi2Yx8BWhpq5e51zfNAhHIdaUemMqHMHNG5BMOngpFx1yrO/zxHvj7HPJqGBwJV7w8yPtU= diff --git a/CS2JLibrary/src/CS2JNet/JavaSupport/Collections/Generic/EnumeratorSupport.java b/CS2JLibrary/src/CS2JNet/JavaSupport/Collections/Generic/EnumeratorSupport.java index 3c1f56d..ccb564f 100644 --- a/CS2JLibrary/src/CS2JNet/JavaSupport/Collections/Generic/EnumeratorSupport.java +++ b/CS2JLibrary/src/CS2JNet/JavaSupport/Collections/Generic/EnumeratorSupport.java @@ -20,6 +20,7 @@ */ package CS2JNet.JavaSupport.Collections.Generic; +import java.util.Collection; import java.util.Iterator; import CS2JNet.JavaSupport.CS2JRunTimeException; @@ -37,6 +38,10 @@ public class EnumeratorSupport implements IEnumeratorSupport { private Iterator myIterator = null; private T myCurrent = null; + public static EnumeratorSupport mk(Iterator inIt) { + return new EnumeratorSupport(inIt); + } + public EnumeratorSupport(Iterator it) { myIterator = it; }