diff --git a/CS2JLibrary/NetFramework/System/Collections/Generic/LCC/List'1.xml b/CS2JLibrary/NetFramework/System/Collections/Generic/LCC/List'1.xml new file mode 100644 index 0000000..97fe07f --- /dev/null +++ b/CS2JLibrary/NetFramework/System/Collections/Generic/LCC/List'1.xml @@ -0,0 +1,205 @@ + + + + + CS2JNet.System.Collections.LCC.CSList + + CSList*[${T}]* + System.Collections.Generic.List + + T + + + + IList*[T]* + ICollection*[T]* + IEnumerable*[T]* + + + T + ${expr} + + + + + ${this:16}.add(${arg}) + + + T + arg + + + Add + System.Void + + + ${this:16}.addRange(${arg}) + + + T[] + arg + + + AddRange + System.Void + + + + ${this:16}.addRange(${arg}) + + + System.Collections.Generic.IEnumerable*[T]* + arg + + + AddRange + System.Void + + + + ${this:16}.clear() + + Clear + System.Void + + + + ${this:16}.contains(${key}) + + + T + key + + + Contains + System.Boolean + + + + ${this:16}.add(${index}, ${value}) + + + System.Int32 + index + + + T + value + + + Insert + System.Void + + + + ${this:16}.remove(${value}) + + + T + value + + + Remove + System.Boolean + + + + ${this:16}.remove((int)${value}) + + + System.Int32 + index + + + RemoveAt + System.Void + + + ${this:16}.toArray(new ${T}[${this}.size()]) + + + ToArray + T[] + + + + java.util.Collections + + Collections.sort(${this}) + + Sort + System.Void + + + + + + ${this:16}.size() + System.Int32 + Count + ${this:16}.size() + ${this:16}.setCount(${value}) + + + + + + + + + System.Int32 + i + + + T + ${this:16}.get(${i}) + ${this:16}.add(${i}, ${value}) + + + + + + new CSList*[${T}]*() + + + + + new CSList*[${T}]*(${length}) + + + System.Int32 + length + + + + + new CSList*[${T}]*(${collection}) + + + T[] + collection + + + + + new CSList*[${T}]*(${collection}) + + + System.Collections.Generic.IEnumerable*[T]* + collection + + + + + + + + +dMxWahle6+JWazXF5rdEoxNFqHQ=QHAtm2BA/7k2dSASQHMw6aKKJEGk6P2x5HAGuae81wbbLDkrnihhH2PFU+6WFudzrinE4JSp9WOHKzOxJ659kj6Wg8qx5asDxOhkhG06He0TE4jcq64/U0tM2GZxViqhaFHAExXAZoT9rxjqP5prxerSnSvfy16hhPAixY5XEEA= diff --git a/CS2JLibrary/NetFramework/System/Collections/Generic/List'1.xml b/CS2JLibrary/NetFramework/System/Collections/Generic/List'1.xml index 42640b6..0d1bcb9 100644 --- a/CS2JLibrary/NetFramework/System/Collections/Generic/List'1.xml +++ b/CS2JLibrary/NetFramework/System/Collections/Generic/List'1.xml @@ -9,17 +9,18 @@ --> - java.util.ArrayList + CS2JNet.System.Collections.CSList - ArrayList*[${T}]* + CSList*[${T}]* System.Collections.Generic.List T - + IList*[T]* + ICollection*[T]* + IEnumerable*[T]* T @@ -36,14 +37,10 @@ Add - - System.Int32 + System.Void - - java.util.Arrays - - ${this:16}.addAll(Arrays.asList(${arg})) + ${this:16}.addRange(${arg}) T[] @@ -55,7 +52,7 @@ - ${this:16}.addAll(${arg}) + ${this:16}.addRange(${arg}) System.Collections.Generic.IEnumerable*[T]* @@ -169,12 +166,12 @@ - new ArrayList*[${T}]*() + new CSList*[${T}]*() - new ArrayList*[${T}]*(${length}) + new CSList*[${T}]*(${length}) System.Int32 @@ -183,10 +180,7 @@ - - java.util.Arrays - - new ArrayList*[${T}]*(Arrays.asList(${collection})) + new CSList*[${T}]*(${collection}) T[] @@ -195,10 +189,7 @@ - - CS2JNet.System.Collections.Generic.GenArrayListSupport - - GenArrayListSupport.*[${T}]*toList(${collection}) + new CSList*[${T}]*(${collection}) System.Collections.Generic.IEnumerable*[T]* diff --git a/CS2JLibrary/NetFramework/System/LCC/Predicate'1.xml b/CS2JLibrary/NetFramework/System/LCC/Predicate'1.xml new file mode 100644 index 0000000..cda061f --- /dev/null +++ b/CS2JLibrary/NetFramework/System/LCC/Predicate'1.xml @@ -0,0 +1,78 @@ + + + + + CS2JNet.System.LCC.Predicate + + Predicate*[${T}]* + System.Predicate + + T + + + + System.Object + + + + + CS2JNet.System.LCC.__MultiPredicate + + __MultiPredicate.combine(${a},${b}) + + + System.Predicate*[T]* + a + + + System.Predicate*[T]* + b + + + Combine + + T + + System.Predicate*[T]* + + + + CS2JNet.System.LCC.__MultiPredicate + + __MultiPredicate.remove(${a},${b}) + + + System.Predicate*[T]* + a + + + System.Predicate*[T]* + b + + + Remove + + T + + System.Predicate*[T]* + + + + ${this:16}.invoke(${a}) + + + T + a + + + Invoke + + System.Boolean + +yz+yOlqpwafASqBPdP2mB/lVgZk=Nv+agoqBJd5WaI7/+c3HuvQ/dt5/5j3fHCKxNm4v8TZITAC8J+AbF8DN3l3ZZC1+zmhBzRTyrMMD7EWi7zumiRrhC2r/+rUpYbfOeiHANORPmwqP5NvSBeUbWvEp3VRBtQZHYNTDNG1gbOApoTGZi0z3dSv1ySftgALkYlxmbrc= diff --git a/CS2JLibrary/src/CS2JNet/System/ArgumentNullException.java b/CS2JLibrary/src/CS2JNet/System/ArgumentNullException.java new file mode 100644 index 0000000..4ea9f1f --- /dev/null +++ b/CS2JLibrary/src/CS2JNet/System/ArgumentNullException.java @@ -0,0 +1,78 @@ +/* + Copyright 2007,2008,2009,2010 Rustici Software, LLC + Copyright 2010,2011 Kevin Glynn (kevin.glynn@twigletsoftware.com) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Author(s): + + Kevin Glynn (kevin.glynn@twigletsoftware.com) +*/ + +package CS2JNet.System; + +public class ArgumentNullException extends ArgumentException { + + + /** + * + */ + private static final long serialVersionUID = 5588457279046701403L; + + /** + * + */ + public ArgumentNullException() { + } + + /** + * @param arg0 + */ + public ArgumentNullException(String arg0) { + super(arg0); + } + + /** + * @param arg0 + */ + public ArgumentNullException(Throwable arg0) { + super(arg0); + // TODO Auto-generated constructor stub + } + + /** + * @param arg0 the detail message + * @param arg1 the cause + */ + public ArgumentNullException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + + /** + * @param arg0 the detail message + * @param arg1 the parameter name + */ + public ArgumentNullException(String arg0, String arg1) { + super(arg0, arg1); + } + + /** + * @param arg0 the detail message + * @param p the parameter name + * @param arg1 the cause + */ + public ArgumentNullException(String arg0, String p, Throwable arg1) { + super(arg0, p, arg1); + } + +} diff --git a/CS2JLibrary/src/CS2JNet/System/ArgumentOutOfRangeException.java b/CS2JLibrary/src/CS2JNet/System/ArgumentOutOfRangeException.java new file mode 100644 index 0000000..b77b14a --- /dev/null +++ b/CS2JLibrary/src/CS2JNet/System/ArgumentOutOfRangeException.java @@ -0,0 +1,78 @@ +/* + Copyright 2007,2008,2009,2010 Rustici Software, LLC + Copyright 2010,2011 Kevin Glynn (kevin.glynn@twigletsoftware.com) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Author(s): + + Kevin Glynn (kevin.glynn@twigletsoftware.com) +*/ + +package CS2JNet.System; + +public class ArgumentOutOfRangeException extends ArgumentException { + + + /** + * + */ + private static final long serialVersionUID = 8718969647532507719L; + + /** + * + */ + public ArgumentOutOfRangeException() { + } + + /** + * @param arg0 + */ + public ArgumentOutOfRangeException(String arg0) { + super(arg0); + } + + /** + * @param arg0 + */ + public ArgumentOutOfRangeException(Throwable arg0) { + super(arg0); + } + + /** + * @param arg0 the detail message + * @param arg1 the cause + */ + public ArgumentOutOfRangeException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + + /** + * @param arg0 the detail message + * @param arg1 the parameter name + */ + public ArgumentOutOfRangeException(String arg0, String arg1) { + super(arg0, arg1); + } + + /** + * @param arg0 the detail message + * @param p the parameter name + * @param arg1 the cause + */ + public ArgumentOutOfRangeException(String arg0, String p, Throwable arg1) { + super(arg0, p, arg1); + } + + +} diff --git a/CS2JLibrary/src/CS2JNet/System/Collections/CSList.java b/CS2JLibrary/src/CS2JNet/System/Collections/CSList.java new file mode 100644 index 0000000..0bfd3e7 --- /dev/null +++ b/CS2JLibrary/src/CS2JNet/System/Collections/CSList.java @@ -0,0 +1,168 @@ +/* + Copyright 2010,2011 Kevin Glynn (kevin.glynn@twigletsoftware.com) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Author(s): + + Kevin Glynn (kevin.glynn@twigletsoftware.com) +*/ + +package CS2JNet.System.Collections; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + +import CS2JNet.JavaSupport.Collections.Generic.EnumeratorSupport; +import CS2JNet.System.ArgumentException; +import CS2JNet.System.ArgumentNullException; +import CS2JNet.System.ArgumentOutOfRangeException; + +/** + * @author keving + * + */ +public class CSList implements ICollection, IEnumerable, Collection { + + private List myList = null; + + public CSList() { + myList = new ArrayList(); + } + + public CSList(int size) { + myList = new ArrayList(size); + } + + public CSList(IEnumerable coll) { + myList = new ArrayList(); + for (T el : coll) { + myList.add(el); + } + } + + public CSList(T[] coll) { + myList = new ArrayList(coll.length); + for (T el : coll) { + myList.add(el); + } + } + + + @Override + public Iterator iterator() { + return myList.iterator(); + } + + @Override + public boolean add(T arg0) { + return myList.add(arg0); + } + + @Override + public boolean addAll(Collection arg0) { + return myList.addAll(arg0); + } + + @Override + public void clear() { + myList.clear(); + + } + + @Override + public boolean contains(Object arg0) { + return myList.contains(arg0); + } + + @Override + public boolean containsAll(Collection arg0) { + return myList.containsAll(arg0); + } + + @Override + public boolean isEmpty() { + return myList.isEmpty(); + } + + @Override + public boolean remove(Object arg0) { + return myList.remove(arg0); + } + + @Override + public boolean removeAll(Collection arg0) { + return myList.removeAll(arg0); + } + + @Override + public boolean retainAll(Collection arg0) { + return myList.retainAll(arg0); + } + + @Override + public int size() { + return myList.size(); + } + + @Override + public Object[] toArray() { + return myList.toArray(); + } + + @Override + public S[] toArray(S[] arg0) { + return myList.toArray(arg0); + } + + @Override + public boolean Contains(T x) throws Exception { + return myList.contains(x); + } + + @Override + public void Add(T x) throws Exception { + myList.add(x); + } + + @Override + public boolean Remove(T x) throws Exception { + return myList.remove(x); + } + + @Override + public void Clear() throws Exception { + myList.clear(); + } + + @Override + public IEnumerator GetEnumerator() throws Exception { + return EnumeratorSupport.mk(myList.iterator()); + } + + @Override + public void CopyTo(T[] arr, int i) throws Exception { + if (arr == null) + throw new ArgumentNullException(); + if (i < 0) + throw new ArgumentOutOfRangeException(); + if (i + arr.length < myList.size()) + throw new ArgumentException(); + for (int idx = 0; idx < arr.length; idx++){ + arr[idx+i] = myList.get(idx); + } + } + +} diff --git a/CS2JLibrary/src/CS2JNet/System/Collections/LCC/CSList.java b/CS2JLibrary/src/CS2JNet/System/Collections/LCC/CSList.java new file mode 100644 index 0000000..0b10f4a --- /dev/null +++ b/CS2JLibrary/src/CS2JNet/System/Collections/LCC/CSList.java @@ -0,0 +1,175 @@ +/* + Copyright 2010,2011 Kevin Glynn (kevin.glynn@twigletsoftware.com) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Author(s): + + Kevin Glynn (kevin.glynn@twigletsoftware.com) +*/ + +package CS2JNet.System.Collections.LCC; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + +import CS2JNet.JavaSupport.Collections.Generic.LCC.EnumeratorSupport; +import CS2JNet.System.ArgumentException; +import CS2JNet.System.ArgumentNullException; +import CS2JNet.System.ArgumentOutOfRangeException; + +/** + * @author keving + * + */ +public class CSList implements ICollection, IEnumerable, Collection { + + private List myList = null; + + public CSList() { + myList = new ArrayList(); + } + + public CSList(int size) { + myList = new ArrayList(size); + } + + public CSList(IEnumerable coll) { + myList = new ArrayList(); + for (T el : coll) { + myList.add(el); + } + } + + public CSList(T[] coll) { + myList = new ArrayList(coll.length); + for (T el : coll) { + myList.add(el); + } + } + + @Override + public Iterator iterator() { + return myList.iterator(); + } + + @Override + public boolean add(T arg0) { + return myList.add(arg0); + } + + @Override + public boolean addAll(Collection arg0) { + return myList.addAll(arg0); + } + + @Override + public void clear() { + myList.clear(); + + } + + @Override + public boolean contains(Object arg0) { + return myList.contains(arg0); + } + + @Override + public boolean containsAll(Collection arg0) { + return myList.containsAll(arg0); + } + + @Override + public boolean isEmpty() { + return myList.isEmpty(); + } + + @Override + public boolean remove(Object arg0) { + return myList.remove(arg0); + } + + @Override + public boolean removeAll(Collection arg0) { + return myList.removeAll(arg0); + } + + @Override + public boolean retainAll(Collection arg0) { + return myList.retainAll(arg0); + } + + @Override + public int size() { + return myList.size(); + } + + @Override + public Object[] toArray() { + return myList.toArray(); + } + + @Override + public S[] toArray(S[] arg0) { + return myList.toArray(arg0); + } + + @Override + public boolean Contains(T x) throws Exception { + return myList.contains(x); + } + + @Override + public void Add(T x) throws Exception { + myList.add(x); + } + + @Override + public boolean Remove(T x) throws Exception { + return myList.remove(x); + } + + @Override + public void Clear() throws Exception { + myList.clear(); + } + + public IEnumerator GetEnumerator() throws Exception { + return EnumeratorSupport.mk(myList.iterator()); + } + + public void CopyTo(T[] arr, int i) throws Exception { + if (arr == null) + throw new ArgumentNullException(); + if (i < 0) + throw new ArgumentOutOfRangeException(); + if (i + arr.length < myList.size()) + throw new ArgumentException(); + for (int idx = 0; idx < arr.length; idx++){ + arr[idx+i] = myList.get(idx); + } + } + + @Override + public IEnumerator getEnumerator() throws Exception { + return GetEnumerator(); + } + + @Override + public void copyTo(T[] arr, int i) throws Exception { + CopyTo(arr, i); + } + +}