|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpmp.CallStack
public final class CallStack
Stack for storing macro parameters.
Title: PMP: Macroprocessor
Description: Java macroprocessor
Copyright: Copyright (c) 2005
Constructor Summary | |
---|---|
CallStack()
|
Method Summary | |
---|---|
CallStackItem |
addField(java.lang.String str)
Adds new field into array on top of the stack. |
CallStackItem |
appendToLastField(java.lang.String str)
Appends str to last field in array on top of the stack. |
void |
clear()
Removes all items from stack. |
boolean |
isEmpty()
Returns true if stack is empty. |
CallStackItem |
popItem()
Pops item from stack. |
CallStackItem |
pushItem(CallStackItem.Type type,
java.lang.String[] params)
Pushes new item to stack. |
CallStackItem |
pushItem(CallStackItem item)
Pushes new item to stack. |
CallStackItem |
pushMacroItem(java.lang.String macroName,
AbstractMacro macro)
Pushes new item to stack. |
CallStackItem |
stripParamFields()
Removes all parameter fields from item on top of the stack. |
CallStackItem |
topItem()
Returns item on top of the stack or null if stack is
empty. |
CallStackItem.Type |
topItemType()
Returns type of item on top of the stack. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CallStack()
Method Detail |
---|
public CallStackItem pushItem(CallStackItem.Type type, java.lang.String[] params)
type
- type of itemparams
- parameters
public CallStackItem pushMacroItem(java.lang.String macroName, AbstractMacro macro)
TYPE_MACRO
and parameters are
{ macroName, ""}
.
macroName
- name of macro as appeared in programmacro
- that will be invoked when all paameters are read
public CallStackItem pushItem(CallStackItem item)
item
- item to be added to the top of the stack.
item
public CallStackItem popItem()
public boolean isEmpty()
true
if stack is empty.
true
if emptypublic void clear()
public CallStackItem.Type topItemType()
CallStackItem
public CallStackItem topItem()
null
if stack is
empty.
public CallStackItem addField(java.lang.String str)
str
- value
public CallStackItem stripParamFields()
public CallStackItem appendToLastField(java.lang.String str)
str
to last field in array on top of the stack.
str
- value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |