All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface jdsl.core.api.Decorable

public interface Decorable
Interface from which positions and locators inherit that allows those objects to have attributes attached. The name Decorable comes from the Decorator pattern described in Gamma, et al., in which an object can have things attached to it that add functionality without changing the object itself. Attributes are (name,value) pairs that allow the client (an algorithm, say) to attach labels to positions and locators. For instance, the Object color_ could be the "name" of the attribute holding the color of edges in a red-black tree. The "value" of that attribute would be an instance of java.awt.Color.

Version:
Mon Aug 11 17:06:03 EDT 1997
Author:
Mark Handy

Method Index

 o attributes()
Produces an enumeration of this object's attribute lookup table.
 o create(Object, Object)
Insert a new entry with the default value into this object's attribute lookup dictionary.
 o destroy(Object)
Removes the entry associated with this name in this object's attribute lookup table, returning the value associated with the name.
 o get(Object)
Looks up an attribute value using the name with which the attribute was previously created by a client.
 o has(Object)
Tests whether there is an entry in this object's attribute lookup table associated with this name.
 o set(Object, Object)
Sets an attribute value using the name with which the attribute was previously created by a client.

Methods

 o create
 public abstract void create(Object name,
                             Object value) throws InvalidAttributeException, CoreException
Insert a new entry with the default value into this object's attribute lookup dictionary.

Parameters:
name - Lookup key in the dictionary implementation
value - The value in the dictionary implementation
 o destroy
 public abstract Object destroy(Object name) throws InvalidAttributeException, CoreException
Removes the entry associated with this name in this object's attribute lookup table, returning the value associated with the name.

Parameters:
name - Lookup key that was passed to set when the desired attribute was inserted
Returns:
Value associated with that name
 o has
 public abstract boolean has(Object name) throws InvalidAttributeException, CoreException
Tests whether there is an entry in this object's attribute lookup table associated with this name.

Parameters:
name - Lookup key in the dictionary implementation
 o set
 public abstract void set(Object name,
                          Object value) throws InvalidAttributeException, CoreException
Sets an attribute value using the name with which the attribute was previously created by a client.

Parameters:
name - Lookup key in the dictionary implementation
value - Attribute value to be stored on behalf of a client
 o get
 public abstract Object get(Object name) throws InvalidAttributeException, CoreException
Looks up an attribute value using the name with which the attribute was previously created by a client.

Parameters:
name - Lookup name that was passed to set when the desired attribute was inserted
Returns:
Value associated with that name
 o attributes
 public abstract Enumeration attributes()
Produces an enumeration of this object's attribute lookup table.

Returns:
An enumeration over the names of this object's attribute lookup table

All Packages  Class Hierarchy  This Package  Previous  Next  Index