Class SharedObject.Reference<T extends SharedObject>

  • All Implemented Interfaces:
    java.lang.Cloneable
    Enclosing class:
    SharedObject

    public static final class SharedObject.Reference<T extends SharedObject>
    extends java.lang.Object
    implements java.lang.Cloneable
    Similar to a smart pointer, basically a port of the static methods of C++ SharedObject.
    • Constructor Detail

      • Reference

        public Reference​(T r)
    • Method Detail

      • readOnly

        public T readOnly()
      • copyOnWrite

        public T copyOnWrite()
        Returns a writable version of the reference. If there is exactly one owner, then the reference itself is returned. If there are multiple owners, then the reference is replaced with a clone, and that is returned.
      • clear

        public void clear()
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable