Code example for Deque

Methods: peek, push, size

0
 * @version 3.0 
 */ 
public class PSDupCommand extends PSArithemticCommand { 
	@Override 
	public void execute(final Deque<String> stack, final double x) throws InvalidFormatPSFunctionException {
		if(stack==null || stack.size()<1)
			throw new InvalidFormatPSFunctionException(); 
 
		stack.push(stack.peek());
	} 
}