public final class MDByteArray extends MDAbstractArray<java.lang.Byte>
byte
array.MDAbstractArray.ArrayEntry
Constructor and Description |
---|
MDByteArray(byte[][] matrix)
Creates a
MDByteArray from the given matrix of rank 2. |
MDByteArray(byte[][] matrix,
int[] dimensions)
Creates a
MDByteArray from the given matrix of rank 2 and the
dimension which need to be less or equal the dimensions of matrix. |
MDByteArray(byte[] flattenedArray,
int[] dimensions)
|
MDByteArray(byte[] flattenedArray,
int[] dimensions,
boolean checkdimensions)
Creates a
MDByteArray from the given flattenedArray and
dimensions. |
MDByteArray(byte[] flattenedArray,
long[] dimensions)
|
MDByteArray(byte[] flattenedArray,
long[] dimensions,
boolean checkdimensions)
Creates a
MDByteArray from the given flattenedArray and
dimensions. |
MDByteArray(int[] dimensions)
Creates an empty
MDByteArray with the dimensions. |
MDByteArray(int[] dimensions,
int capacityHyperRows)
Creates an empty
MDByteArray with the dimensions. |
MDByteArray(long[] dimensions)
Creates an empty
MDIntArray with the dimensions. |
MDByteArray(long[] dimensions,
long capacityHyperRows)
Creates an empty
MDByteArray with the dimensions. |
Modifier and Type | Method and Description |
---|---|
int |
capacity()
Returns the capacity of elements in the array.
|
boolean |
equals(java.lang.Object obj) |
byte |
get(int... indices)
Returns the value of array at the position defined by indices.
|
byte |
get(int index)
Returns the value of a one-dimensional array at the position defined by index.
|
byte |
get(int indexX,
int indexY)
Returns the value of a two-dimensional array at the position defined by indexX and
indexY.
|
byte |
get(int indexX,
int indexY,
int indexZ)
Returns the value of a three-dimensional array at the position defined by indexX,
indexY and indexZ.
|
byte[] |
getAsFlatArray()
Returns the array in flattened form.
|
java.lang.Byte |
getAsObject(int... indices)
Return an object which has the same value as the element of the array specified by
indices.
|
java.lang.Byte |
getAsObject(int linearIndex)
Return an object which has the same value as the element of the array specified by
linearIndex.
|
byte[] |
getCopyAsFlatArray()
Returns a copy of the array in flattened form.
|
int |
hashCode() |
void |
set(byte value,
int... indices)
Sets the value of array at the position defined by indices.
|
void |
set(byte value,
int index)
Sets the value of a one-dimension array at the position defined by
index.
|
void |
set(byte value,
int indexX,
int indexY)
Sets the value of a two-dimensional array at the position defined by
indexX and indexY.
|
void |
set(byte value,
int indexX,
int indexY,
int indexZ)
Sets the value of a three-dimensional array at the position defined by
indexX, indexY and indexZ.
|
void |
setToObject(java.lang.Byte value,
int... indices)
Sets the element of the array specified by indices to the particular
value.
|
void |
setToObject(java.lang.Byte value,
int linearIndex)
Sets the element of the array specified by linearIndex to the particular
value.
|
byte[][] |
toMatrix()
Creates and returns a matrix from a two-dimensional array.
|
computeIndex, computeIndex, computeIndex, computeReverseIndex, decNumberOfHyperRows, dimensions, getLength, getLength, getLength, getLength, incNumberOfHyperRows, iterator, longDimensions, numberOfHyperRows, rank, size, size, toInt, toLong, toString
public MDByteArray(long[] dimensions)
MDIntArray
with the dimensions. Convenience method if
dimensions are available as long[]
.public MDByteArray(long[] dimensions, long capacityHyperRows)
MDByteArray
with the dimensions. If
capacityHyperRows > dimensions[0]
, then it will create an array with a capacity
of capacityHyperRows hyper-rows. Convenience method if dimensions are
available as long[]
.public MDByteArray(byte[] flattenedArray, long[] dimensions)
MDByteArray
from the given flattenedArray
and dimensions
. It
is checked that the arguments are compatible. Convenience method if dimensions are
available as long[]
.public MDByteArray(byte[] flattenedArray, long[] dimensions, boolean checkdimensions)
MDByteArray
from the given flattenedArray and
dimensions. If checkDimensions is true
, it is checked that the
arguments are compatible. Convenience method if dimensions are available as
long[]
.public MDByteArray(int[] dimensions)
MDByteArray
with the dimensions.public MDByteArray(int[] dimensions, int capacityHyperRows)
MDByteArray
with the dimensions. If
capacityHyperRows > dimensions[0]
, then it will create an array with a capacity
of capacityHyperRows hyper-rows.public MDByteArray(byte[] flattenedArray, int[] dimensions)
MDByteArray
from the given flattenedArray
and dimensions
. It
is checked that the arguments are compatible.public MDByteArray(byte[] flattenedArray, int[] dimensions, boolean checkdimensions)
MDByteArray
from the given flattenedArray and
dimensions. If checkDimensions is true
, it is checked that the
arguments are compatible.public MDByteArray(byte[][] matrix)
MDByteArray
from the given matrix of rank 2. Note that the values
in matrix will be copied and thus the created MDIntArray
will be
independent from matrix after construction.public MDByteArray(byte[][] matrix, int[] dimensions)
MDByteArray
from the given matrix of rank 2 and the
dimension which need to be less or equal the dimensions of matrix. Note
that the values in matrix will be copied and thus the created MDIntArray
will be independent from matrix after construction.public int capacity()
MDAbstractArray
capacity
in class MDAbstractArray<java.lang.Byte>
public java.lang.Byte getAsObject(int... indices)
MDAbstractArray
getAsObject
in class MDAbstractArray<java.lang.Byte>
public void setToObject(java.lang.Byte value, int... indices)
MDAbstractArray
setToObject
in class MDAbstractArray<java.lang.Byte>
public java.lang.Byte getAsObject(int linearIndex)
MDAbstractArray
getAsObject
in class MDAbstractArray<java.lang.Byte>
linearIndex
- The index in the linear array returned by MDAbstractArray.getAsFlatArray()
.public void setToObject(java.lang.Byte value, int linearIndex)
MDAbstractArray
setToObject
in class MDAbstractArray<java.lang.Byte>
value
- The new value to set.linearIndex
- The index in the linear array returned by MDAbstractArray.getAsFlatArray()
.public byte[] getAsFlatArray()
MDAbstractArray
getAsFlatArray
in class MDAbstractArray<java.lang.Byte>
public byte[] getCopyAsFlatArray()
MDAbstractArray
getCopyAsFlatArray
in class MDAbstractArray<java.lang.Byte>
public byte get(int... indices)
public byte get(int index)
Do not call for arrays other than one-dimensional!
public byte get(int indexX, int indexY)
Do not call for arrays other than two-dimensional!
public byte get(int indexX, int indexY, int indexZ)
Do not call for arrays other than three-dimensional!
public void set(byte value, int... indices)
public void set(byte value, int index)
Do not call for arrays other than one-dimensional!
public void set(byte value, int indexX, int indexY)
Do not call for arrays other than two-dimensional!
public void set(byte value, int indexX, int indexY, int indexZ)
Do not call for arrays other than three-dimensional!
public byte[][] toMatrix()
Do not call for arrays other than two-dimensional!
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object