Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.eireneh.util
Class StackTrace  view StackTrace download StackTrace.java

java.lang.Object
  extended bycom.eireneh.util.StackTrace

public final class StackTrace
extends java.lang.Object

Unscramble the current stack, and present the data from it to the user in various forms. This code is slightly dodgy in that it makes use of the way exceptions print their stack straces, however it is probably a safe enough assumption for the moment.
Distribution Licence:
Project B is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
The License is available on the internet here, by writing to Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA, Or locally at the Licence link below.
The copyright to this program is held by it's authors.


Nested Class Summary
 class StackTrace.AbstractStackEnumeration
          Base class for the real enumeration implementations below
 
Field Summary
private  java.lang.String[] class_names
          Array containing the class names
private  java.lang.String[] file_names
          Array containing the file names
private  int[] line_numbers
          Array containing the line numbers
private  java.lang.String[] method_names
          Array containing the method names
 
Constructor Summary
StackTrace()
          Generate a stack trace an model it
StackTrace(java.lang.Throwable ex)
          We already have an Exception that we'd like to model
 
Method Summary
 int countStackElements()
          Get the name of a function
 java.lang.Class getClass(int level)
          Get the Class that owns the function
 java.lang.String getClassName(int level)
          Get the name of a class
 java.util.Enumeration getClassNameElements()
          To itterate over the class names
 java.lang.String getFileName(int level)
          Get the name of a file
 java.lang.String getFullFunctionName(int level)
          Get the name of a function including class name
 java.util.Enumeration getFullFunctionNameElements()
          To itterate over the full function names
 java.lang.String getFunctionName(int level)
          Get the name of a function
 java.util.Enumeration getFunctionNameElements()
          To itterate over the function names
 int getLineNumber(int level)
          Get the line number within a file
private  void init(java.lang.Throwable ex, int disgard)
          Create a stack trace of the code at this point
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

class_names

private java.lang.String[] class_names
Array containing the class names


method_names

private java.lang.String[] method_names
Array containing the method names


file_names

private java.lang.String[] file_names
Array containing the file names


line_numbers

private int[] line_numbers
Array containing the line numbers

Constructor Detail

StackTrace

public StackTrace()
Generate a stack trace an model it


StackTrace

public StackTrace(java.lang.Throwable ex)
We already have an Exception that we'd like to model

Method Detail

init

private void init(java.lang.Throwable ex,
                  int disgard)
Create a stack trace of the code at this point


countStackElements

public final int countStackElements()
Get the name of a function


getFunctionName

public final java.lang.String getFunctionName(int level)
Get the name of a function


getFullFunctionName

public final java.lang.String getFullFunctionName(int level)
Get the name of a function including class name


getClassName

public final java.lang.String getClassName(int level)
Get the name of a class


getFileName

public final java.lang.String getFileName(int level)
Get the name of a file


getLineNumber

public final int getLineNumber(int level)
Get the line number within a file


getClass

public final java.lang.Class getClass(int level)
Get the Class that owns the function


getClassNameElements

public final java.util.Enumeration getClassNameElements()
To itterate over the class names


getFunctionNameElements

public final java.util.Enumeration getFunctionNameElements()
To itterate over the function names


getFullFunctionNameElements

public final java.util.Enumeration getFullFunctionNameElements()
To itterate over the full function names