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)
History
public boolean canGoForward(V current)
History
canGoForward
in interface History<V>
current
- the current elementpublic void clear()
History
public boolean contains(V element)
History
public List<V> elements()
History
public V goBack(V current)
History
public V goForward(V current)
History
public void remove(V element)
History
public void setMaxSize(int value)
History
setMaxSize
in interface History<V>
value
- the new max sizepublic int size()
History
Copyright © 2010-2020 Toolsverse. All Rights Reserved.