Package org.openjdk.jmc.common.util
Class MCStackTrace
- java.lang.Object
-
- org.openjdk.jmc.common.util.MCStackTrace
-
- All Implemented Interfaces:
IMCStackTrace
public class MCStackTrace extends java.lang.Object implements IMCStackTrace
Base class for stack traces.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.openjdk.jmc.common.IMCStackTrace
IMCStackTrace.TruncationState
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<IMCFrame>
frames
private int
hashCode
private IMCStackTrace.TruncationState
truncationState
-
Constructor Summary
Constructors Constructor Description MCStackTrace(java.util.List<IMCFrame> frames, IMCStackTrace.TruncationState truncationState)
Create a new stack trace instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private int
calcMethodHash()
boolean
equals(java.lang.Object obj)
java.util.List<IMCFrame>
getFrames()
Return the frames that this stack trace consist of.IMCStackTrace.TruncationState
getTruncationState()
Returns the truncation state of the stack trace.int
hashCode()
-
-
-
Field Detail
-
frames
private final java.util.List<IMCFrame> frames
-
truncationState
private final IMCStackTrace.TruncationState truncationState
-
hashCode
private final int hashCode
-
-
Constructor Detail
-
MCStackTrace
public MCStackTrace(java.util.List<IMCFrame> frames, IMCStackTrace.TruncationState truncationState)
Create a new stack trace instance.- Parameters:
frames
- the frames of the stack trace, seeIMCStackTrace.getFrames()
truncationState
- the stack trace truncation state
-
-
Method Detail
-
getFrames
public final java.util.List<IMCFrame> getFrames()
Description copied from interface:IMCStackTrace
Return the frames that this stack trace consist of. The frames are ordered from top frame to root frame.- Specified by:
getFrames
in interfaceIMCStackTrace
- Returns:
- the frames
-
getTruncationState
public IMCStackTrace.TruncationState getTruncationState()
Description copied from interface:IMCStackTrace
Returns the truncation state of the stack trace.To easily check if the stack trace is truncated you can use the
IMCStackTrace.TruncationState.isTruncated()
method. For example:mytrace.getTruncationState().isTruncated()
.- Specified by:
getTruncationState
in interfaceIMCStackTrace
- Returns:
- the truncation state
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
calcMethodHash
private int calcMethodHash()
-
-