Package com.ibm.icu.impl.coll
Class SharedObject.Reference<T extends SharedObject>
- java.lang.Object
-
- com.ibm.icu.impl.coll.SharedObject.Reference<T>
-
- 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.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
SharedObject.Reference<T>
clone()
T
copyOnWrite()
Returns a writable version of the reference.protected void
finalize()
T
readOnly()
-
-
-
Field Detail
-
ref
private T extends SharedObject ref
-
-
Constructor Detail
-
Reference
public Reference(T r)
-
-
Method Detail
-
clone
public SharedObject.Reference<T> clone()
- Overrides:
clone
in classjava.lang.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 java.lang.Throwable
- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
-
-