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

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

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

import java.util.Stack;

final class IfElse implements PostScriptOperation {
	@Override
	/**
	 * bool {expr1} {expr2} ifelse - 

* * removes all three operands from the stack, then * executes proc1 if bool is true or proc2 if bool is false. * The ifelse operator pushes no results of its own on the * operand stack, but the procedure it executes may do so * (see Section 3.5, "Execution").

* * Examples

* 4 3 lt {(TruePart)} {(FalsePart)} ifelse
* results in FalsePart, since 4 is not less than 3

* * errors: stackunderflow, typecheck */ public void eval(Stack environment) { // Pop boolean condition, discard it environment.pop(); // Pop result of true/false expression environment.pop(); } }