wicket.util.profile
Class AbstractProfileNode

java.lang.Object
  extended bywicket.util.profile.AbstractProfileNode
All Implemented Interfaces:
java.lang.Comparable, IObjectProfileNode
Direct Known Subclasses:
AbstractShellProfileNode, ObjectProfileNode

abstract class AbstractProfileNode
extends java.lang.Object
implements IObjectProfileNode, java.lang.Comparable

Abstract base class for all node implementations in this package.

Author:
(C) Vlad Roubtsov , 2003

Nested Class Summary
 
Nested classes inherited from class wicket.util.profile.IObjectProfileNode
IObjectProfileNode.INodeFilter, IObjectProfileNode.INodeVisitor
 
Field Summary
(package private) static IObjectProfileNode[] EMPTY_OBJECTPROFILENODE_ARRAY
           
(package private)  int m_size
           
 
Constructor Summary
(package private) AbstractProfileNode(IObjectProfileNode parent)
           
 
Method Summary
 int compareTo(java.lang.Object obj)
           
 java.lang.String dump()
          Dumps this node into a flat-text format used by the ObjectProfileVisitors#newDefaultNodePrinter default node visitor.
 IObjectProfileNode parent()
          Returns the assigned ownership parent for this node.
 IObjectProfileNode[] path()
          Returns the full path from the profile tree root to this node, in that direction.
 int pathlength()
          A convenience method for retrieving this node's tree path length.
 IObjectProfileNode root()
          A convenience method for retrieving the root node from any node in a profile tree.
 int size()
          Returns the full size (in bytes) assigned to this node in its profile tree.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wicket.util.profile.IObjectProfileNode
children, name, object, refcount, shell, traverse
 

Field Detail

EMPTY_OBJECTPROFILENODE_ARRAY

static final IObjectProfileNode[] EMPTY_OBJECTPROFILENODE_ARRAY

m_size

int m_size
Constructor Detail

AbstractProfileNode

AbstractProfileNode(IObjectProfileNode parent)
Method Detail

size

public final int size()
Description copied from interface: IObjectProfileNode
Returns the full size (in bytes) assigned to this node in its profile tree. This is the sum of sizes of the node class's shelland its non-primitive non-null instance fields, computed as a closure over the spanning tree produced by ObjectProfiler.profile(java.lang.Object).

Specified by:
size in interface IObjectProfileNode
Returns:
total node size [always positive]
See Also:
IObjectProfileNode.size()

parent

public final IObjectProfileNode parent()
Description copied from interface: IObjectProfileNode
Returns the assigned ownership parent for this node. This is null for the root node.

Specified by:
parent in interface IObjectProfileNode
Returns:
parent node [null only for the root node]
See Also:
IObjectProfileNode.parent()

path

public final IObjectProfileNode[] path()
Description copied from interface: IObjectProfileNode
Returns the full path from the profile tree root to this node, in that direction. The result includes the root node as well as the current node.

Invariant: node.root() == node.path()[0] Invariant: node.path()[node.path().length - 1] == node Invariant: node.path().length == node.pathlength()

Specified by:
path in interface IObjectProfileNode
Returns:
node tree path [never null/empty]
See Also:
IObjectProfileNode.path()

root

public final IObjectProfileNode root()
Description copied from interface: IObjectProfileNode
A convenience method for retrieving the root node from any node in a profile tree.

Invariant: node.root() == node iff 'node' is the root of its profile tree Invariant: node.root() == node.path()[0]

Specified by:
root in interface IObjectProfileNode
Returns:
the root node for the profile tree that the current node is a part of [never null]
See Also:
IObjectProfileNode.root()

pathlength

public final int pathlength()
Description copied from interface: IObjectProfileNode
A convenience method for retrieving this node's tree path length.

Specified by:
pathlength in interface IObjectProfileNode
Returns:
path length [always positive]
See Also:
IObjectProfileNode.pathlength()

dump

public final java.lang.String dump()
Description copied from interface: IObjectProfileNode
Dumps this node into a flat-text format used by the ObjectProfileVisitors#newDefaultNodePrinter default node visitor.

Specified by:
dump in interface IObjectProfileNode
Returns:
indented dump string [could be very large]
See Also:
IObjectProfileNode.dump()

compareTo

public final int compareTo(java.lang.Object obj)
Specified by:
compareTo in interface java.lang.Comparable
See Also:
Comparable.compareTo(java.lang.Object)

toString

public java.lang.String toString()
See Also:
Object.toString()


Copyright © 2004-2006 Wicket developers. All Rights Reserved.