org.metasyntactic.debug
Class Line

java.lang.Object
  |
  +--org.metasyntactic.debug.Line

public class Line
extends java.lang.Object

Languages with preprocessors, like C and C++, have the luxery of being able to embed macros like __LINE__ into the source and have that later be converted by the preprocessor in the line number of that line of source. This class tries to give java that same functionality. When Line.line() is called it returns the line number that the program is currently on.


Method Summary
static int line()
          Return the line of the method that called Line.line(); If the line cannot be determined the -1 is returned
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

line

public static int line()
Return the line of the method that called Line.line(); If the line cannot be determined the -1 is returned

Returns:
The line number of the calling method, or -1 if it could not be determined