org.foray.ps
Class PsExecutionStack

java.lang.Object
  extended by org.foray.ps.PsStack<PsObject>
      extended by org.foray.ps.PsExecutionStack

public class PsExecutionStack
extends PsStack<PsObject>

A PostScript Execution stack.


Field Summary
 
Fields inherited from class org.foray.ps.PsStack
DEFAULT_STACK_SIZE
 
Method Summary
protected  PsObject filterPush(PsObject objectToPush)
          A hook for subclasses to filter the content of items being pushed onto the stack.
 int getMinimumStackSize()
          Returns the minumum size that this stack can be.
 PsError getUnderflowError()
          Returns the appropriate PS error that should be used for an underflow condition in this stack.
 
Methods inherited from class org.foray.ps.PsStack
getInterpreter, getList, peek, peek, pop, pop, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMinimumStackSize

public int getMinimumStackSize()
Description copied from class: PsStack
Returns the minumum size that this stack can be. Attempts to pop an item off the stack that would violate this constraint will result in an underflow error.

Specified by:
getMinimumStackSize in class PsStack<PsObject>
Returns:
The minimum size that this stack can be.

getUnderflowError

public PsError getUnderflowError()
Description copied from class: PsStack
Returns the appropriate PS error that should be used for an underflow condition in this stack.

Specified by:
getUnderflowError in class PsStack<PsObject>
Returns:
The PS underflow error for this stack.

filterPush

protected PsObject filterPush(PsObject objectToPush)
Description copied from class: PsStack
A hook for subclasses to filter the content of items being pushed onto the stack.

Specified by:
filterPush in class PsStack<PsObject>
Parameters:
objectToPush - The nominal object being pushed onto the stack.
Returns:
The object that should actually be pushed onto the stack. This can be the same as objectToPush, but is not required to be so.


Copyright © 2017. All rights reserved.