Class ReadOnlyDictionary

  • All Implemented Interfaces:
    java.lang.Comparable<ReadOnlyDictionary>, java.util.Map<java.lang.String,​java.lang.Object>

    public class ReadOnlyDictionary
    extends java.util.Dictionary<java.lang.String,​java.lang.Object>
    implements java.util.Map<java.lang.String,​java.lang.Object>, java.lang.Comparable<ReadOnlyDictionary>
    The ReadOnlyDictionary is both a Dictionary and a Map whose modification methods (like Dictionary.put(Object, Object), remove(Object), etc.) throw an UnsupportedOperationException.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Hashtable<java.lang.String,​java.lang.Object> m_delegate  
      private org.osgi.framework.ServiceReference<?> m_serviceReference  
    • Constructor Summary

      Constructors 
      Constructor Description
      ReadOnlyDictionary​(java.util.Map<java.lang.String,​java.lang.Object> delegate)
      Creates a wrapper for the given delegate dictionary providing read only access to the data.
      ReadOnlyDictionary​(org.osgi.framework.ServiceReference<?> serviceReference)
      Creates a wrapper for the given service reference providing read only access to the reference properties.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      int compareTo​(ReadOnlyDictionary o)  
      boolean containsKey​(java.lang.Object key)  
      boolean containsValue​(java.lang.Object value)  
      java.util.Enumeration<java.lang.Object> elements()  
      java.util.Set<java.util.Map.Entry<java.lang.String,​java.lang.Object>> entrySet()  
      java.lang.Object get​(java.lang.Object key)  
      boolean isEmpty()  
      java.util.Enumeration<java.lang.String> keys()  
      java.util.Set<java.lang.String> keySet()  
      java.lang.Object put​(java.lang.String key, java.lang.Object value)
      This method has no effect and always returns null as this instance is read-only and cannot modify and properties.
      void putAll​(java.util.Map<? extends java.lang.String,​? extends java.lang.Object> m)  
      java.lang.Object remove​(java.lang.Object key)
      This method has no effect and always returns null as this instance is read-only and cannot modify and properties.
      int size()  
      java.lang.String toString()  
      java.util.Collection<java.lang.Object> values()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
    • Field Detail

      • m_delegate

        private final java.util.Hashtable<java.lang.String,​java.lang.Object> m_delegate
      • m_serviceReference

        private final org.osgi.framework.ServiceReference<?> m_serviceReference
    • Constructor Detail

      • ReadOnlyDictionary

        public ReadOnlyDictionary​(java.util.Map<java.lang.String,​java.lang.Object> delegate)
        Creates a wrapper for the given delegate dictionary providing read only access to the data.
      • ReadOnlyDictionary

        public ReadOnlyDictionary​(org.osgi.framework.ServiceReference<?> serviceReference)
        Creates a wrapper for the given service reference providing read only access to the reference properties.
    • Method Detail

      • elements

        public java.util.Enumeration<java.lang.Object> elements()
        Specified by:
        elements in class java.util.Dictionary<java.lang.String,​java.lang.Object>
      • get

        public java.lang.Object get​(java.lang.Object key)
        Specified by:
        get in interface java.util.Map<java.lang.String,​java.lang.Object>
        Specified by:
        get in class java.util.Dictionary<java.lang.String,​java.lang.Object>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Map<java.lang.String,​java.lang.Object>
        Specified by:
        isEmpty in class java.util.Dictionary<java.lang.String,​java.lang.Object>
      • keys

        public java.util.Enumeration<java.lang.String> keys()
        Specified by:
        keys in class java.util.Dictionary<java.lang.String,​java.lang.Object>
      • put

        public java.lang.Object put​(java.lang.String key,
                                    java.lang.Object value)
        This method has no effect and always returns null as this instance is read-only and cannot modify and properties.
        Specified by:
        put in interface java.util.Map<java.lang.String,​java.lang.Object>
        Specified by:
        put in class java.util.Dictionary<java.lang.String,​java.lang.Object>
      • remove

        public java.lang.Object remove​(java.lang.Object key)
        This method has no effect and always returns null as this instance is read-only and cannot modify and properties.
        Specified by:
        remove in interface java.util.Map<java.lang.String,​java.lang.Object>
        Specified by:
        remove in class java.util.Dictionary<java.lang.String,​java.lang.Object>
      • size

        public int size()
        Specified by:
        size in interface java.util.Map<java.lang.String,​java.lang.Object>
        Specified by:
        size in class java.util.Dictionary<java.lang.String,​java.lang.Object>
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Map<java.lang.String,​java.lang.Object>
      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Specified by:
        containsKey in interface java.util.Map<java.lang.String,​java.lang.Object>
      • containsValue

        public boolean containsValue​(java.lang.Object value)
        Specified by:
        containsValue in interface java.util.Map<java.lang.String,​java.lang.Object>
      • entrySet

        public java.util.Set<java.util.Map.Entry<java.lang.String,​java.lang.Object>> entrySet()
        Specified by:
        entrySet in interface java.util.Map<java.lang.String,​java.lang.Object>
      • keySet

        public java.util.Set<java.lang.String> keySet()
        Specified by:
        keySet in interface java.util.Map<java.lang.String,​java.lang.Object>
      • putAll

        public void putAll​(java.util.Map<? extends java.lang.String,​? extends java.lang.Object> m)
        Specified by:
        putAll in interface java.util.Map<java.lang.String,​java.lang.Object>
      • values

        public java.util.Collection<java.lang.Object> values()
        Specified by:
        values in interface java.util.Map<java.lang.String,​java.lang.Object>