Swap in the value as the new top of the stack and return the old value.
( NameSpace newTop )
| 106 | value. |
| 107 | */ |
| 108 | public NameSpace swap( NameSpace newTop ) { |
| 109 | int last = stack.size() - 1; |
| 110 | NameSpace oldTop = stack.get(last); |
| 111 | stack.set( last, newTop ); |
| 112 | return oldTop; |
| 113 | } |
| 114 | |
| 115 | public int depth() { |
| 116 | return stack.size(); |