uci.util
Class EnumerationPredicate
java.lang.Object
|
+--uci.util.EnumerationPredicate
- public class EnumerationPredicate
- extends Object
- implements Enumeration, Serializable
Step through the elements of some other enumeration, but skip over
any elements that do not satisfy the given predicate.
- See Also:
- Serialized Form
|
Field Summary |
protected Enumeration |
_enum
The normal enumeration that this EnumerationPredicate is moving
through. |
protected Predicate |
_filter
The predicate that must be satisfied in order for a given
element to be returned by nextElement(). |
protected Object |
_nextElement
The element that will be returned on the next call to
nextElement(). |
|
Method Summary |
protected void |
findNext()
Internal method to find the next element that satisfies the
predicate and store it in _nextElement. |
boolean |
hasMoreElements()
Reply true iff there are more elements in the given enumeration
that satisfy the given predicate. |
Object |
nextElement()
Reply the next element in the given enumeration that satisfies
the given predicate. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
_enum
protected Enumeration _enum
- The normal enumeration that this EnumerationPredicate is moving
through.
_filter
protected Predicate _filter
- The predicate that must be satisfied in order for a given
element to be returned by nextElement().
_nextElement
protected Object _nextElement
- The element that will be returned on the next call to
nextElement(). This element is "on deck".
EnumerationPredicate
public EnumerationPredicate(Enumeration e,
Predicate p)
hasMoreElements
public boolean hasMoreElements()
- Reply true iff there are more elements in the given enumeration
that satisfy the given predicate.
- Specified by:
- hasMoreElements in interface Enumeration
nextElement
public Object nextElement()
- Reply the next element in the given enumeration that satisfies
the given predicate.
- Specified by:
- nextElement in interface Enumeration
findNext
protected void findNext()
- Internal method to find the next element that satisfies the
predicate and store it in _nextElement.