Package de.marhali.json5.internal
Class NonNullElementWrapperList<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- de.marhali.json5.internal.NonNullElementWrapperList<E>
-
- All Implemented Interfaces:
java.lang.Iterable<E>,java.util.Collection<E>,java.util.List<E>,java.util.RandomAccess
public class NonNullElementWrapperList<E> extends java.util.AbstractList<E> implements java.util.RandomAccessListwhich wraps anotherListbut prevents insertion ofnullelements. Methods which only perform checks with the element argument (e.g.contains(Object)) do not throw exceptions fornullarguments.
-
-
Constructor Summary
Constructors Constructor Description NonNullElementWrapperList(java.util.ArrayList<E> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, E element)voidclear()booleancontains(java.lang.Object o)booleanequals(java.lang.Object o)Eget(int index)inthashCode()intindexOf(java.lang.Object o)intlastIndexOf(java.lang.Object o)Eremove(int index)booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)Eset(int index, E element)intsize()java.lang.Object[]toArray()<T> T[]toArray(T[] a)-
Methods inherited from class java.util.AbstractList
add, addAll, iterator, listIterator, listIterator, removeRange, subList
-
-
-
-
Constructor Detail
-
NonNullElementWrapperList
public NonNullElementWrapperList(java.util.ArrayList<E> delegate)
-
-
Method Detail
-
get
public E get(int index)
-
size
public int size()
-
add
public void add(int index, E element)
-
remove
public E remove(int index)
-
clear
public void clear()
-
remove
public boolean remove(java.lang.Object o)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
contains
public boolean contains(java.lang.Object o)
-
indexOf
public int indexOf(java.lang.Object o)
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
equals
public boolean equals(java.lang.Object o)
-
-