Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4268146

RFE: Create a bi-directional enumeration interface

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • 1.2.2
    • core-libs



      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)
      ======================================================================

            jjb Josh Bloch
            rlewis Roger Lewis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: