DataObject.IsEquivalent

Prototypes

static boolean IsEquivalent( DataObject dobj1, DataObject dobj2 )

Return Value

If the two variables refer to the same data object, the return value is true. If either variable is null or the variables refer to different data objects, the return value is false.

Parameters

DataObject dobj1
An object of the DataObject class.

DataObject dobj2
An object of the DataObject class.

Remarks

Use this method to determine whether two objects of the DataObject class refer to the same data object. This method is usually used in conjunction with the methods DataView.GetInitiator and DataView.GetDataObject to determine whether the initiator of an action is connected to a particular known DataObject.

Technical Note: This method does not return the same values as the Java method Object.equals. The DataObject objects that an IMLPlus programmer manipulates are actually proxies for data objects. It is possible to have multiple proxies that refer to the same data object.

Example
x = T(1:100);
y = normal(x);
 
declare DataObject dobj1, dobj2, dobj3;
dobj1 = DataObject.Create( "Data 1", {"x" "y"}, x||y );
dobj2 = DataObject.Create( "Data 2", {"x" "y"}, x||y );
 
if DataObject.IsEquivalent( dobj1, dobj2 ) then
    print "dobj1 and dobj2 refer to the same DataObject"; 
else
    print "dobj1 and dobj2 refer to different DataObjects"; 
 
declare Histogram hist;
hist = Histogram.Create( dobj1, "y", false );
dobj3 = hist.GetDataObject();
 
if DataObject.IsEquivalent( dobj1, dobj3 ) then
    print "dobj1 and dobj3 refer to the same DataObject"; 
else
    print "dobj1 and dobj3 refer to different DataObjects"; 
See Also

DataView.GetDataObject
DataView.IsEquivalent