Constructor and Description |
---|
PageStackURL(URLResolver urlResolver)
Creates a pages stack.
|
Modifier and Type | Method and Description |
---|---|
Page |
elementAt(int index)
Gets the page at an index.
|
boolean |
isEmpty()
Gets whether the stack is empty or not.
|
Page |
peek()
Gets the page at the top of the stack.
|
Page |
pop()
Gets and removes the page at the top of the stack.
|
Page |
popUntil(java.lang.String url)
Gets and removes the last page pushed with a URL.
|
void |
push(Page page)
Pushes a page at the top of the stack.
|
void |
removeAll()
Removes all pages in the stack.
|
int |
size()
Gets the number of pages in the stack.
|
public PageStackURL(URLResolver urlResolver)
urlResolver
- the URL resolver to use.public boolean isEmpty()
PageStack
public void push(Page page)
PageStack
public Page pop() throws java.util.EmptyStackException
PageStack
pop
in interface PageStack
java.util.EmptyStackException
- if the stack is empty.PageStack.isEmpty()
public Page popUntil(java.lang.String url)
PageStack
If no page with this URL can be found in the stack, the stack is cleared and a new page is created with this URL.
popUntil
in interface PageStack
url
- the URL to search for in the stack.URLResolver.isSamePage(String, String)
,
URLResolver.resolve(String)
public Page peek() throws java.util.EmptyStackException
PageStack
peek
in interface PageStack
java.util.EmptyStackException
- if the stack is empty.PageStack.isEmpty()
public void removeAll()
PageStack
public Page elementAt(int index) throws java.lang.ArrayIndexOutOfBoundsException
PageStack