New collections naming

This commit is contained in:
Willem Cazander 2022-10-24 05:38:00 +02:00
parent c9ccadca44
commit aa98c3b15f
2 changed files with 35 additions and 16 deletions

View file

@ -1,16 +0,0 @@
package love.distributedrebirth.bassboon.jpp.util;
import java.util.ArrayList;
public class ArrayList2<E> extends ArrayList<E> implements Collectionᵂʳ<E> {
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public Iteratorᴿᵈ<E> iteratorᴿᵈ() {
return Iteratorᴿᵈ.wrap(iterator());
}
}

View file

@ -0,0 +1,35 @@
package love.distributedrebirth.bassboon.jpp.util;
import java.util.ArrayList;
import java.util.List;
public class ArrayListᴿᵂ<E> implements Collectionᵂʳ<E> {
private final List<E> data;
public ArrayListᴿᵂ() {
this(new ArrayList<>());
}
public ArrayListᴿᵂ(List<E> data) {
if (data == null) {
throw new NullPointerException("Can't create list with null data");
}
this.data = data;
}
@Override
public Iteratorᴿᵈ<E> 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);
}
}