| Constructor and Description |
|---|
HistoryImpl()
Instantiates a new history impl using
DEFAULT_MAX_SIZE. |
HistoryImpl(int maxSize)
Instantiates a new history impl using specific maximum size.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canGoBack(V current)
Check if it is possible to go back starting from the current element.
|
boolean |
canGoForward(V current)
Check if it is possible to go forward starting from the current element.
|
void |
clear()
Clears the history
|
boolean |
contains(V element)
Checks if history contains the elements.
|
List<V> |
elements()
Gets the list of elements.
|
V |
goBack(V current)
Returns element of the history which was visited prior to current.
|
V |
goForward(V current)
Returns element of the history which was visited after the current.
|
void |
remove(V element)
Removes the element for the history.
|
void |
setMaxSize(int value)
Sets the maximum size of the history.
|
int |
size()
Returns the current size of the history.
|
void |
visit(V element)
Visits the element.
|
public HistoryImpl()
DEFAULT_MAX_SIZE.public HistoryImpl(int maxSize)
maxSize - the max sizepublic boolean canGoBack(V current)
Historypublic boolean canGoForward(V current)
HistorycanGoForward in interface History<V>current - the current elementpublic void clear()
Historypublic boolean contains(V element)
Historypublic List<V> elements()
Historypublic V goBack(V current)
Historypublic V goForward(V current)
Historypublic void remove(V element)
Historypublic void setMaxSize(int value)
HistorysetMaxSize in interface History<V>value - the new max sizepublic int size()
HistoryCopyright © 2010-2020 Toolsverse. All Rights Reserved.