Methods Summary |
---|
public boolean | equals(java.lang.Object obj)Compares this instance with the specified object and indicates if they
are equal. In order to be equal, the following conditions must be
fulfilled:
- {@code obj} must be a stack trace element,
- the method names of this stack trace element and of {@code obj} must
not be {@code null},
- the class, method and file names as well as the line number of this
stack trace element and of {@code obj} must be equal.
if (!(obj instanceof StackTraceElement)) {
return false;
}
StackTraceElement castObj = (StackTraceElement) obj;
/*
* Unknown methods are never equal to anything (not strictly to spec,
* but spec does not allow null method/class names)
*/
if ((methodName == null) || (castObj.methodName == null)) {
return false;
}
if (!getMethodName().equals(castObj.getMethodName())) {
return false;
}
if (!getClassName().equals(castObj.getClassName())) {
return false;
}
String localFileName = getFileName();
if (localFileName == null) {
if (castObj.getFileName() != null) {
return false;
}
} else {
if (!localFileName.equals(castObj.getFileName())) {
return false;
}
}
if (getLineNumber() != castObj.getLineNumber()) {
return false;
}
return true;
|
public java.lang.String | getClassName()Returns the fully qualified name of the class belonging to this
{@code StackTraceElement}.
return (declaringClass == null) ? "<unknown class>" : declaringClass;
|
public java.lang.String | getFileName()Returns the name of the Java source file containing class belonging to
this {@code StackTraceElement}.
return fileName;
|
public int | getLineNumber()Returns the line number in the source for the class belonging to this
{@code StackTraceElement}.
return lineNumber;
|
public java.lang.String | getMethodName()Returns the name of the method belonging to this {@code
StackTraceElement}.
return (methodName == null) ? "<unknown method>" : methodName;
|
public int | hashCode()
/*
* Either both methodName and declaringClass are null, or neither are
* null.
*/
if (methodName == null) {
// all unknown methods hash the same
return 0;
}
// declaringClass never null if methodName is non-null
return methodName.hashCode() ^ declaringClass.hashCode();
|
public boolean | isNativeMethod()Indicates if the method name returned by {@link #getMethodName()} is
implemented as a native method.
// BEGIN android-changed
return lineNumber == NATIVE_LINE_NUMBER;
// END android-changed
|
public java.lang.String | toString()
StringBuilder buf = new StringBuilder(80);
buf.append(getClassName());
buf.append('.");
buf.append(getMethodName());
if (isNativeMethod()) {
buf.append("(Native Method)");
} else {
String fName = getFileName();
if (fName == null) {
buf.append("(Unknown Source)");
} else {
int lineNum = getLineNumber();
buf.append('(");
buf.append(fName);
if (lineNum >= 0) {
buf.append(':");
buf.append(lineNum);
}
buf.append(')");
}
}
return buf.toString();
|