Package org.jboss.weld.util.collections
Class ListView<SOURCE,VIEW>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<VIEW>
org.jboss.weld.util.collections.ListView<SOURCE,VIEW>
- Type Parameters:
SOURCE- the source typeVIEW- the view type
- All Implemented Interfaces:
Iterable<VIEW>,Collection<VIEW>,List<VIEW>
Provides a view of type List for a List. Changes to the view list are reflected within the source list and vice
versa.
- Author:
- Jozef Hartinger
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanvoidclear()protected abstract SOURCEcreateSource(VIEW view) Creates a new source object based on a given view.get(int index) iterator()listIterator(int index) remove(int index) intsize()protected abstract VIEWProvides a view representation of a source object.Methods inherited from class java.util.AbstractList
addAll, equals, hashCode, indexOf, lastIndexOf, removeRange, subListMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Constructor Details
-
ListView
public ListView()
-
-
Method Details
-
getDelegate
-
get
-
size
public int size()- Specified by:
sizein interfaceCollection<SOURCE>- Specified by:
sizein interfaceList<SOURCE>- Specified by:
sizein classAbstractCollection<VIEW>
-
add
- Specified by:
addin interfaceCollection<SOURCE>- Specified by:
addin interfaceList<SOURCE>- Overrides:
addin classAbstractList<VIEW>
-
set
-
add
-
remove
-
clear
public void clear()- Specified by:
clearin interfaceCollection<SOURCE>- Specified by:
clearin interfaceList<SOURCE>- Overrides:
clearin classAbstractList<VIEW>
-
iterator
-
listIterator
- Specified by:
listIteratorin interfaceList<SOURCE>- Overrides:
listIteratorin classAbstractList<VIEW>
-
listIterator
- Specified by:
listIteratorin interfaceList<SOURCE>- Overrides:
listIteratorin classAbstractList<VIEW>
-
toView
Provides a view representation of a source object.- Parameters:
source-- Returns:
- a view representation
-
createSource
Creates a new source object based on a given view.- Parameters:
view-- Returns:
- a new source object
-