|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object blackboard.base.FilteringIterator
public class FilteringIterator
The FilteringIterator
class provides a means of applying a set
of "filters" to an iterator. This allows the records in an iterator to be
screened, removing items that do not fit the applied filtered criteria.
Constructor Summary | |
---|---|
FilteringIterator(java.util.Iterator iterator)
Creates a FilteringIterator using the supplied Iterator . |
|
FilteringIterator(java.util.Iterator iterator,
ListFilter filter)
Creates a FilteringIterator using the supplied Iterator and
applying the "filtering" specified by the given ListFilter . |
Method Summary | |
---|---|
void |
addFilter(ListFilter filter)
Adds the given ListFilter to the list of filters applied to this iterator. |
void |
filterByAvailability(boolean targetAvailability)
Applies the availability filter, AvailabilityFilter , to this
FilteringIterator . |
boolean |
hasNext()
Determines if any more elements that pass all applied filters exist in the iterator. |
java.lang.Object |
next()
Returns the next object in the iterator which passes all applied filters. |
java.lang.Object |
nextObject()
Deprecated. Use next() like a good Iterator should. |
void |
remove()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FilteringIterator(java.util.Iterator iterator)
FilteringIterator
using the supplied Iterator
.
iterator
- the Iterator
to base this filtering iterator uponpublic FilteringIterator(java.util.Iterator iterator, ListFilter filter)
FilteringIterator
using the supplied Iterator
and
applying the "filtering" specified by the given ListFilter
.
iterator
- The Iterator
to base this filtering iterator uponfilter
- The ListFilter
to apply to the given iteratorMethod Detail |
---|
public boolean hasNext()
hasNext
in interface java.util.Iterator
public java.lang.Object next()
hasNext()
method
should be used prior to calling this method.
next
in interface java.util.Iterator
public void remove()
remove
in interface java.util.Iterator
public void addFilter(ListFilter filter)
filter
- the ListFilter
to add to the list of filterspublic void filterByAvailability(boolean targetAvailability)
AvailabilityFilter
, to this
FilteringIterator
.
targetAvailability
- true if only "available" (availability flag is
true) should be returned, false if only "unavailable" object should
be returnedAvailabilityFilter
,
Available
public java.lang.Object nextObject()
hasNext()
method
should be used prior to calling this method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |