Class CopyOnWriteContent

  • All Implemented Interfaces:, java.lang.Cloneable

    public class CopyOnWriteContent
    implements java.lang.Cloneable
    A HashMap wrapper which can be cloned without copying the wrapped map. Copying of the map is deferred until there is a write access to the wrapped map. This may be frozen, at which point no further modifications are allowed. Note that until this is cloned, the internal map may be both read and written.
    • Constructor Summary

      Constructor Description
      Create a WRITABLE, empty instance
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      CopyOnWriteContent clone()  
      void freeze()  
      java.lang.Object get​(java.lang.String key)  
      void put​(java.lang.String key, java.lang.Object value)  
      void remove​(java.lang.String key)  
      java.util.Map<java.lang.String,​java.lang.Object> unmodifiableMap()  
      • Methods inherited from class

        ensureNotFrozen, isFrozen
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CopyOnWriteContent

        public CopyOnWriteContent()
        Create a WRITABLE, empty instance
    • Method Detail

      • freeze

        public void freeze()
        Specified by:
        freeze in interface
        freeze in class
      • clone

        public CopyOnWriteContent clone()
        clone in class
      • unmodifiableMap

        public java.util.Map<java.lang.String,​java.lang.Object> unmodifiableMap()
      • get

        public java.lang.Object get​(java.lang.String key)
      • put

        public void put​(java.lang.String key,
                        java.lang.Object value)
      • remove

        public void remove​(java.lang.String key)