org.jibx.binding.util
Class SparseStack

java.lang.Object
  extended by org.jibx.binding.util.SparseStack

public class SparseStack
extends Object

Stack for values that depend on the level of nesting, where only some of the levels change the current value.

Author:
Dennis M. Sosnoski

Constructor Summary
SparseStack()
          Constructor with no initial value.
SparseStack(Object current)
          Constructor with initial value.
 
Method Summary
 void enter()
          Enter a level of nesting.
 Object exit()
          Exit a level of nesting with changed item returned.
 Object getCurrent()
          Get current object.
 void setCurrent(Object obj)
          Set current object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SparseStack

public SparseStack(Object current)
Constructor with initial value.

Parameters:
current - initial value

SparseStack

public SparseStack()
Constructor with no initial value.

Method Detail

getCurrent

public Object getCurrent()
Get current object.

Returns:
current

setCurrent

public void setCurrent(Object obj)
Set current object.

Parameters:
obj - set the current object

enter

public void enter()
Enter a level of nesting.


exit

public Object exit()
Exit a level of nesting with changed item returned.

Returns:
item that was active until this exit, or null if same item still active


Copyright © 2005-2011 jibx.org. All Rights Reserved.