All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openpdf.renderer.function.postscript.operation.If Maven / Gradle / Ivy

The newest version!
package org.openpdf.renderer.function.postscript.operation;

import java.util.Stack;


final class If implements PostScriptOperation {
	@Override
	/**
	 * bool {proc} if - 

* * removes both operands from the stack, then executes proc * if bool is true. The if operator pushes no results of * its own on the operand stack, but proc may do so (see * Section 3.5, "Execution").

* * Examples

* 3 4 lt {(3 is less than 4)} if

* * errors: stackunderflow, typecheck */ public void eval(Stack environment) { if ((Boolean)environment.pop()) { environment.push(environment.pop()); } else { environment.pop(); } } }