public final class BitMatrix3D extends Object
long
s.Constructor and Description |
---|
BitMatrix3D(long slices,
long rows,
long columns)
Create a new 3D bit matrix with the specified number of
slices, rows, and columns.
|
Modifier and Type | Method and Description |
---|---|
BitMatrix3D |
and(BitMatrix3D other)
Perform a logical AND of this 3D bit matrix
and the specified 3D bit matrix.
|
BitMatrix3D |
andNot(BitMatrix3D other)
Clear all the bits in this 3D bit matrix whose corresponding
bit is set in the specified 3D bit matrix.
|
BitMatrix3D |
assign(boolean value)
Assign all values in this 3D bit matrix to
value . |
long |
cardinality()
Return the cardinality of this 3D bit matrix, the
number of bits set to true.
|
void |
clear()
Clear all the values in this 3D bit matrix.
|
long |
columns()
Return the number of columns in this 3D bit matrix.
|
boolean |
equals(Object o) |
void |
flip(long slice,
long row,
long column)
Set the bit value at the specified slice, row, and column to the complement
of its current bit value.
|
void |
flip(long slice0,
long row0,
long column0,
long slice1,
long row1,
long column1)
Set all of the bit values from (
slice0, row0, column0 ), inclusive,
to (slice1, row1, column1 ), exclusive, to the complement of their
current bit values. |
void |
flipQuick(long slice,
long row,
long column)
Set the bit value at the specified slice, row, and column to the complement
of its current bit value without checking bounds.
|
void |
forEach(boolean value,
TernaryProcedure<Long,Long,Long> procedure)
Apply the specified procedure to each slice, row, and column
in this 3D bit matrix with a bit equal to the specified value.
|
boolean |
get(long slice,
long row,
long column)
Return the bit value at the specified slice, row, and column.
|
boolean |
getQuick(long slice,
long row,
long column)
Return the bit value at the specified slice, row, and column without checking bounds.
|
int |
hashCode() |
boolean |
intersects(BitMatrix3D other)
Return true if the specified 3D bit matrix has any bits set
to true that are also set to true in this 3D bit matrix.
|
boolean |
isEmpty()
Return true if the cardinality of this 3D bit matrix is zero.
|
BitMatrix3D |
or(BitMatrix3D other)
Perform a logical OR of this 3D bit matrix
and the specified 3D bit matrix.
|
long |
rows()
Return the number of rows in this 3D bit matrix.
|
void |
set(long slice,
long row,
long column,
boolean value)
Set the bit value at the specified slice, row, and column to
value . |
void |
set(long slice0,
long row0,
long column0,
long slice1,
long row1,
long column1,
boolean value)
Set all of the bit values from (
slice0, row0, column0 ), inclusive,
to (slice1, row1, column1 ), exclusive, to the specified value. |
void |
setQuick(long slice,
long row,
long column,
boolean value)
Set the bit value at the specified slice, row, and column to
value without checking bounds. |
long |
size()
Return the size of this 3D bit matrix.
|
long |
slices()
Return the number of slices in this 3D bit matrix.
|
BitMatrix3D |
xor(BitMatrix3D other)
Perform a logical XOR of this 3D bit matrix
and the specified 3D bit matrix.
|
public BitMatrix3D(long slices, long rows, long columns)
slices
- number of slices, must be >= 0
rows
- number of rows, must be >= 0
columns
- number of columns, must be >= 0
IllegalArgumentException
- if any of slices
,
rows
, or columns
is negativepublic long size()
public long slices()
public long rows()
public long columns()
public long cardinality()
public boolean isEmpty()
public void clear()
public boolean 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()
, respectivelypublic boolean getQuick(long slice, long row, long column)
slice
- slice indexrow
- row indexcolumn
- column indexpublic void set(long slice, long row, long column, boolean value)
value
.slice
- slice index, must be >= 0
and < slices()
row
- row index, must be >= 0
and < rows()
column
- column index, must be >= 0
and < columns()
value
- 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()
, respectivelypublic void setQuick(long slice, long row, long column, boolean value)
value
without checking bounds.slice
- slice indexrow
- row indexcolumn
- column indexvalue
- valuepublic void set(long slice0, long row0, long column0, long slice1, long row1, long column1, boolean value)
slice0, row0, column0
), inclusive,
to (slice1, row1, column1
), exclusive, to the specified value.slice0
- first slice, must be >= 0
and < slices()
row0
- first row, must be >= 0
and < rows()
column0
- first column, must be >= 0
and < columns()
slice1
- second slice, must be >= 0
, <= slices()
and >= slice0
row1
- second row, must be >= 0
, <= rows()
and >= row0
column1
- second column, must be >= 0
, <= columns()
and >= column0
value
- valueIllegalArgumentException
- if any of slice1
, row1
, or
column1
are less than slice0
, row0
, or
column0
, respectivelyIndexOutOfBoundsException
- if any of slice0
, row0
,
column0
, slice1
, row1
, or column1
are negative or if any of slice0
, row0
, or column0
are greater than or equal to slices()
, rows()
, or
columns()
, respectively, or if any of slice1
, row1
, or
column1
are strictly greater than slices()
, rows()
,
or columns()
, respectivelypublic void flip(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()
, respectivelypublic void flipQuick(long slice, long row, long column)
slice
- slice indexrow
- row indexcolumn
- column indexpublic void flip(long slice0, long row0, long column0, long slice1, long row1, long column1)
slice0, row0, column0
), inclusive,
to (slice1, row1, column1
), exclusive, to the complement of their
current bit values.slice0
- first slice, must be >= 0
and < slices()
row0
- first row, must be >= 0
and < rows()
column0
- first column, must be >= 0
and < columns()
slice1
- second slice, must be >= 0
, <= slices()
and >= slice0
row1
- second row, must be >= 0
, <= rows()
and >= row0
column1
- second column, must be >= 0
, <= columns()
and >= column0
IllegalArgumentException
- if any of slice1
, row1
, or
column1
are less than slice0
, row0
, or
column0
, respectivelyIndexOutOfBoundsException
- if any of slice0
, row0
,
column0
, slice1
, row1
, or column1
are negative or if any of slice0
, row0
, or column0
are greater than or equal to slices()
, rows()
, or
columns()
, respectively, or if any of slice1
, row1
, or
column1
are strictly greater than slices()
, rows()
,
or columns()
, respectivelypublic BitMatrix3D assign(boolean value)
value
.value
- valuepublic boolean intersects(BitMatrix3D other)
other
- other 3D bit matrix, must not be null and must
have the same dimensions as this 3D bit matrixpublic BitMatrix3D and(BitMatrix3D other)
other
- other 3D bit matrix, must not be null and must
have the same dimensions as this 3D bit matrixpublic BitMatrix3D andNot(BitMatrix3D other)
other
- other 3D bit matrix, must not be null and must
have the same dimensions as this 3D bit matrixpublic BitMatrix3D or(BitMatrix3D other)
other
- other 3D bit matrix, must not be null and must
have the same dimensions as this 3D bit matrixpublic BitMatrix3D xor(BitMatrix3D other)
other
- other 3D bit matrix, must not be null and must
have the same dimensions as this 3D bit matrixpublic void forEach(boolean value, TernaryProcedure<Long,Long,Long> procedure)
value
- valueprocedure
- procedure, must not be nullCopyright (c) 2004-2013 held jointly by the individual authors. Licensed under the GNU Lesser General Public License (LGPL).