|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Throwable | +--java.lang.Exception | +--java.lang.RuntimeException | +--lava.NotImplementedException
Indicates an unfinished execution path.
Details: A NotImplementedException
is thrown when a method is called, a case invoked, or a feature is requested that has not yet been implemented. This class is for developers; it makes it possible to compile code before all of it has been written, while minimizing the risk of forgetting to finish it later. Simply include the statement
throw new lava.NotImplementedException ();
in any method or execution path that you'd like to finish later, and the compiler will let you compile the code without forcing you to insert dummy return values, etc., which you might forget about later.
Example:
public static float [] findPolynomialRoots (Polynomial p) { // I'm putting this declaration here // so that the rest of my code will compile, // but I'll implement the body later. throw new lava.NotImplementedException (); }
NotImplementedException
is extremely handy if you're the kind of programmer who likes to design classes "on the fly," by setting up "method stubs" to fill in later. By using NotImplementedException
to mark unfinished execution paths, you can guarantee that you'll eventually get back to them, because if you forget, the JVM will let you know about it -- down to the class, method, and line number!
Constructor Summary | |
NotImplementedException()
Initializes without message. |
|
NotImplementedException(java.lang.String s)
Initializes with message. |
Method Summary | |
static void |
trace()
Prints stack trace without throwing. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getLocalizedMessage, getMessage, printStackTrace, printStackTrace, printStackTrace, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public NotImplementedException()
Details: This default constructor initializes a new NotImplementedException
without an exception message.
public NotImplementedException(java.lang.String s)
Details: This constructor initializes a new NotImplementedException
with the given exception message.
s
- the messsageMethod Detail |
public static void trace()
Details: trace
instantiates a new NotImplementedException
without throwing it, and then outputs its stack trace to System.err
. This is useful for tracking unfinished code paths which must be allowed to operate, albeit temporarily, in their unfinished state.
|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |