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

Suggestion for client data for entries in List class

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 1.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      generic

      Description

      I know the interfaces are supposed to be frozen, but ...

      It would be good if arbitrary objects could be associated with the
      entries in a List class.

      In the old days, this would be done by having client data entries
      associated with each list entry, and all the reasons that clientData
      has been provided in the past are appropriate justification for the
      suggestion enhancement here.

      In these more enlightened OO days, an interesting and easy to implement
      alternative to client data would be to store java.lang.Objects on the
      List, and judicially use toString() at the necessary times when a
      String is actually required. This would require a simple and upward
      compatible change for the addEntry replaceEntry methods. For backward
      compatability, getItem could still return a String, but there could be
      a new method to get the item as a raw Object.

      Such an approach fits in easily with the current implementation, which
      already uses a Vector (of java.lang.Objects) to store the String
      objects.

      -- Jon

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              msomlosunw Mike Somlo (Inactive)
              Reporter:
              jjg Jonathan Gibbons
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: