Class DefaultStack
- java.lang.Object
- 
- jmri.jmrit.logixng.implementation.DefaultStack
 
- 
- All Implemented Interfaces:
- Stack
 
 public class DefaultStack extends java.lang.Object implements Stack The default implementation of a NamedTable
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface jmri.jmrit.logixng.StackStack.ValueAndType
 
- 
 - 
Field SummaryFields Modifier and Type Field Description (package private) int_count(package private) int_size(package private) static intGROW_SIZE(package private) static intINITIAL_SIZE
 - 
Constructor SummaryConstructors Constructor Description DefaultStack()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCount()Get the number of items on the stackStack.ValueAndTypegetValueAndTypeAtIndex(int index)Get the value and type at an indexjava.lang.ObjectgetValueAtIndex(int index)Get the value at an indexjava.lang.Objectpop()Pops the topmost value off the top of the stack so the stack shrinks.voidpush(Stack.ValueAndType valueAndType)Pushes a value on the top of the stack so the stack grow.voidsetCount(int newCount)Reset the number of items on the stack.voidsetValueAndTypeAtIndex(int index, Stack.ValueAndType valueAndType)Set the value at an indexvoidsetValueAtIndex(int index, java.lang.Object value)Set the value at an index
 
- 
- 
- 
Field Detail- 
INITIAL_SIZEstatic final int INITIAL_SIZE - See Also:
- Constant Field Values
 
 - 
GROW_SIZEstatic final int GROW_SIZE - See Also:
- Constant Field Values
 
 - 
_sizeint _size 
 - 
_countint _count 
 
- 
 - 
Constructor Detail- 
DefaultStackpublic DefaultStack() 
 
- 
 - 
Method Detail- 
pushpublic void push(Stack.ValueAndType valueAndType) Pushes a value on the top of the stack so the stack grow.
 - 
poppublic java.lang.Object pop() Pops the topmost value off the top of the stack so the stack shrinks.
 - 
getValueAtIndexpublic java.lang.Object getValueAtIndex(int index) Get the value at an index- Specified by:
- getValueAtIndexin interface- Stack
- Parameters:
- index- the index from bottom of the table
- Returns:
- value the new value
 
 - 
setValueAtIndexpublic void setValueAtIndex(int index, java.lang.Object value) Set the value at an index- Specified by:
- setValueAtIndexin interface- Stack
- Parameters:
- index- the index from bottom of the table
- value- the new value
 
 - 
getValueAndTypeAtIndexpublic Stack.ValueAndType getValueAndTypeAtIndex(int index) Get the value and type at an index- Specified by:
- getValueAndTypeAtIndexin interface- Stack
- Parameters:
- index- the index from bottom of the table
- Returns:
- value and type the new value
 
 - 
setValueAndTypeAtIndexpublic void setValueAndTypeAtIndex(int index, Stack.ValueAndType valueAndType) Set the value at an index- Specified by:
- setValueAndTypeAtIndexin interface- Stack
- Parameters:
- index- the index from bottom of the table
- valueAndType- the new value and type
 
 - 
getCountpublic int getCount() Get the number of items on the stack
 - 
setCountpublic void setCount(int newCount) Reset the number of items on the stack. This is used when parameters are put on the stack before a call to a module and those parameters needs to be removed when the module returns. The new count must be less than or equal to the current number of items.
 
- 
 
-