Package ai.libs.jaicore.basic.sets
Class ListDecorator<L extends java.util.List<E>,E,D extends ElementDecorator<E>>
- java.lang.Object
-
- ai.libs.jaicore.basic.sets.ListDecorator<L,E,D>
-
- Type Parameters:
L-E-
- All Implemented Interfaces:
java.lang.Iterable<D>,java.util.Collection<D>,java.util.List<D>,org.api4.java.common.attributedobjects.IListDecorator<L,E,D>
public class ListDecorator<L extends java.util.List<E>,E,D extends ElementDecorator<E>> extends java.lang.Object implements org.api4.java.common.attributedobjects.IListDecorator<L,E,D>, java.util.List<D>This class solves the following problem: Sometimes you want to use objects of a concrete List class L to be used in a context where some extension of the List interface L' is used, which is not implemented by L. To use objects of type L in such a context, it is a bad idea to cast and copy the items of L into an object of type L' but instead a decorator implementing L' should be used that forwards all operations to the original instance. The ListDecorator must be told how to create elements of the decorated list in order to insert
-
-
Constructor Summary
Constructors Constructor Description ListDecorator(L list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.reflect.Constructor<D>getConstructorForDecoratingItems()LgetList()java.lang.Class<E>getTypeOfDecoratedItems()java.lang.Class<D>getTypeOfDecoratingItems()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.api4.java.common.attributedobjects.IListDecorator
add, add, addAll, addAll, clear, contains, containsAll, get, getDecorationForElement, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
-
-
-
-
Constructor Detail
-
ListDecorator
public ListDecorator(L list)
-
-