public final class StackTraceElement extends Object implements Serializable
Constructor and Description |
---|
StackTraceElement() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Returns true if the specified object is another
StackTraceElement instance representing
the same execution point as this instance. |
String |
getClassName()
Returns the fully qualified name of the class containing the execution point represented by this
stack trace element.
|
String |
getFileName()
Returns the name of the source file containing the execution point represented by this stack
trace element.
|
int |
getLineNumber()
Returns the line number of the source line containing the execution point represented by this
stack trace element.
|
String |
getMethodName()
Returns the name of the method containing the execution point represented by this stack trace
element.
|
int |
hashCode()
Returns a hash code value for this stack trace element.
|
String |
toString()
Returns a string representation of this stack trace element.
|
public boolean equals(@Nullable Object obj)
StackTraceElement
instance representing
the same execution point as this instance. Two stack trace elements a
and b
are
equal if and only if:
equals(a.getFileName(), b.getFileName()) && a.getLineNumber() == b.getLineNumber()) && equals(a.getClassName(), b.getClassName()) && equals(a.getMethodName(), b.getMethodName())
equals
in class Object
obj
- the object to be compared with this stack trace element.StackTraceElement
instance representing
the same execution point as this instance.Object.hashCode()
,
HashMap
public String getClassName()
Class
containing the execution point represented
by this stack trace element.@Nullable public String getFileName()
SourceFile
attribute of the relevant
class
file (as per The Java Virtual Machine Specification, Section 4.7.7). In some
systems, the name may refer to some source code unit other than a file, such as an entry in
source repository.null
if this information is unavailable.public int getLineNumber()
LineNumberTable
attribute of the
relevant class
file (as per The Java Virtual Machine Specification, Section
4.7.8).public String getMethodName()
<init>
or <clinit>
, as
per Section 3.9 of The Java Virtual Machine Specification.public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)