kr.co.hit.live.profile.node
Class ProfileNode

java.lang.Object
  extended by kr.co.hit.live.profile.node.ProfileNode
Direct Known Subclasses:
ArrayProfileNode, ObjectProfileNode

public abstract class ProfileNode
extends Object

ObjectProfiler를 사용하여 profile()이 수행된 후 그 결과를 표현하기 위한 클래스이다. 프로파일 결과는 ProfileNode 객체들의 트리구조로 표현된다.

Since:
4.0
Author:
김형도

Field Summary
protected static int ARRAY_TYPE
           
protected  List<ProfileNode> children
           
protected  int nodeSize
           
static int OBJECT_REF_SIZE
           
static int OBJECT_SHELL_SIZE
           
protected static int OBJECT_TYPE
           
protected  ProfileNode parent
           
static int PRIMITIVE_BOOLEAN_SIZE
           
protected static int PRIMITIVE_BOOLEAN_TYPE
           
static int PRIMITIVE_BYTE_SIZE
           
protected static int PRIMITIVE_BYTE_TYPE
           
static int PRIMITIVE_CHAR_SIZE
           
protected static int PRIMITIVE_CHAR_TYPE
           
static int PRIMITIVE_DOUBLE_SIZE
           
protected static int PRIMITIVE_DOUBLE_TYPE
           
static int PRIMITIVE_FLOAT_SIZE
           
protected static int PRIMITIVE_FLOAT_TYPE
           
static int PRIMITIVE_INT_SIZE
           
protected static int PRIMITIVE_INT_TYPE
           
static int PRIMITIVE_LONG_SIZE
           
protected static int PRIMITIVE_LONG_TYPE
           
static int PRIMITIVE_SHORT_SIZE
           
protected static int PRIMITIVE_SHORT_TYPE
           
protected static int[] PRIMITIVE_SIZE
           
protected  int refCount
           
protected  Object refObject
           
protected  int totalSize
           
protected static String[] TYPE_NAME
           
 
Constructor Summary
ProfileNode(ProfileNode parentNode, Object refObj)
           
 
Method Summary
 void addChild(ProfileNode child)
          자식 노드를 추가한다.
 void addRefCount()
           
 Object getObject()
          노드가 프로파일링한 실제 객체를 반환한다.
static int getPrimitiveSize(Class<?> type)
          주어진 primitive 타입의 메모리 크기를 반환한다.
static int getPrimitiveType(Class<?> type)
          주어진 primitive 타입별로 정의한 상수값을 반환한다.
 int nodeSize()
          자식 노드를 포함하지않는 자신의 크기만을 반환한다.
 ProfileNode parent()
          부모 노드를 반환한다.
 void totalize()
          자신의 크기를 부모 노드의 크기에 합산시킨다.
 int totalSize()
          자신 노드를 포함하는 크기를 반환한다.
 void traverse(ProfileNodeVisitor visitor)
          노드의 트리 구조를 탐색하기 위한 메소드이다.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRIMITIVE_LONG_SIZE

public static final int PRIMITIVE_LONG_SIZE
See Also:
Constant Field Values

PRIMITIVE_INT_SIZE

public static final int PRIMITIVE_INT_SIZE
See Also:
Constant Field Values

PRIMITIVE_SHORT_SIZE

public static final int PRIMITIVE_SHORT_SIZE
See Also:
Constant Field Values

PRIMITIVE_CHAR_SIZE

public static final int PRIMITIVE_CHAR_SIZE
See Also:
Constant Field Values

PRIMITIVE_BYTE_SIZE

public static final int PRIMITIVE_BYTE_SIZE
See Also:
Constant Field Values

PRIMITIVE_BOOLEAN_SIZE

public static final int PRIMITIVE_BOOLEAN_SIZE
See Also:
Constant Field Values

PRIMITIVE_DOUBLE_SIZE

public static final int PRIMITIVE_DOUBLE_SIZE
See Also:
Constant Field Values

PRIMITIVE_FLOAT_SIZE

public static final int PRIMITIVE_FLOAT_SIZE
See Also:
Constant Field Values

OBJECT_REF_SIZE

public static final int OBJECT_REF_SIZE
See Also:
Constant Field Values

OBJECT_SHELL_SIZE

public static final int OBJECT_SHELL_SIZE
See Also:
Constant Field Values

PRIMITIVE_LONG_TYPE

protected static final int PRIMITIVE_LONG_TYPE
See Also:
Constant Field Values

PRIMITIVE_INT_TYPE

protected static final int PRIMITIVE_INT_TYPE
See Also:
Constant Field Values

PRIMITIVE_SHORT_TYPE

protected static final int PRIMITIVE_SHORT_TYPE
See Also:
Constant Field Values

PRIMITIVE_CHAR_TYPE

protected static final int PRIMITIVE_CHAR_TYPE
See Also:
Constant Field Values

PRIMITIVE_BYTE_TYPE

protected static final int PRIMITIVE_BYTE_TYPE
See Also:
Constant Field Values

PRIMITIVE_BOOLEAN_TYPE

protected static final int PRIMITIVE_BOOLEAN_TYPE
See Also:
Constant Field Values

PRIMITIVE_DOUBLE_TYPE

protected static final int PRIMITIVE_DOUBLE_TYPE
See Also:
Constant Field Values

PRIMITIVE_FLOAT_TYPE

protected static final int PRIMITIVE_FLOAT_TYPE
See Also:
Constant Field Values

OBJECT_TYPE

protected static final int OBJECT_TYPE
See Also:
Constant Field Values

ARRAY_TYPE

protected static final int ARRAY_TYPE
See Also:
Constant Field Values

TYPE_NAME

protected static final String[] TYPE_NAME

PRIMITIVE_SIZE

protected static final int[] PRIMITIVE_SIZE

parent

protected ProfileNode parent

refObject

protected Object refObject

nodeSize

protected int nodeSize

totalSize

protected int totalSize

refCount

protected int refCount

children

protected List<ProfileNode> children
Constructor Detail

ProfileNode

public ProfileNode(ProfileNode parentNode,
                   Object refObj)
Method Detail

getObject

public Object getObject()
노드가 프로파일링한 실제 객체를 반환한다.

Returns:

totalize

public void totalize()
자신의 크기를 부모 노드의 크기에 합산시킨다.


parent

public ProfileNode parent()
부모 노드를 반환한다. 부모 노드가 없는 root 노드인 경우에는 null을 반환한다.

Returns:

addRefCount

public void addRefCount()

addChild

public void addChild(ProfileNode child)
자식 노드를 추가한다.

Parameters:
child -

nodeSize

public int nodeSize()
자식 노드를 포함하지않는 자신의 크기만을 반환한다.

Returns:

totalSize

public int totalSize()
자신 노드를 포함하는 크기를 반환한다.

Returns:

traverse

public void traverse(ProfileNodeVisitor visitor)
노드의 트리 구조를 탐색하기 위한 메소드이다.

Parameters:
visitor -

getPrimitiveSize

public static int getPrimitiveSize(Class<?> type)
주어진 primitive 타입의 메모리 크기를 반환한다.

Parameters:
type -
Returns:

getPrimitiveType

public static int getPrimitiveType(Class<?> type)
주어진 primitive 타입별로 정의한 상수값을 반환한다.

Parameters:
type -
Returns:


Copyright © 2014. All Rights Reserved.