From 45e530dceda42282fae56b4c4f5fa7865f57899d Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 4 Jun 2016 16:03:56 +0100 Subject: Remove dotnet (use submodule from dotnet repo instead) --- dotnet/Mammoth/Couscous/java/util/ArrayDeque.cs | 35 ------- dotnet/Mammoth/Couscous/java/util/ArrayList.cs | 49 ---------- dotnet/Mammoth/Couscous/java/util/Arrays.cs | 7 -- dotnet/Mammoth/Couscous/java/util/Collection.cs | 11 --- dotnet/Mammoth/Couscous/java/util/Deque.cs | 10 -- dotnet/Mammoth/Couscous/java/util/HashMap.cs | 69 -------------- dotnet/Mammoth/Couscous/java/util/HashSet.cs | 34 ------- dotnet/Mammoth/Couscous/java/util/Iterator.cs | 6 -- dotnet/Mammoth/Couscous/java/util/List.cs | 8 -- dotnet/Mammoth/Couscous/java/util/Map.cs | 15 --- .../Couscous/java/util/NoSuchElementException.cs | 6 -- dotnet/Mammoth/Couscous/java/util/Optional.cs | 103 --------------------- dotnet/Mammoth/Couscous/java/util/Set.cs | 6 -- .../Couscous/java/util/function/BiConsumer.cs | 5 - .../Couscous/java/util/function/BiFunction.cs | 6 -- .../Couscous/java/util/function/BiPredicate.cs | 6 -- .../Couscous/java/util/function/Consumer.cs | 5 - .../Couscous/java/util/function/Function.cs | 6 -- .../Couscous/java/util/function/Predicate.cs | 5 - .../Couscous/java/util/function/Supplier.cs | 5 - 20 files changed, 397 deletions(-) delete mode 100644 dotnet/Mammoth/Couscous/java/util/ArrayDeque.cs delete mode 100644 dotnet/Mammoth/Couscous/java/util/ArrayList.cs delete mode 100644 dotnet/Mammoth/Couscous/java/util/Arrays.cs delete mode 100644 dotnet/Mammoth/Couscous/java/util/Collection.cs delete mode 100644 dotnet/Mammoth/Couscous/java/util/Deque.cs delete mode 100644 dotnet/Mammoth/Couscous/java/util/HashMap.cs delete mode 100644 dotnet/Mammoth/Couscous/java/util/HashSet.cs delete mode 100644 dotnet/Mammoth/Couscous/java/util/Iterator.cs delete mode 100644 dotnet/Mammoth/Couscous/java/util/List.cs delete mode 100644 dotnet/Mammoth/Couscous/java/util/Map.cs delete mode 100644 dotnet/Mammoth/Couscous/java/util/NoSuchElementException.cs delete mode 100644 dotnet/Mammoth/Couscous/java/util/Optional.cs delete mode 100644 dotnet/Mammoth/Couscous/java/util/Set.cs delete mode 100644 dotnet/Mammoth/Couscous/java/util/function/BiConsumer.cs delete mode 100644 dotnet/Mammoth/Couscous/java/util/function/BiFunction.cs delete mode 100644 dotnet/Mammoth/Couscous/java/util/function/BiPredicate.cs delete mode 100644 dotnet/Mammoth/Couscous/java/util/function/Consumer.cs delete mode 100644 dotnet/Mammoth/Couscous/java/util/function/Function.cs delete mode 100644 dotnet/Mammoth/Couscous/java/util/function/Predicate.cs delete mode 100644 dotnet/Mammoth/Couscous/java/util/function/Supplier.cs (limited to 'dotnet/Mammoth/Couscous/java/util') diff --git a/dotnet/Mammoth/Couscous/java/util/ArrayDeque.cs b/dotnet/Mammoth/Couscous/java/util/ArrayDeque.cs deleted file mode 100644 index df5447d..0000000 --- a/dotnet/Mammoth/Couscous/java/util/ArrayDeque.cs +++ /dev/null @@ -1,35 +0,0 @@ -namespace Mammoth.Couscous.java.util { - internal class ArrayDeque : Deque { - private readonly System.Collections.Generic.IList _list = new System.Collections.Generic.List(); - - public int size() { - return _list.Count; - } - - public T getFirst() { - if (_list.Count > 0) { - return _list[0]; - } else { - throw new NoSuchElementException(); - } - } - - public T getLast() { - if (_list.Count > 0) { - return _list[_list.Count - 1]; - } else { - throw new NoSuchElementException(); - } - } - - public void add(T value) { - _list.Add(value); - } - - public T removeLast() { - T value = getLast(); - _list.RemoveAt(_list.Count - 1); - return value; - } - } -} diff --git a/dotnet/Mammoth/Couscous/java/util/ArrayList.cs b/dotnet/Mammoth/Couscous/java/util/ArrayList.cs deleted file mode 100644 index 4414123..0000000 --- a/dotnet/Mammoth/Couscous/java/util/ArrayList.cs +++ /dev/null @@ -1,49 +0,0 @@ -using Mammoth.Couscous.java.lang; -using Mammoth.Couscous.java.util; - -namespace Mammoth.Couscous.java.util { - internal class ArrayList : List { - private readonly System.Collections.Generic.IList _list; - - internal ArrayList() : this(new System.Collections.Generic.List()) { - } - - internal ArrayList(System.Collections.Generic.IList list) { - _list = list; - } - - public Iterator iterator() { - return ToJava.EnumeratorToIterator(_list.GetEnumerator()); - } - - public bool isEmpty() { - return _list.Count == 0; - } - - public int size() { - return _list.Count; - } - - public bool contains(object value) { - return value is T && _list.Contains((T) value); - } - - public T get(int index) { - if (index < 0 || index >= _list.Count) { - throw new IndexOutOfBoundsException(); - } else { - return _list[index]; - } - } - - public void add(T value) { - _list.Add(value); - } - - public T remove(int index) { - T value = _list[index]; - _list.RemoveAt(index); - return value; - } - } -} diff --git a/dotnet/Mammoth/Couscous/java/util/Arrays.cs b/dotnet/Mammoth/Couscous/java/util/Arrays.cs deleted file mode 100644 index 093db83..0000000 --- a/dotnet/Mammoth/Couscous/java/util/Arrays.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Mammoth.Couscous.java.util { - internal static class Arrays { - internal static List asList(T[] elements) { - return ToJava.ListToList(elements); - } - } -} diff --git a/dotnet/Mammoth/Couscous/java/util/Collection.cs b/dotnet/Mammoth/Couscous/java/util/Collection.cs deleted file mode 100644 index a0cae74..0000000 --- a/dotnet/Mammoth/Couscous/java/util/Collection.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Mammoth.Couscous.java.lang; - -namespace Mammoth.Couscous.java.util { - interface Collection : Iterable { - bool isEmpty(); - int size(); - bool contains(object value); - - void add(T value); - } -} diff --git a/dotnet/Mammoth/Couscous/java/util/Deque.cs b/dotnet/Mammoth/Couscous/java/util/Deque.cs deleted file mode 100644 index c954fce..0000000 --- a/dotnet/Mammoth/Couscous/java/util/Deque.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Mammoth.Couscous.java.util { - internal interface Deque { - int size(); - T getFirst(); - T getLast(); - - void add(T value); - T removeLast(); - } -} diff --git a/dotnet/Mammoth/Couscous/java/util/HashMap.cs b/dotnet/Mammoth/Couscous/java/util/HashMap.cs deleted file mode 100644 index 38e516e..0000000 --- a/dotnet/Mammoth/Couscous/java/util/HashMap.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using Mammoth.Couscous.org.zwobble.mammoth.@internal.util; -using Mammoth.Couscous.java.lang; - -namespace Mammoth.Couscous.java.util { - internal class HashMap : Map { - private readonly IDictionary _dictionary; - - internal HashMap() : this(new Dictionary()) { - } - - internal HashMap(IDictionary dictionary) { - _dictionary = dictionary; - } - - public void put(TKey key, TValue value) { - _dictionary[key] = value; - } - - public bool containsKey(TKey key) { - return _dictionary.ContainsKey(key); - } - - public Set> entrySet() { - return new EntrySet(_dictionary); - } - - public Optional _lookup(TKey key) { - if (_dictionary.ContainsKey(key)) { - return new Some(_dictionary[key]); - } else { - return new None(); - } - } - - public IDictionary AsDictionary() { - return _dictionary; - } - - internal class EntrySet : Set> { - private readonly IDictionary _dictionary; - - internal EntrySet(IDictionary dictionary) { - _dictionary = dictionary; - } - - public Iterator> iterator() { - return ToJava.EnumeratorToIterator(_dictionary.Select(entry => Maps.entry(entry.Key, entry.Value)).GetEnumerator()); - } - - public bool isEmpty() { - return _dictionary.Count == 0; - } - - public int size() { - return _dictionary.Count; - } - - public bool contains(object value) { - return value is TKey && _dictionary.ContainsKey((TKey) value); - } - - public void add(Map__Entry value) { - throw new UnsupportedOperationException(); - } - } - } -} diff --git a/dotnet/Mammoth/Couscous/java/util/HashSet.cs b/dotnet/Mammoth/Couscous/java/util/HashSet.cs deleted file mode 100644 index ac10075..0000000 --- a/dotnet/Mammoth/Couscous/java/util/HashSet.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Collections.Generic; - -namespace Mammoth.Couscous.java.util { - internal class HashSet : Set { - private readonly ISet _set; - - internal HashSet() : this(new System.Collections.Generic.HashSet()) { - } - - internal HashSet(ISet set) { - _set = set; - } - - public Iterator iterator() { - return ToJava.EnumeratorToIterator(_set.GetEnumerator()); - } - - public bool isEmpty() { - return _set.Count == 0; - } - - public int size() { - return _set.Count; - } - - public bool contains(object value) { - return value is T && _set.Contains((T)value); - } - - public void add(T value) { - _set.Add(value); - } - } -} diff --git a/dotnet/Mammoth/Couscous/java/util/Iterator.cs b/dotnet/Mammoth/Couscous/java/util/Iterator.cs deleted file mode 100644 index 0ae48b2..0000000 --- a/dotnet/Mammoth/Couscous/java/util/Iterator.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Mammoth.Couscous.java.util { - internal interface Iterator { - bool hasNext(); - T next(); - } -} diff --git a/dotnet/Mammoth/Couscous/java/util/List.cs b/dotnet/Mammoth/Couscous/java/util/List.cs deleted file mode 100644 index 45a9299..0000000 --- a/dotnet/Mammoth/Couscous/java/util/List.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Mammoth.Couscous.java.lang; - -namespace Mammoth.Couscous.java.util { - interface List : Collection { - T get(int index); - T remove(int index); - } -} diff --git a/dotnet/Mammoth/Couscous/java/util/Map.cs b/dotnet/Mammoth/Couscous/java/util/Map.cs deleted file mode 100644 index 5405c77..0000000 --- a/dotnet/Mammoth/Couscous/java/util/Map.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Mammoth.Couscous.java.util { - internal interface Map { - void put(K key, V value); - bool containsKey(K key); - Set> entrySet(); - - Optional _lookup(K key); - System.Collections.Generic.IDictionary AsDictionary(); - } - - internal interface Map__Entry { - K getKey(); - V getValue(); - } -} diff --git a/dotnet/Mammoth/Couscous/java/util/NoSuchElementException.cs b/dotnet/Mammoth/Couscous/java/util/NoSuchElementException.cs deleted file mode 100644 index 4a1ee9c..0000000 --- a/dotnet/Mammoth/Couscous/java/util/NoSuchElementException.cs +++ /dev/null @@ -1,6 +0,0 @@ -using Mammoth.Couscous.java.lang; - -namespace Mammoth.Couscous.java.util { - internal class NoSuchElementException : RuntimeException { - } -} diff --git a/dotnet/Mammoth/Couscous/java/util/Optional.cs b/dotnet/Mammoth/Couscous/java/util/Optional.cs deleted file mode 100644 index f295688..0000000 --- a/dotnet/Mammoth/Couscous/java/util/Optional.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System; -using Mammoth.Couscous.java.util.function; - -namespace Mammoth.Couscous.java.util -{ - internal interface Optional - { - bool isPresent(); - Optional map(Function function); - Optional flatMap(Function> function); - T orElse(T value); - T orElseGet(Supplier supplier); - T orElseThrow(Supplier exceptionSupplier) where TException : Exception; - T get(); - void ifPresent(Consumer consumer); - } - - internal class None : Optional { - public bool isPresent() { - return false; - } - - public Optional map(Function function) { - return new None(); - } - - public Optional flatMap(Function> function) { - return new None(); - } - - public T orElse(T value) { - return value; - } - - public T orElseGet(Supplier supplier) { - return supplier.get(); - } - - public T orElseThrow(Supplier exceptionSupplier) where TException : Exception { - throw exceptionSupplier.get(); - } - - public T get() { - throw new NoSuchElementException(); - } - - public void ifPresent(Consumer consumer) { - } - } - - internal class Some : Optional { - private readonly T _value; - - internal Some(T value) { - _value = value; - } - - public bool isPresent() { - return true; - } - - public Optional map(Function function) { - return new Some(function.apply(_value)); - } - - public Optional flatMap(Function> function) { - return function.apply(_value); - } - - public T orElse(T value) { - return _value; - } - - public T orElseGet(Supplier supplier) { - return _value; - } - - public T orElseThrow(Supplier exceptionSupplier) where TException : Exception { - return _value; - } - - public T get() { - return _value; - } - - public void ifPresent(Consumer consumer) { - consumer.accept(_value); - } - } - - internal static class Optional - { - internal static Optional empty() - { - return new None(); - } - - internal static Optional of(T value) - { - return new Some (value); - } - } -} diff --git a/dotnet/Mammoth/Couscous/java/util/Set.cs b/dotnet/Mammoth/Couscous/java/util/Set.cs deleted file mode 100644 index 34a23ac..0000000 --- a/dotnet/Mammoth/Couscous/java/util/Set.cs +++ /dev/null @@ -1,6 +0,0 @@ -using Mammoth.Couscous.java.lang; - -namespace Mammoth.Couscous.java.util { - internal interface Set : Collection { - } -} diff --git a/dotnet/Mammoth/Couscous/java/util/function/BiConsumer.cs b/dotnet/Mammoth/Couscous/java/util/function/BiConsumer.cs deleted file mode 100644 index 9479a78..0000000 --- a/dotnet/Mammoth/Couscous/java/util/function/BiConsumer.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace Mammoth.Couscous.java.util.function { - internal interface BiConsumer { - void accept(T1 first, T2 second); - } -} diff --git a/dotnet/Mammoth/Couscous/java/util/function/BiFunction.cs b/dotnet/Mammoth/Couscous/java/util/function/BiFunction.cs deleted file mode 100644 index 050f85f..0000000 --- a/dotnet/Mammoth/Couscous/java/util/function/BiFunction.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Mammoth.Couscous.java.util.function -{ - internal interface BiFunction { - U apply(T1 first, T2 second); - } -} \ No newline at end of file diff --git a/dotnet/Mammoth/Couscous/java/util/function/BiPredicate.cs b/dotnet/Mammoth/Couscous/java/util/function/BiPredicate.cs deleted file mode 100644 index 0419a6e..0000000 --- a/dotnet/Mammoth/Couscous/java/util/function/BiPredicate.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Mammoth.Couscous.java.util.function -{ - internal interface BiPredicate { - bool test(T first, U second); - } -} \ No newline at end of file diff --git a/dotnet/Mammoth/Couscous/java/util/function/Consumer.cs b/dotnet/Mammoth/Couscous/java/util/function/Consumer.cs deleted file mode 100644 index f80d426..0000000 --- a/dotnet/Mammoth/Couscous/java/util/function/Consumer.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace Mammoth.Couscous.java.util.function { - internal interface Consumer { - void accept(T value); - } -} \ No newline at end of file diff --git a/dotnet/Mammoth/Couscous/java/util/function/Function.cs b/dotnet/Mammoth/Couscous/java/util/function/Function.cs deleted file mode 100644 index 2b4d3ae..0000000 --- a/dotnet/Mammoth/Couscous/java/util/function/Function.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Mammoth.Couscous.java.util.function -{ - internal interface Function { - U apply(T arg); - } -} \ No newline at end of file diff --git a/dotnet/Mammoth/Couscous/java/util/function/Predicate.cs b/dotnet/Mammoth/Couscous/java/util/function/Predicate.cs deleted file mode 100644 index 2023309..0000000 --- a/dotnet/Mammoth/Couscous/java/util/function/Predicate.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace Mammoth.Couscous.java.util.function { - internal interface Predicate { - bool test(T value); - } -} \ No newline at end of file diff --git a/dotnet/Mammoth/Couscous/java/util/function/Supplier.cs b/dotnet/Mammoth/Couscous/java/util/function/Supplier.cs deleted file mode 100644 index eab3ffb..0000000 --- a/dotnet/Mammoth/Couscous/java/util/function/Supplier.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace Mammoth.Couscous.java.util.function { - internal interface Supplier { - T get(); - } -} \ No newline at end of file -- cgit v1.2.3