ptolemy.data.expr
Interface ContainmentExtender

All Known Implementing Classes:
Configurer.ContainmentExtender, Configurer.ContainmentExtender, ContainmentExtender, ContainmentExtender

public interface ContainmentExtender

An interface to specify the containment relationship as seen by the model designer. This interface can be implemented by an attribute (such as ContainmentExtender. Such an attribute defines a special containment relationship that is slightly different from the containment relationship defined by NamedObj.getContainer(). The getExtendedContainer() method returns the container of the object that contains the implementing attribute. The returned container is supposed to be the object that visually contains the object that owns the implementing attribute, as seen by the model designer. In particular, for a modal model (either FSM or Ptera), even though a refinement is visually contained by a state or an event, NamedObj.getContainer() of that refinement does not return the state or event because of a difference between the visual representation and internal data representation. In that case, getExtendedContainer() of this interface returns the state or event.

When the expression evaluator tries to resolve a variable name starting from an object, it checks whether an attribute implementing this interface is owned by the object if the variable cannot be found in that object. If one such attribute is found, the evaluator considers the container returned by getExtendedContainer(), instead of the NamedObj.getContainer() that it normally uses.

Since:
Ptolemy II 8.0
Version:
$Id: ContainmentExtender.java 57044 2010-01-27 22:41:05Z cxh $
Author:
Thomas Huining Feng
Accepted Rating:
Red (tfeng)
Proposed Rating:
Red (tfeng)

Method Summary
 NamedObj getContainedObject(java.lang.String name)
          Get an object with the given name within the container.
 NamedObj getExtendedContainer()
          Get the extended container.
 

Method Detail

getContainedObject

NamedObj getContainedObject(java.lang.String name)
                            throws IllegalActionException
Get an object with the given name within the container.

Parameters:
name - The name of the object.
Returns:
The object, or null if not found.
Throws:
IllegalActionException - If exception occurs when trying to get the contained object.

getExtendedContainer

NamedObj getExtendedContainer()
                              throws IllegalActionException
Get the extended container.

Returns:
The container.
Throws:
IllegalActionException - If exception occurs when trying to get the container.