public class PaddedList<E> extends AbstractList<E> implements Serializable
size() returns the true size, but
get() works for any number.modCount| Constructor and Description |
|---|
PaddedList(List<E> l)
With this constructor, get() will return
null for
elements outside the real list. |
PaddedList(List<E> l,
E padding) |
| Modifier and Type | Method and Description |
|---|---|
E |
get(int i) |
E |
getPad() |
List<E> |
getWrappedList()
Deprecated.
|
boolean |
sameInnerList(PaddedList<E> p)
Returns true if this PaddedList and another are wrapping the
same list.
|
int |
size() |
String |
toString() |
static <IN> PaddedList<IN> |
valueOf(List<IN> list,
IN padding)
A static method that provides an easy way to create a list of a
certain parametric type.
|
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArrayparallelStream, removeIf, streampublic PaddedList(List<E> l)
null for
elements outside the real list.public E getPad()
public int size()
size in interface Collection<E>size in interface List<E>size in class AbstractCollection<E>public E get(int i)
public String toString()
toString in class AbstractCollection<E>@Deprecated public List<E> getWrappedList()
public static <IN> PaddedList<IN> valueOf(List<IN> list, IN padding)
list - The list to padpadding - The padding element (may be null)public boolean sameInnerList(PaddedList<E> p)