decodes.tsdb.algo.jep.GotoFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opendcs Show documentation
Show all versions of opendcs Show documentation
A collection of software for aggregatting and processing environmental data such as from NOAA GOES satellites.
The newest version!
package decodes.tsdb.algo.jep;
import java.util.Stack;
import org.nfunk.jep.ParseException;
import org.nfunk.jep.function.PostfixMathCommand;
/**
* This sets the gotoLabel in the context and then returns 0.
*/
public class GotoFunction
extends PostfixMathCommand
{
private JepContext ctx;
public GotoFunction(JepContext ctx)
{
super();
this.ctx = ctx;
this.numberOfParameters = 1;
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public void run(Stack inStack)
throws ParseException
{
checkStack(inStack);
String label = inStack.pop().toString();
ctx.setGotoLabel(label);
inStack.push(Double.valueOf(0.0));
}
}