Class OptionTraversalPath


  • public class OptionTraversalPath
    extends Object
    Keeps track of the properties traversed so far.
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Field Detail

      • m_Paths

        protected Stack<String> m_Paths
        the path stack.
      • m_Objects

        protected Stack<Object> m_Objects
        the object stack.
    • Constructor Detail

      • OptionTraversalPath

        public OptionTraversalPath()
    • Method Detail

      • push

        public void push​(String path,
                         Object obj)
        Pushes the path and the associated object onto the stack.
        Parameters:
        path - the path to add
        obj - the associated object
      • pop

        public void pop()
        Pops current path and object of the stack.
      • size

        public int size()
        Returns the size of the stack.
        Returns:
        the number of elements on the stack
      • empty

        public boolean empty()
        Returns whether the stack is empty.
        Returns:
        true if empty
      • getPath

        public String getPath​(int index)
        Returns the path at the specified index.
        Parameters:
        index - the index of the path element
        Returns:
        the path element
      • getObject

        public Object getObject​(int index)
        Returns the object at the specified index.
        Parameters:
        index - the index of the object element
        Returns:
        the object element
      • peekPath

        public String peekPath()
        Returns the path at the top.
        Returns:
        the path element
      • peekObject

        public Object peekObject()
        Returns the object at the top.
        Returns:
        the object element
      • getPath

        public String getPath()
        Returns the full property path.
        Returns:
        the path
      • toString

        public String toString()
        Just returns the path.
        Overrides:
        toString in class Object
        Returns:
        the path