|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.ps.PsStack<T>
T
- The class of objects in this stack.public abstract class PsStack<T>
The PSStack represents a PostScript stack.
Field Summary | |
---|---|
protected static int |
DEFAULT_STACK_SIZE
Constant indicating the default number of entries in a stack. |
Method Summary | |
---|---|
protected abstract T |
filterPush(T objectToPush)
A hook for subclasses to filter the content of items being pushed onto the stack. |
PsInterpreter4a |
getInterpreter()
Returns the internal list. |
protected List<T> |
getList()
Returns the internal list. |
abstract int |
getMinimumStackSize()
Returns the minumum size that this stack can be. |
abstract PsError |
getUnderflowError()
Returns the appropriate PS error that should be used for an underflow condition in this stack. |
T |
peek()
Returns the top element from the stack, but leaves it on the stack. |
T |
peek(int indexFromTop)
Returns a stack item without removing it or anything else from the stack. |
T |
pop()
Discards and returns the top element at the request of the interpreter, that is, with no known operation triggering the pop. |
T |
pop(PsOperator operatorCode)
Discards and returns the top element from the stack. |
int |
size()
Returns the size of the stack. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int DEFAULT_STACK_SIZE
Method Detail |
---|
public T pop(PsOperator operatorCode) throws PsOperatorException
operatorCode
- The operator requesting the pop.
This is used in user messages.
PsOperatorException
- For PostScript stackunderflow errors.public abstract int getMinimumStackSize()
public abstract PsError getUnderflowError()
public T pop() throws PsOperatorException
PsOperatorException
- For PostScript stackunderflow errors.public T peek()
public T peek(int indexFromTop)
indexFromTop
- The number of items deep in the stack the desired
element is. To get the top element, set to 0. To get the next element
down, set to 1, etc.
public int size()
protected List<T> getList()
public PsInterpreter4a getInterpreter()
protected abstract T filterPush(T objectToPush)
objectToPush
- The nominal object being pushed onto the stack.
objectToPush
, but is not required to be so.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |