Class Retainable.Wrapper
- All Implemented Interfaces:
 Retainable
- Direct Known Subclasses:
 RetainableByteBuffer.Abstract, RetainableByteBuffer.Wrapper
- Enclosing interface:
 Retainable
Retainable instances.- 
Nested Class Summary
Nested classes/interfaces inherited from interface Retainable
Retainable.ReferenceCounter, Retainable.Wrapper - 
Field Summary
Fields inherited from interface Retainable
NON_RETAINABLE - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether this resource is referenced counted by calls toRetainable.retain()andRetainable.release().intGet the retained count.booleanReturns whetherRetainable.retain()has been called at least one more time thanRetainable.release().booleanrelease()Releases this resource, potentially decrementing a reference count (if any).voidretain()Retains this resource, potentially incrementing a reference count if there are resources that will be released.toString() 
- 
Constructor Details
- 
Wrapper
 
 - 
 - 
Method Details
- 
getWrapped
 - 
canRetain
public boolean canRetain()Description copied from interface:RetainableReturns whether this resource is referenced counted by calls to
Retainable.retain()andRetainable.release().Implementations may decide that special resources are not not referenced counted (for example,
staticconstants) so callingRetainable.retain()is a no-operation, and callingRetainable.release()on those special resources is a no-operation that always returns true.- Specified by:
 canRetainin interfaceRetainable- Returns:
 - true if calls to 
Retainable.retain()are reference counted. 
 - 
getRetained
public int getRetained()Description copied from interface:RetainableGet the retained count. This value is volatile and should only be used for informational/debugging purposes.
- Specified by:
 getRetainedin interfaceRetainable- Returns:
 - the retained count
 
 - 
isRetained
public boolean isRetained()Description copied from interface:RetainableReturns whether
Retainable.retain()has been called at least one more time thanRetainable.release().- Specified by:
 isRetainedin interfaceRetainable- Returns:
 - whether this buffer is retained
 
 - 
retain
public void retain()Description copied from interface:RetainableRetains this resource, potentially incrementing a reference count if there are resources that will be released.
- Specified by:
 retainin interfaceRetainable
 - 
release
public boolean release()Description copied from interface:RetainableReleases this resource, potentially decrementing a reference count (if any).
- Specified by:
 releasein interfaceRetainable- Returns:
 truewhen the reference count goes to zero or if there was no reference count,falseotherwise.
 - 
toString
 
 -