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 boolean
empty()
Returns whether the stack is empty.Object
getObject(int index)
Returns the object at the specified index.String
getPath()
Returns the full property path.String
getPath(int index)
Returns the path at the specified index.Object
peekObject()
Returns the object at the top.String
peekPath()
Returns the path at the top.void
pop()
Pops current path and object of the stack.void
push(String path, Object obj)
Pushes the path and the associated object onto the stack.int
size()
Returns the size of the stack.String
toString()
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
-
-