public abstract class NSFBase extends Object
Modifier and Type | Method and Description |
---|---|
protected void |
_checkRefValidity() |
<T extends NSFBase> |
addChild(T child)
Adds an
NSFBase object as a "child" of the current object, to be
freed when this object is freed. |
protected <T extends BaseStruct> |
addChildStruct(T child) |
void |
debugPrintChildHierarchy()
Prints the child hierarchy of this object to System.out.
|
protected abstract void |
doFree()
This method is called when the final reference to this object is freed.
|
protected void |
finalize() |
void |
free() |
void |
free(boolean force) |
void |
free(boolean force,
boolean removeFromParent) |
DominoAPI |
getAPI() |
long |
getChildObjectCount() |
long |
getChildObjectCount(Class<?> clazz) |
long |
getChildStructCount() |
protected abstract NSFBase |
getParent() |
boolean |
isFreed() |
abstract boolean |
isRefValid()
Checks whether the object's inner reference is valid.
|
static boolean |
isTraceCreation() |
<T extends NSFBase> |
removeChild(T child)
Removed an
NSFBase object as a "child" of the current object, to be
no longer freed when this object is freed. |
protected <T extends BaseStruct> |
removeChildStruct(T child) |
protected void |
removeFromParent() |
void |
retain()
Increments the internal reference count.
|
protected void |
setNeedsFree(boolean needsFree)
Callable by child instances to indicate whether or not they need C-level memory freeing
(for example, variants of memory structures that do not need handles they normally
would).
|
static void |
setTraceCreation(boolean traceCreation)
Configures whether the stack trace at creation should be stored inside each struct, for memory-
debugging needs.
|
String |
toString() |
protected final DominoAPI api
public NSFBase(DominoAPI api)
public static void setTraceCreation(boolean traceCreation)
traceCreation
- the mode to setpublic static boolean isTraceCreation()
public final void retain()
public final void free()
public final void free(boolean force)
public final void free(boolean force, boolean removeFromParent)
force
- whether the object should be freed regardless of how many retain references remain.
Defaults to false.removeFromParent
- whether the object should be removed from its parent's list of children if freed.
Defaults to true.public boolean isFreed()
public DominoAPI getAPI()
public <T extends NSFBase> T addChild(T child)
NSFBase
object as a "child" of the current object, to be
freed when this object is freed.
Note: this is intended for internal use primarily and should only be used very rarely externally.
child
- the NSFBase
object to add to the child listpublic <T extends NSFBase> T removeChild(T child)
NSFBase
object as a "child" of the current object, to be
no longer freed when this object is freed.
Note: this is intended for internal use primarily and should only be used very rarely externally.
child
- the NSFBase
object to remove from the child listprotected <T extends BaseStruct> T addChildStruct(T child)
protected <T extends BaseStruct> T removeChildStruct(T child)
public long getChildObjectCount()
NSFBase
objects of this object, recursivelypublic long getChildObjectCount(Class<?> clazz)
NSFBase
objects of this object that are instances
of the provided class or its subclasses, recursivelypublic long getChildStructCount()
NSFBase
objects, recursivelypublic void debugPrintChildHierarchy()
Example:
NSFDatabase NSFNote NSFItem NSFItem NSFView
protected void finalize() throws Throwable
protected abstract void doFree()
Implemented classes are expected to release any memory or network resources they have open. They are also expected to write this defensively, allowing the method to be called multiple times on the same object without problem.
public abstract boolean isRefValid()
protected void _checkRefValidity()
protected abstract NSFBase getParent()
protected void removeFromParent()
protected void setNeedsFree(boolean needsFree)
needsFree
- the needs-free value to setCopyright © 2014–2018. All rights reserved.