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

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P5 P5
    • None
    • 1.4.2
    • core-libs



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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: