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>
public abstract class ListView<SOURCE,VIEW> extends AbstractList<VIEW>
Provides a view of type Listfor a List - Author:
- Jozef Hartinger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
ListView.ListViewIterator
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description ListView()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
add(int index, VIEW element)
boolean
add(VIEW element)
void
clear()
protected abstract SOURCE
createSource(VIEW view)
Creates a new source object based on a given view.VIEW
get(int index)
protected abstract List<SOURCE>
getDelegate()
Iterator<VIEW>
iterator()
ListIterator<VIEW>
listIterator()
ListIterator<VIEW>
listIterator(int index)
VIEW
remove(int index)
VIEW
set(int index, VIEW element)
int
size()
protected abstract VIEW
toView(SOURCE source)
Provides a view representation of a source object.-
Methods inherited from class java.util.AbstractList
addAll, equals, hashCode, indexOf, lastIndexOf, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
-
-
-
Method Detail
-
get
public VIEW get(int index)
-
size
public int size()
- Specified by:
size
in interfaceCollection<SOURCE>
- Specified by:
size
in interfaceList<SOURCE>
- Specified by:
size
in classAbstractCollection<VIEW>
-
add
public boolean add(VIEW element)
- Specified by:
add
in interfaceCollection<SOURCE>
- Specified by:
add
in interfaceList<SOURCE>
- Overrides:
add
in classAbstractList<VIEW>
-
add
public void add(int index, VIEW element)
-
remove
public VIEW remove(int index)
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection<SOURCE>
- Specified by:
clear
in interfaceList<SOURCE>
- Overrides:
clear
in classAbstractList<VIEW>
-
listIterator
public ListIterator<VIEW> listIterator()
- Specified by:
listIterator
in interfaceList<SOURCE>
- Overrides:
listIterator
in classAbstractList<VIEW>
-
listIterator
public ListIterator<VIEW> listIterator(int index)
- Specified by:
listIterator
in interfaceList<SOURCE>
- Overrides:
listIterator
in classAbstractList<VIEW>
-
toView
protected abstract VIEW toView(SOURCE source)
Provides a view representation of a source object.- Parameters:
source
-- Returns:
- a view representation
-
-