|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception java.lang.RuntimeException edu.neu.ccs.demeterf.ValueThrow
public class ValueThrow
Represents a Value that can be tossed out of a traversal. Includes
static methods to hide how we actually deal with values and
cutting traversals short. See Examples
for more details.
This class basically allows a program to cut off traversal by jumping out with a value (considered tossing). e.g., We might stop traversal after finding a metching element in a list. Usually you would toss a value within an update method, as these are called on the way down while traversing ("pre-order").
Method Summary | ||
---|---|---|
static void |
toss(java.lang.Object o)
Toss a Value out of the traversal |
|
static
|
traverse(Traversal t,
java.lang.Object o)
Handles traversing when a thrown value is expected (No traversal Argument) |
|
static
|
traverse(Traversal t,
java.lang.Object o,
java.lang.Object a)
Handles traversing when a thrown value is expected (With traversal Argument) |
|
|
value()
Get the inner Thrown Value |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public <T> T value()
public static void toss(java.lang.Object o) throws ValueThrow
ValueThrow
public static <T> T traverse(Traversal t, java.lang.Object o)
public static <T> T traverse(Traversal t, java.lang.Object o, java.lang.Object a)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |