public abstract class MWArray
extends java.lang.Object
implements java.io.Serializable
MWArray
class is the base class for native struct and cell
MATLAB array types.Modifier and Type | Field and Description |
---|---|
protected java.lang.Object[] |
flatArray |
Modifier | Constructor and Description |
---|---|
protected |
MWArray() |
protected |
MWArray(int[] inDims) |
protected |
MWArray(int rows,
int cols) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
This method returns true if the object matches the one passed in.
|
java.lang.Object |
get(int index)
Returns the element at the specified 1-based offset in this array.
|
java.lang.Object |
get(int[] index)
Returns the element at the specified 1-based index-array in this array.
|
java.lang.Object |
getData()
Returns a 1-D array containing a copy of the data in the underlying MATLAB array.
|
int[] |
getDimensions()
Returns an array containing the size of each dimension of this array.
|
protected java.lang.String |
getDimsStr() |
protected int |
getMaxValidIndex() |
protected int |
getOneBasedIndexForArray(int[] index) |
int |
hashCode()
This method returns a hash of the object.
|
protected void |
initNativeArray(int num) |
boolean |
isEmpty()
This method returns true if the array object contains no elements,
and false otherwise.
|
int |
numberOfDimensions()
Returns the number of dimensions of this array.
|
int |
numberOfElements()
Returns the total number of elements in this array.
|
void |
set(int[] index,
java.lang.Object val)
Replaces the element at the specified 1-based index-array in this array with the specified element.
|
void |
set(int index,
java.lang.Object val)
Replaces the element at the specified 1-based offset in this array with the specified element.
|
protected void |
setMaxValidIndex(int idx) |
abstract java.lang.String |
toString() |
protected MWArray()
protected MWArray(int rows, int cols)
protected MWArray(int[] inDims)
public abstract java.lang.String toString()
toString
in class java.lang.Object
public int numberOfDimensions()
public int[] getDimensions()
public int numberOfElements()
public java.lang.Object get(int index)
index
- The index of the requested element. Valid range: 1 <= index <= N,
where N = total number of elements in the array.public java.lang.Object get(int[] index)
index
- Array of indices specifying the location of the requested element.
The length of the index array must be exactly the number of dimensions of this array.
Each element of the index array has the valid range: 1 <= index[i] <= N[i], where N[i] = the size of the ith dimension.public void set(int index, java.lang.Object val)
index
- The index of the element to replace. Valid range: 1 <= index <= N, where N = total number of elements in the array.val
- New element to replace at index.public void set(int[] index, java.lang.Object val)
index
- Array of indices specifying the location of the element to replace.
The length of the index array must be exactly the number of dimensions of this array.
Each element of the index array has the valid range: 1 <= index[i] <= N[i], where N[i] = the size of the ith dimension.val
- New element to replace at index.public java.lang.Object getData()
public boolean isEmpty()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
protected int getMaxValidIndex()
protected void setMaxValidIndex(int idx)
protected void initNativeArray(int num)
protected int getOneBasedIndexForArray(int[] index)
protected java.lang.String getDimsStr()
© 1994-2017 The MathWorks, Inc. Patents Trademarks