Suggestion for client data for entries in List class

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 1.0
    • Component/s: client-libs
    • sparc
    • generic

      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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: