Package org.eclipse.handly.util
Interface IReferenceCountable
- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
IBuffer
,ISnapshotProvider
- All Known Implementing Classes:
Buffer
,ChildBuffer
,TextEditorBuffer
,TextFileBuffer
A common protocol for reference countable objects. A reference countable
object may be shared by multiple clients and will be disposed only after
it is released by every owner. Clients which do not own the object must not
access it; attempting that will result in unspecified behavior.
-
Method Summary
-
Method Details
-
addRef
void addRef()Spawns a new independent ownership of this object. Each successful call toaddRef()
must ultimately be followed by exactly one call torelease()
. -
release
void release()Relinquishes an independent ownership of this object. Each independent ownership of the object must ultimately end with exactly one call to this method.- See Also:
-
close
default void close()Alias forrelease()
.- Specified by:
close
in interfaceAutoCloseable
-