org.hopto.pentaj.jexin.stacktrace
Class StackFrame
java.lang.Object
org.hopto.pentaj.jexin.stacktrace.StackFrame
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Comparable<StackFrame>
public class StackFrame
- extends java.lang.Object
- implements java.io.Serializable, java.lang.Comparable<StackFrame>
A stack frame for a method call. Each stack frame may be uniquely identified and/or sorted by the combination of pushDate and
frameNumber.
- See Also:
- Serialized Form
Constructor Summary |
StackFrame(java.lang.String methodSignature,
int[] injectableExceptions)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
StackFrame
public StackFrame(java.lang.String methodSignature,
int[] injectableExceptions)
- Parameters:
methodSignature
- injectableExceptions
-
getInjectedException
public InjectableException getInjectedException()
- Returns:
- the
InjectableException
that was injected
getFrameNumber
public long getFrameNumber()
- Frame numbers are used to compare
StackFrame
s that have the same pushTime.
- Returns:
- the frameNumber
getMethodSignature
public java.lang.String getMethodSignature()
- Returns:
- Signature of the method called. This is never null or empty.
getInjectableExceptions
public int[] getInjectableExceptions()
- Returns:
- The exception IDs that have been explicitly identified as valid to be injected in this method. An empty array
indicates that none have been explicitely identified. Any exception can always be injected at any point regardless
of whether it is listed here or not.
getException
public java.lang.String getException()
- Returns:
- The exception thrown by the method. Null if the method has not returned or returned without throwing an exception.
getStackLevel
public int getStackLevel()
- Returns:
- The level indicates how deep in the stack the method is. If method A calls B calls C then B calld D the levels will
be as follows: Method A = 0, B = 1, C = 2, D = 2
getTraceIndex
public int getTraceIndex()
- Returns:
- The index of this frame in the
StackTrace
getPushTime
public java.util.Date getPushTime()
- Returns:
- The time this frame was pushed onto the
StackTrace
getPopTime
public java.util.Date getPopTime()
- Returns:
- The time this frame was popped off of the
StackTrace
getDuration
public long getDuration()
- Returns:
- The duration of the method call in milliseconds
compareTo
public int compareTo(StackFrame that)
- Sorts based on pushTime then frameNumber
- Specified by:
compareTo
in interface java.lang.Comparable<StackFrame>
- See Also:
Comparable.compareTo(java.lang.Object)
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object
- See Also:
Object.equals(java.lang.Object)
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
- See Also:
Object.hashCode()