Package adams.core.option
Class OptionTraversalPath
- java.lang.Object
-
- adams.core.option.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)
-
-
Constructor Summary
Constructors Constructor Description OptionTraversalPath()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanempty()Returns whether the stack is empty.ObjectgetObject(int index)Returns the object at the specified index.StringgetPath()Returns the full property path.StringgetPath(int index)Returns the path at the specified index.ObjectpeekObject()Returns the object at the top.StringpeekPath()Returns the path at the top.voidpop()Pops current path and object of the stack.voidpush(String path, Object obj)Pushes the path and the associated object onto the stack.intsize()Returns the size of the stack.StringtoString()Just returns the path.
-
-
-
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 addobj- 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
-
-