public interface AlgorithmStateAttachment
AlgorithmState
.
Modifier and Type | Method and Description |
---|---|
<T> T |
addAttachment(java.lang.String key,
T attachment)
Attaches an object to the algorithm state.
|
<T> T |
getAttachment(java.lang.String key)
Gets an attachment of the algorithm state.
|
<T> T |
getAttachment(java.lang.String key,
T defValue)
Gets an attachment of the algorithm state.
|
<T> T addAttachment(java.lang.String key, T attachment) throws java.lang.IllegalArgumentException
AlgorithmState
is a mutable object storage meaning that changes to the object after the
object was added to the state cannot be made undone.key
- the keyattachment
- the object to attachjava.lang.IllegalArgumentException
- <T> T getAttachment(java.lang.String key)
key
- the keynull
if the state does not contain an attachment with the given key and type<T> T getAttachment(java.lang.String key, T defValue)
key
- key the keydefValue
- the default return value