-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
1.2.2
-
generic
-
generic
Name: rlT66838 Date: 09/02/99
The java.util.Enumeration interface shows good OO design because
it allows a uni-directional access for any data structure.
There should be a bi-directional interface, java.util.BiDirectionalEnumeration
which provides 'reverse' functionality for going backwards
(in the same way that a ListIterator provides reversal).
It would make sense for java.util.BiDirectionalEnumeration to extend
java.util.Enumeration with the methods:
hasLessElements()
previousElement()
Furthermore, it would make a good complement to the Iterator
methods, which (IHMO) should not be allowed to update a data
structure as well as iterating through it.
A sensible combination is described in the Work Around below.
(Review ID: 94774)
======================================================================