net.sf.molae.pipe.basic
Class CollectionAsList
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractList
|
+--net.sf.molae.pipe.basic.CollectionAsList
- All Implemented Interfaces:
- Collection, List
- Direct Known Subclasses:
- TransformedList
- public abstract class CollectionAsList
- extends AbstractList
Delegates all collection calls to another collection.
Useful base class for list wrappers.
Note that this class differs from other upgrading wrappers in
three respects:
- It is abstract.
- It does not inherit from
CollectionProxy but from a
skeleton implementation.
- It has a brother class
CollectionAsSequentialList.
| Methods inherited from class java.util.AbstractList |
add, addAll, equals, get, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList |
CollectionAsList
public CollectionAsList(Collection base)
- Constructs a new CollectionAsList object.
- Parameters:
base - the underlying object.- Throws:
NullPointerException - if the specified object is
null.
getBase
protected Object getBase()
- Returns the base collection of the list.
- Returns:
- the base collection of the list.
toString
public String toString()
- Overrides:
toString in class AbstractCollection
size
public int size()
- Overrides:
size in class AbstractCollection
isEmpty
public boolean isEmpty()
- Overrides:
isEmpty in class AbstractCollection
contains
public boolean contains(Object o)
- Overrides:
contains in class AbstractCollection
iterator
public Iterator iterator()
- Overrides:
iterator in class AbstractList
toArray
public Object[] toArray()
- Overrides:
toArray in class AbstractCollection
toArray
public Object[] toArray(Object[] a)
- Overrides:
toArray in class AbstractCollection
add
public boolean add(Object o)
- Overrides:
add in class AbstractList
remove
public boolean remove(Object o)
- Overrides:
remove in class AbstractCollection
containsAll
public boolean containsAll(Collection c)
- Overrides:
containsAll in class AbstractCollection
addAll
public boolean addAll(Collection c)
- Overrides:
addAll in class AbstractCollection
retainAll
public boolean retainAll(Collection c)
- Overrides:
retainAll in class AbstractCollection
removeAll
public boolean removeAll(Collection c)
- Overrides:
removeAll in class AbstractCollection
clear
public void clear()
- Overrides:
clear in class AbstractList