public interface IKeyManager
IKeyManager
manages a set of available keys. This set may be
either a bounded or unbounded set of string keys.Modifier and Type | Method and Description |
---|---|
void |
addKeyChangeListener(IKeyChangeListener listener)
Adds a new
IKeyChangeListener to listen for key change events in
the manager. |
java.util.List<java.lang.String> |
getAvailableKeys()
Gets the list of available keys.
|
java.lang.String |
getNextKey()
Returns the next available key, usually based on some default prefix,
e.g., "key1", "key2".
|
boolean |
keyAvailable(java.lang.String key)
Determines whether the specified key is available.
|
void |
removeKeyChangeListener(IKeyChangeListener listener)
Removes an existing
IKeyChangeListener from the key manager. |
void addKeyChangeListener(IKeyChangeListener listener)
IKeyChangeListener
to listen for key change events in
the manager.listener
- The new listener. The same listener should not be added twice.java.util.List<java.lang.String> getAvailableKeys()
java.lang.String getNextKey() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- An exception is thrown if there is a pre-defined list of keys
and there are no more keys available.boolean keyAvailable(java.lang.String key)
key
- The key to test.void removeKeyChangeListener(IKeyChangeListener listener)
IKeyChangeListener
from the key manager.listener
- The old listener. This removes the first matching occurrence
of the listener from the manager.