DataObject.AddAttachedObject

Prototypes

void AddAttachedObject( String sName, Object obj )

Parameters

String sName
The name for the attachment. The name can contain any characters. If an attachment with the specified name already exists, the existing attachment is replaced.

Object obj
The Java object to add as an attachment.

Remarks

This method adds a Java object as an attachment to the DataObject. You can retrieve the attachment later by calling the method GetAttachedObject.

The DataObject class enables you to add attachments to a DataObject. This enables you to associate additional information about the data in a DataObject with the DataObject itself. The DataObject does not use your attachments. Note that attachments exist only in memory. They are not stored when you store the DataObject.

Example
declare DataObject dobj = DataObject.Create( "Example" );
dobj.AddVar( "X", rannor(1:100) );

declare Histogram hist = Histogram.Create( dobj, "X" );
dobj.AddAttachedObject( "Histogram", hist );

declare Plot plot;
plot = (Plot)dobj.GetAttachedObject( "Histogram" );
plot.SetGraphAreaBackgroundColor( ORANGE );
See Also

DataObject.GetAttachedObject