public interface PageStack
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.
|
boolean isEmpty()
true
if the stack is empty, false
otherwise.void push(Page page)
page
- the page to push.Page pop() throws java.util.EmptyStackException
java.util.EmptyStackException
- if the stack is empty.isEmpty()
Page popUntil(java.lang.String url)
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.
url
- the URL to search for in the stack.URLResolver.isSamePage(String, String)
,
URLResolver.resolve(String)
Page peek() throws java.util.EmptyStackException
java.util.EmptyStackException
- if the stack is empty.isEmpty()
void removeAll()
Page elementAt(int index) throws java.lang.ArrayIndexOutOfBoundsException
index
- the index of the page.java.lang.ArrayIndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size()
)int size()