be.ugent.caagt.swirl.commands

Class AttributedContext


public class AttributedContext
extends java.lang.Object

Context object for use with org.pietschy.command.CommandManager. Provides a way to store and retrieve attributes using string keys.

Important note: work on this part of the Swirl library will be discontinued because unfortunately newer versions of the GUI commands framework will no longer be available as open source. In due course this class will become deprecated and will eventually be removed from the library.

See Also:
AttributedCommandManager

Constructor Summary

AttributedContext()
Create a context of this type without any keys.

Method Summary

Object
getAttribute(String key)
Retrieve the attribute with the given key.
void
setAttribute(String key, Object value)
Stores an attribute with the given key.

Constructor Details

AttributedContext

public AttributedContext()
Create a context of this type without any keys.

Method Details

getAttribute

public Object getAttribute(String key)
Retrieve the attribute with the given key. A null key is not allowed.
Returns:
Attribute with the given key or null if no such attribute exists in this context.

setAttribute

public void setAttribute(String key,
                         Object value)
Stores an attribute with the given key. If an attribute with that key already exists in this context, the old value is replaced by the value given. Setting an attribute value to null removes the attribute.