uk.ac.starlink.ttools.lint
Class HandlerStack

java.lang.Object
  extended by uk.ac.starlink.ttools.lint.HandlerStack

public class HandlerStack
extends Object

Data structure which keeps track of the elements currently in scope during the SAX parse.

Since:
7 Apr 2005
Author:
Mark Taylor (Starlink)

Constructor Summary
HandlerStack()
           
 
Method Summary
 Ancestry getAncestry()
          Returns an ancestry object for the handler at the top of this stack.
 ElementHandler pop()
          Pops a handler off the top of the stack.
 void push(ElementHandler handler)
          Pushes a new handler onto the stack.
 ElementHandler top()
          Returns the handler at the top of the list without removing it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HandlerStack

public HandlerStack()
Method Detail

pop

public ElementHandler pop()
Pops a handler off the top of the stack.

Returns:
the element which has just been removed

push

public void push(ElementHandler handler)
Pushes a new handler onto the stack.

Parameters:
handler - handler to push

top

public ElementHandler top()
Returns the handler at the top of the list without removing it.

Returns:
top element

getAncestry

public Ancestry getAncestry()
Returns an ancestry object for the handler at the top of this stack. This is only valid for as long as that object is still in the stack. An attempt to use it after that point will give garbage results or may result in an unchecked throwable.

Returns:
ancestry for the top element


Copyright © 2009 Central Laboratory of the Research Councils. All Rights Reserved.