Class FreezableClass

  • All Implemented Interfaces:
    Freezable
    Direct Known Subclasses:
    ListenableFreezableClass

    public class FreezableClass
    extends java.lang.Object
    implements Freezable
    Convenience superclass of non-component freezables
    Author:
    bratseth
    • Constructor Summary

      Constructors 
      Constructor Description
      FreezableClass()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      FreezableClass clone()
      Clones this.
      protected void ensureNotFrozen()
      Throws an IllegalStateException if this is frozen
      void freeze()
      Freezes this class to prevent further changes.
      boolean isFrozen()
      Returns whether this is currently frozen
      • Methods inherited from class java.lang.Object

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

      • FreezableClass

        public FreezableClass()
    • Method Detail

      • freeze

        public void freeze()
        Freezes this class to prevent further changes. Override this to freeze internal data structures and dependent objects. Overrides must call super. Calling freeze on an already frozen registry must have no effect.
        Specified by:
        freeze in interface Freezable
      • isFrozen

        public final boolean isFrozen()
        Returns whether this is currently frozen
        Specified by:
        isFrozen in interface Freezable
        Returns:
        true if this instance is in an immutable state, false otherwise
      • ensureNotFrozen

        protected void ensureNotFrozen()
        Throws an IllegalStateException if this is frozen
      • clone

        public FreezableClass clone()
        Clones this. The clone is not frozen
        Overrides:
        clone in class java.lang.Object