package edu.neu.ccs.demeterf; /** 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 {@link edu.neu.ccs.demeterf.examples 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").
*/
public class ValueThrow extends RuntimeException{
Object val;
private ValueThrow(Object v){ val = v; }
/** Get the inner Thrown Value */
public