public final class StringHistory extends Object
Usage in a short way: Determine a (possibly unique) ID for your
history to use (I assume that there are not that many?) and get a history
object by invoking StringHistory.getInstance(yourID)
. You
can add recently used String to this object by invoking the
add(String)
method and get a list of String from the
getHistory()
method which will return the history in the order
the add method on the String objects has been called with the last element
added being the first element in the history result.
Modifier and Type | Method and Description |
---|---|
void |
add(String str)
Adds a new String to the history.
|
void |
clearHistory()
Removes all entries from the history.
|
String[] |
getHistory()
Get the history in an array with the most recently added element first.
|
static StringHistory |
getInstance(String id)
Get a history for an ID.
|
static StringHistory |
getInstance(String id,
int maxEntries)
Get a history for an ID.
|
public static StringHistory getInstance(String id)
id
- The ID of interestpublic static StringHistory getInstance(String id, int maxEntries)
id
- The ID of interestmaxEntries
- maximal number of entries in the historypublic void add(String str)
getHistory()
str
- The string to add.NullPointerException
- If argument is null.public String[] getHistory()
public void clearHistory()
KNIME GmbH, Konstanz, Germany
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.