T
- Type of items to project toTSource
- Type of source items which need to be projectedpublic final class ProjectionCollection<T,TSource> extends ObservableCollection<T> implements ICollectionObserver<TSource>
Constructor and Description |
---|
ProjectionCollection(Func1<TSource,T> projectionFunc)
Creates a new
ProjectionCollection instance with specified projection function |
ProjectionCollection(ObservableCollection<TSource> sourceCollection,
Func1<TSource,T> projectionFunc)
Creates a new
ProjectionCollection instance with specified projection function |
Modifier and Type | Method and Description |
---|---|
void |
add(int location,
T object) |
boolean |
add(T object) |
boolean |
addAll(java.util.Collection<? extends T> collection) |
boolean |
addAll(int location,
java.util.Collection<? extends T> collection) |
void |
clear() |
ObservableCollection<TSource> |
getSourceCollection()
Gets the source collection to project from
|
void |
onCollectionChanged(ObservableCollection<TSource> collection,
CollectionChangedEventArgs<TSource> args)
Called when
ObservableCollection changes. |
T |
remove(int location) |
boolean |
remove(java.lang.Object object) |
boolean |
removeAll(java.util.Collection<?> collection) |
protected void |
removeRange(int fromIndex,
int toIndex) |
boolean |
retainAll(java.util.Collection<?> collection) |
T |
set(int location,
T object) |
void |
setSourceCollection(ObservableCollection<TSource> sourceCollection)
Sets the source collection to project from
|
addObserver, removeObserver
clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeIf, replaceAll, size, sort, spliterator, subList, toArray, toArray, trimToSize
public ProjectionCollection(Func1<TSource,T> projectionFunc)
ProjectionCollection
instance with specified projection functionprojectionFunc
- The function which transforms item from source collection to target itempublic ProjectionCollection(ObservableCollection<TSource> sourceCollection, Func1<TSource,T> projectionFunc)
ProjectionCollection
instance with specified projection functionsourceCollection
- The source collection to project fromprojectionFunc
- The function which transforms item from source collection to target itempublic final void setSourceCollection(ObservableCollection<TSource> sourceCollection)
sourceCollection
- The new source collectionpublic final ObservableCollection<TSource> getSourceCollection()
public void add(int location, T object)
add
in interface java.util.List<T>
add
in class ObservableCollection<T>
public boolean add(T object)
add
in interface java.util.Collection<T>
add
in interface java.util.List<T>
add
in class ObservableCollection<T>
public boolean addAll(int location, @NonNull java.util.Collection<? extends T> collection)
addAll
in interface java.util.List<T>
addAll
in class ObservableCollection<T>
public boolean addAll(@NonNull java.util.Collection<? extends T> collection)
addAll
in interface java.util.Collection<T>
addAll
in interface java.util.List<T>
addAll
in class ObservableCollection<T>
public void clear()
clear
in interface java.util.Collection<T>
clear
in interface java.util.List<T>
clear
in class ObservableCollection<T>
public T remove(int location)
remove
in interface java.util.List<T>
remove
in class ObservableCollection<T>
public boolean remove(java.lang.Object object)
remove
in interface java.util.Collection<T>
remove
in interface java.util.List<T>
remove
in class ObservableCollection<T>
public boolean removeAll(@NonNull java.util.Collection<?> collection)
removeAll
in interface java.util.Collection<T>
removeAll
in interface java.util.List<T>
removeAll
in class ObservableCollection<T>
public boolean retainAll(@NonNull java.util.Collection<?> collection)
retainAll
in interface java.util.Collection<T>
retainAll
in interface java.util.List<T>
retainAll
in class ObservableCollection<T>
protected void removeRange(int fromIndex, int toIndex)
removeRange
in class ObservableCollection<T>
public T set(int location, T object)
set
in interface java.util.List<T>
set
in class ObservableCollection<T>
public void onCollectionChanged(ObservableCollection<TSource> collection, CollectionChangedEventArgs<TSource> args) throws java.lang.Exception
ObservableCollection
changes.onCollectionChanged
in interface ICollectionObserver<TSource>
collection
- The collection which changed.args
- The CollectionChangedEventArgs
instance with changes in collection.java.lang.Exception
- The thrown Exception
instance.