E
- type of this 3D matrixpublic interface Matrix3D<E> extends Iterable<E>
long
s.Modifier and Type | Method and Description |
---|---|
E |
aggregate(BinaryFunction<E,E,E> aggr,
UnaryFunction<E,E> function)
Apply a function to each value in this 3D matrix and aggregate
the result.
|
E |
aggregate(Matrix3D<? extends E> other,
BinaryFunction<E,E,E> aggr,
BinaryFunction<E,E,E> function)
Apply a function to each value in this 3D matrix and the specified
matrix and aggregate the result.
|
Matrix3D<E> |
assign(E e)
Assign all values in this 3D matrix to
e (optional
operation). |
Matrix3D<E> |
assign(Matrix3D<? extends E> other)
Assign all values in this 3D matrix to the values in the
specified matrix (optional operation).
|
Matrix3D<E> |
assign(Matrix3D<? extends E> other,
BinaryFunction<E,E,E> function)
Assign the result of the specified function of a value from
this 3D matrix and the specified matrix to each value in this
3D matrix (optional operation).
|
Matrix3D<E> |
assign(UnaryFunction<E,E> function)
Assign the result of the specified function to each value
in this 3D matrix (optional operation).
|
long |
cardinality()
Return the cardinality of this 3D matrix, the number
of non-null values.
|
void |
clear()
Clear all the values in this 3D matrix (optional operation).
|
long |
columns()
Return the number of columns in this 3D matrix.
|
void |
forEach(QuaternaryPredicate<Long,Long,Long,? super E> predicate,
QuaternaryProcedure<Long,Long,Long,? super E> procedure)
Apply the specified procedure to each slice, row, and column
and to each value in this 3D matrix accepted by the specified predicate.
|
void |
forEach(QuaternaryProcedure<Long,Long,Long,? super E> procedure)
Apply the specified procedure to each slice, row, and column and
to each value in this 3D matrix.
|
void |
forEach(UnaryPredicate<? super E> predicate,
UnaryProcedure<? super E> procedure)
Apply the specified procedure to each value in this 3D matrix
accepted by the specified predicate.
|
void |
forEach(UnaryProcedure<? super E> procedure)
Apply the specified procedure to each value in this 3D matrix.
|
void |
forEachNonNull(UnaryProcedure<? super E> procedure)
Apply the specified procedure to each non-null value in this 3D matrix.
|
E |
get(long slice,
long row,
long column)
Return the value at the specified slice, row, and column.
|
E |
getQuick(long slice,
long row,
long column)
Return the value at the specified slice, row, and column without
checking bounds.
|
boolean |
isEmpty()
Return true if the cardinality of this 3D matrix is zero.
|
Iterator<E> |
iterator()
Return an iterator over the values in this 3D matrix, including
null s. |
long |
rows()
Return the number of rows in this 3D matrix.
|
void |
set(long slice,
long row,
long column,
E e)
Set the value at the specified slice, row, and column to
e
(optional operation). |
void |
setQuick(long slice,
long row,
long column,
E e)
Set the value at the specified slice, row, and column to
e without checking bounds (optional operation). |
long |
size()
Return the size of this 3D matrix.
|
long |
slices()
Return the number of slices in this 3D matrix.
|
Matrix2D<E> |
viewColumn(long column)
Return a new 2D matrix slice view of the specified column.
|
Matrix3D<E> |
viewColumnFlip()
Return a new 3D matrix flip view along the column axis.
|
Matrix3D<E> |
viewDice(int axis0,
int axis1,
int axis2)
Return a new 3D matrix dice (transposition) view.
|
Matrix3D<E> |
viewPart(long slice,
long row,
long column,
long depth,
long height,
long width)
Return a new 3D matrix sub-range view that contains only those values
from
(slice, row, column) to
(slice + depth - 1, row + height - 1, column + width - 1) . |
Matrix2D<E> |
viewRow(long row)
Return a new 2D matrix slice view of the specified row.
|
Matrix3D<E> |
viewRowFlip()
Return a new 3D matrix flip view along the row axis.
|
Matrix3D<E> |
viewSelection(BitMatrix3D mask)
Return a new 3D matrix selection view that contains only those values
at the indices present in the specified bit mask.
|
Matrix3D<E> |
viewSelection(long[] sliceIndices,
long[] rowIndices,
long[] columnIndices)
Return a new 3D matrix selection view that contains only those values
at the specified indices.
|
Matrix3D<E> |
viewSelection(UnaryPredicate<Matrix2D<E>> predicate)
Return a new 3D matrix selection view that contains only those slices
selected by the specified predicate.
|
Matrix2D<E> |
viewSlice(long slice)
Return a new 2D matrix slice view of the specified slice.
|
Matrix3D<E> |
viewSliceFlip()
Return a new 3D matrix flip view along the slice axis.
|
Matrix3D<E> |
viewStrides(long sliceStride,
long rowStride,
long columnStride)
Return a new 3D matrix stride view which is a sub matrix consisting
of every
sliceStride -th slice, every rowStride -th
row, and every columnStride -th column. |
long size()
long rows()
long columns()
long slices()
long cardinality()
boolean isEmpty()
void clear()
UnsupportedOperationException
- if the clear
operation
is not supported by this 3D matrixE get(long slice, long row, long column)
slice
- slice index, must be >= 0
and < slices()
row
- row index, must be >= 0
and < rows()
column
- column index, must be >= 0
and < columns()
IndexOutOfBoundsException
- if any of slice
, row
, or
column
are negative or if any of slice
, row
,
or column
are greater than or equal to slices()
,
rows()
, or columns()
, respectivelyE getQuick(long slice, long row, long column)
slice
- slice index, should be >= 0
and < slices()
(unchecked)row
- row index, should be >= 0
and < rows()
(unchecked)column
- column index, should be >= 0
and < columns()
(unchecked)void set(long slice, long row, long column, E e)
e
(optional operation).slice
- slice index, must be >= 0
and < slices()
row
- row index, must be >= 0
and < rows()
column
- column index, must be >= 0
and < columns()
e
- valueIndexOutOfBoundsException
- if any of slice
, row
, or
column
are negative or if any of slice
, row
,
or column
are greater than or equal to slices()
,
rows()
, or columns()
, respectivelyUnsupportedOperationException
- if the set
operation
is not supported by this 3D matrixvoid setQuick(long slice, long row, long column, E e)
e
without checking bounds (optional operation).slice
- slice index, should be >= 0
and < slices()
(unchecked)row
- row index, should be >= 0
and < rows()
(unchecked)column
- column index, should be >= 0
and < columns()
(unchecked)e
- valueUnsupportedOperationException
- if the setQuick
operation
is not supported by this 3D matrixIterator<E> iterator()
null
s.Matrix3D<E> assign(E e)
e
(optional
operation).e
- valueUnsupportedOperationException
- if this assign
operation
is not supported by this 3D matrixMatrix3D<E> assign(UnaryFunction<E,E> function)
function
- function, must not be nullUnsupportedOperationException
- if this assign
operation
is not supported by this 3D matrixMatrix3D<E> assign(Matrix3D<? extends E> other)
other
- other 3D matrix, must not be null and must
have the same dimensions as this 3D matrixUnsupportedOperationException
- if this assign
operation
is not supported by this 3D matrixMatrix3D<E> assign(Matrix3D<? extends E> other, BinaryFunction<E,E,E> function)
other
- other 3D matrix, must not be null and must
have the same dimensions as this 3D matrixfunction
- function, must not be nullUnsupportedOperationException
- if this assign
operation
is not supported by this 3D matrixE aggregate(BinaryFunction<E,E,E> aggr, UnaryFunction<E,E> function)
aggr
- aggregate function, must not be nullfunction
- function, must not be nullE aggregate(Matrix3D<? extends E> other, BinaryFunction<E,E,E> aggr, BinaryFunction<E,E,E> function)
other
- other 3D matrix, must not be null and must
have the same dimensions as this 3D matrixaggr
- aggregate function, must not be nullfunction
- function, must not be nullMatrix2D<E> viewSlice(long slice)
slice
- slice index, must be >= 0
and < slices()
Matrix2D<E> viewRow(long row)
row
- row index, must be >= 0
and < rows()
Matrix2D<E> viewColumn(long column)
column
- column index, must be >= 0
and < columns()
Matrix3D<E> viewDice(int axis0, int axis1, int axis2)
axis0
- the axis that shall become axis 0 (0 for slice, 1 for row, 2 for column)axis1
- the axis that shall become axis 0 (0 for slice, 1 for row, 2 for column)axis2
- the axis that shall become axis 0 (0 for slice, 1 for row, 2 for column)IllegalArgumentException
- if any of the parameters are equal or
if any of the parameters are not 0, 1, or 2.Matrix3D<E> viewSliceFlip()
0
is now slice slices() - 1
,
..., what used to be slice slices() - 1
is now slice 0
.
The view is backed by this matrix, so changes made to the returned
view are reflected in this matrix, and vice-versa.Matrix3D<E> viewRowFlip()
0
is now row rows() - 1
,
..., what used to be row rows() - 1
is now row 0
.
The view is backed by this matrix, so changes made to the returned
view are reflected in this matrix, and vice-versa.Matrix3D<E> viewColumnFlip()
0
is now column columns() - 1
,
..., what used to be column columns() - 1
is now column
0
. The view is backed by this matrix, so changes made to the
returned view are reflected in this matrix, and vice-versa.Matrix3D<E> viewPart(long slice, long row, long column, long depth, long height, long width)
(slice, row, column)
to
(slice + depth - 1, row + height - 1, column + width - 1)
.
The view is backed by this matrix, so changes made to the returned
view are reflected in this matrix, and vice-versa.slice
- slice index, must be >= 0
and < slices()
row
- row index, must be >= 0
and < rows()
column
- column index, must be >= 0
and < columns()
depth
- depthheight
- heightwidth
- width(slice, row, column)
to
(slice + depth - 1, row + height - 1, column + width - 1)
.Matrix3D<E> viewSelection(long[] sliceIndices, long[] rowIndices, long[] columnIndices)
sliceIndices
- slice indicesrowIndices
- row indicescolumnIndices
- column indicesMatrix3D<E> viewSelection(UnaryPredicate<Matrix2D<E>> predicate)
predicate
- predicate, must not be nullMatrix3D<E> viewSelection(BitMatrix3D mask)
mask
- 3D bit mask, must not be nullMatrix3D<E> viewStrides(long sliceStride, long rowStride, long columnStride)
sliceStride
-th slice, every rowStride
-th
row, and every columnStride
-th column. The view is backed by
this matrix, so changes made to the returned view are reflected in this
matrix, and vice-versa.sliceStride
- slice stride, must be > 0
rowStride
- row stride, must be > 0
columnStride
- column stride, must be > 0
sliceStride
-th slice, every rowStride
-th
row, and every columnStride
-th column.IndexOutOfBoundsException
- if any of sliceStride
,
rowStride
, or columnStride
are negative or zerovoid forEach(UnaryProcedure<? super E> procedure)
For example:
Matrix3D<String> m; m.forEach(new UnaryProcedure<String>() { public void run(final String value) { System.out.println(value); } });
procedure
- procedure, must not be nullvoid forEach(UnaryPredicate<? super E> predicate, UnaryProcedure<? super E> procedure)
For example:
Matrix3D<String> m; m.forEach(new UnaryPredicate<String>() { public boolean test(final String value) { return (value != null); } }, new UnaryProcedure<String>() { public void run(final String value) { System.out.println(value); } });
predicate
- predicate, must not be nullprocedure
- procedure, must not be nullvoid forEachNonNull(UnaryProcedure<? super E> procedure)
For example:
Matrix3D<String> m; m.forEachNonNull(new UnaryProcedure<String>() { public void run(final String value) { System.out.println(value); } });
procedure
- procedure, must not be nullvoid forEach(QuaternaryProcedure<Long,Long,Long,? super E> procedure)
For example:
Matrix3D<String> m; m.forEach(new QuaternaryProcedure<Long, Long, Long, String>() { public void run(final Long slice, final Long row, final Long column, final String value) { System.out.print("m[" + slice + ", " + row + ", " + column + "]=" + value); } });
procedure
- procedure, must not be nullvoid forEach(QuaternaryPredicate<Long,Long,Long,? super E> predicate, QuaternaryProcedure<Long,Long,Long,? super E> procedure)
For example:
Matrix3D<String> m; m.forEach(new QuaternaryPredicate<Long, Long, Long, String>() { public boolean test(final Long slice, final Long row, final Long column, final String value) { return (value != null); } }, new QuaternaryProcedure<Long, Long, Long, String>() { public void run(final Long slice, final Long row, final Long column, final String value) { System.out.print("m[" + slice + ", " + row + ", " + column + "]=" + value); } });
predicate
- predicate, must not be nullprocedure
- procedure, must not be nullCopyright (c) 2004-2013 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).