User`s guide

Guidelines for Working with MWArray Classes
Method Overrides Implemented by MWArray
To en sure integra t ion w ith Java program s, MWArray provides overrides for
java.lang.Object m ethods and implements the required Java interfaces as
needed. The following table provides more information about the overrides.
Overrides
Method in MWArray
Base Class
Override Desc ription
equals
Overrides Object.equals to provide a logical
equality test for two
MWArrays. Internally, this
method does a byte-wise comparison of the
native buffer. Therefore, two
MWArray instances
are logically equal when they are of the sa m e
MATLAB type and have identical size, shape,
and content.
hashCode
Overrides Object.hashCode to allow MWArray
to function properly with hash-based collections.
toString
Overrides Object.toString so that MWArray
objects will print properly. This method
formats a new
java.lang.String from the
underlying MATLAB a rray so that calls to
System.out.println with an MWArray as an
argument will produce t he same output as
displaying the array in MATLAB.
finalize
Overrides Object.finalize so that the
underlying MATLAB array is destroyed when
the garbage collector reclaims the containing
MWArray object. This method has protected
access and is not user callable.
Java Interfaces Implemented by MWArray
MWArray implements the standard Java interfaces shown in the following
table.
4-3