All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class guinea.util.EnumerationFilter

java.lang.Object
   |
   +----guinea.util.EnumerationFilter

public class EnumerationFilter
extends Object
implements Enumeration
EnumerationFilter filters an enumeration with a given filter.

The principle is more easily explained with an example in Scheme:

(filter (lambda (x) (>= x 0)) '(1 -2 3 -4 10 -99))
==> (1 3 10)


Constructor Index

· EnumerationFilter(Enumeration, FilterTest)
Construct a new filtered enumeration.

Method Index

· hasMoreElements()
Tests if this enumeration contains more elements.
· nextElement()
Returns the next element of this enumeration.

Constructors

· EnumerationFilter
 public EnumerationFilter(Enumeration enum,
                          FilterTest test)
Construct a new filtered enumeration. It takes an enumeration and returns a new enumeration that includes only the elements that pass the test.

Parameters:
enum - an enumeration to filter.
test - the test that decides whether to include an object to the new enumeration.

Methods

· hasMoreElements
 public synchronized boolean hasMoreElements()
Tests if this enumeration contains more elements.

Returns:
true if this enumeration contains more elements; false otherwise.
· nextElement
 public synchronized Object nextElement()
Returns the next element of this enumeration.

Returns:
the next element of this enumeration.
Throws: NoSuchElementException
if no more elements exist.

All Packages  Class Hierarchy  This Package  Previous  Next  Index