|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection
org.eclipse.emf.validation.util.FilteredCollection
Wrapper for a Java 2 Collection
that provides a filtered view of its
contents according to a client-specified filter algorithm.
Nested Class Summary | |
---|---|
static interface |
FilteredCollection.Filter
Interface for the algorithm that determines which elements are in and which are out of the filtered collection. |
Constructor Summary | |
---|---|
FilteredCollection(java.util.Collection collection,
FilteredCollection.Filter filter)
Initializes me to filter the specified collection, obtained independently. |
Method Summary | |
---|---|
FilteredCollection.Filter |
getFilter()
Retrieves the filter with which I was initialized. |
java.util.Iterator |
iterator()
Obtains an iterator that dynamically filters out unwanted items using my filter algorithm. |
int |
size()
Computes the size of the filtered view, i.e. |
Methods inherited from class java.util.AbstractCollection |
---|
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Collection |
---|
equals, hashCode |
Constructor Detail |
public FilteredCollection(java.util.Collection collection, FilteredCollection.Filter filter)
Initializes me to filter the specified collection, obtained independently.
Note that it is a very bad idea to modify the
wrapped collection
after creating this filtered view on it.
The results are undefined, but probably not what you want.
collection
- the collection that I am to filterfilter
- the filter algorithm to applyMethod Detail |
public final FilteredCollection.Filter getFilter()
public java.util.Iterator iterator()
filter
algorithm.
public int size()
Computes the size of the filtered view, i.e. the number of elements
in the original collection that match my filter
, by
iterating myself.
Note that my size is recounted every time that it is requested, in case my filter's algorithm is changed or the contents of the underlying collection are changed.
|
Copyright 2002, 2006 IBM Corporation and others. All Rights Reserved. |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |