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

(coll) A SimpleMap interface, which java.util.Map should implement

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P5
    • Resolution: Not an Issue
    • Affects Version/s: 1.4.2
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description



      Name: jl125535 Date: 07/27/2004


      A DESCRIPTION OF THE REQUEST :
      I want a new interface, SimpleMap, and that java.util.Map
      is retrofitted to implement this new interface. I think SimpleMap should
      only contain two methods: get and containsKey.


      JUSTIFICATION :
      In some cases I feel the need for a simple standardized read-only
      interface for a map, and java.util.Map is really too complex
      (even if you exclude the "optional" methods).


      CUSTOMER SUBMITTED WORKAROUND :
      * Implement the existing java.utl.Map interface and leave most methods inimplemented, throwing java.lang.UnsupportedOperationException. However, doing so for methods not marked as "optional" violates the contract for the java.util.Map interface.

      * Create your own SimpleMap interface. However, this causes more work with wrapper classes since you cannot use an java.util.Map as a SimpleMap.
      (Incident Review ID: 229714)
      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              martin Martin Buchholz
              Reporter:
              jleesunw Jon Lee (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: