Class SharedObject.Reference<T extends SharedObject>

java.lang.Object
com.ibm.icu.impl.coll.SharedObject.Reference<T>
All Implemented Interfaces:
Cloneable
Enclosing class:
SharedObject

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

  • Constructor Details

    • Reference

      public Reference(T r)
  • Method Details

    • clone

      public SharedObject.Reference<T> clone()
      Overrides:
      clone in class Object
    • 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 Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable