From aa98c3b15f31633e8c9c0d4030a0233d8450680a Mon Sep 17 00:00:00 2001 From: Willem Date: Mon, 24 Oct 2022 05:38:00 +0200 Subject: [PATCH] New collections naming --- .../bassboon/jpp/util/ArrayList2.java | 16 --------- .../bassboon/jpp/util/ArrayListᴿᵂ.java | 35 +++++++++++++++++++ 2 files changed, 35 insertions(+), 16 deletions(-) delete mode 100644 gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboon/jpp/util/ArrayList2.java create mode 100644 gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboon/jpp/util/ArrayListᴿᵂ.java diff --git a/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboon/jpp/util/ArrayList2.java b/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboon/jpp/util/ArrayList2.java deleted file mode 100644 index 869ce62b..00000000 --- a/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboon/jpp/util/ArrayList2.java +++ /dev/null @@ -1,16 +0,0 @@ -package love.distributedrebirth.bassboon.jpp.util; - -import java.util.ArrayList; - -public class ArrayList2 extends ArrayList implements Collectionᵂʳ { - - /** - * - */ - private static final long serialVersionUID = 1L; - - @Override - public Iteratorᴿᵈ iteratorᴿᵈ() { - return Iteratorᴿᵈ.wrap(iterator()); - } -} diff --git a/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboon/jpp/util/ArrayListᴿᵂ.java b/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboon/jpp/util/ArrayListᴿᵂ.java new file mode 100644 index 00000000..af22280c --- /dev/null +++ b/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboon/jpp/util/ArrayListᴿᵂ.java @@ -0,0 +1,35 @@ +package love.distributedrebirth.bassboon.jpp.util; + +import java.util.ArrayList; +import java.util.List; + +public class ArrayListᴿᵂ implements Collectionᵂʳ { + + private final List data; + + public ArrayListᴿᵂ() { + this(new ArrayList<>()); + } + + public ArrayListᴿᵂ(List data) { + if (data == null) { + throw new NullPointerException("Can't create list with null data"); + } + this.data = data; + } + + @Override + public Iteratorᴿᵈ iteratorᴿᵈ() { + return Iteratorᴿᵈ.wrap(data.iterator()); + } + + @Override + public boolean add(E value) { + return data.add(value); + } + + @Override + public boolean remove(Object o) { + return data.remove(o); + } +}