public class PaddedList<E>
extends java.util.AbstractList<E>
implements java.io.Serializable
size()
returns the true size, but
get()
works for any number.Constructor and Description |
---|
PaddedList(java.util.List<E> l)
With this constructor, get() will return
null for
elements outside the real list. |
PaddedList(java.util.List<E> l,
E padding) |
Modifier and Type | Method and Description |
---|---|
E |
get(int i) |
E |
getPad() |
java.util.List<E> |
getWrappedList()
Deprecated.
|
boolean |
sameInnerList(PaddedList<E> p)
Returns true if this PaddedList and another are wrapping the
same list.
|
int |
size() |
java.lang.String |
toString() |
static <IN> PaddedList<IN> |
valueOf(java.util.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, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public PaddedList(java.util.List<E> l)
null
for
elements outside the real list.public E getPad()
public int size()
public E get(int i)
public java.lang.String toString()
toString
in class java.util.AbstractCollection<E>
@Deprecated public java.util.List<E> getWrappedList()
public static <IN> PaddedList<IN> valueOf(java.util.List<IN> list, IN padding)
list
- The list to padpadding
- The padding element (may be null)public boolean sameInnerList(PaddedList<E> p)