|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.StackTraceElement
public final class StackTraceElement
One function call or stack trace element. Gives information about the execution point such as the source file name, the line number, the fully qualified class name, the method name and whether this method is native, if this information is known.
Constructor Summary | |
---|---|
StackTraceElement(String className,
String methodName,
String fileName,
int lineNumber)
Create a new StackTraceElement representing a given source location. |
Method Summary | |
---|---|
boolean |
equals(Object o)
Returns true if the given object is also a StackTraceElement and all attributes, except the native flag, are equal (either the same attribute between the two elments are null, or both satisfy Object.equals). |
String |
getClassName()
Returns the fully qualified class name, or null if unknown. |
String |
getFileName()
Returns the name of the file, or null if unknown. |
int |
getLineNumber()
Returns the line number in the file, or a negative number if unknown. |
String |
getMethodName()
Returns the method name in the class, or null if unknown. |
int |
hashCode()
Returns the hashCode of this StackTraceElement. |
boolean |
isNativeMethod()
Returns true if the method is native, or false if it is not or unknown. |
String |
toString()
Returns a string representation of this stack trace element. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public StackTraceElement(String className, String methodName, String fileName, int lineNumber)
className
- the fully qualified name of the classmethodName
- the name of the methodfileName
- the name of the file, null if unknownlineNumber
- the line in the file, negative if unknown, or -2
if this method is nativeMethod Detail |
---|
public String getFileName()
SourceFile
attribute of the class file
format, if present.
public int getLineNumber()
LineNumberTable
attribute
of the method in the class file format, if present.
public String getClassName()
public String getMethodName()
<init>
; if the execution point is in the class
initializer, the name is <clinit>
.
public boolean isNativeMethod()
public String toString()
toString
in class Object
Object.getClass()
,
Object.hashCode()
,
Class.getName()
,
Integer.toHexString(int)
public boolean equals(Object o)
equals
in class Object
o
- the object to compare
Object.hashCode()
public int hashCode()
hashCode
in class Object
Object.equals(Object)
,
System.identityHashCode(Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |