Package org.anchoranalysis.spatial.point
Interface ReadableTuple3i
- All Superinterfaces:
Comparable<ReadableTuple3i>
,Serializable
A tuple with three-values, respectively for the X, Y and Z dimensions.
This is convenient to provide non-mutable (read-only) access to a tuple's values.
A natural ordering is imposed by comparing the Z, Y, X values in that order.
- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptiondefault int
compareTo
(ReadableTuple3i other) duplicateChangeZ
(int zValueToAssign) Creates a copy of the current tuple, but with a different Z-component value.default boolean
matchAllDimensions
(IntPredicate predicate) Whether the values in all dimensions satisfy a predicate.default boolean
matchAllDimensions
(ReadableTuple3i point, IntBinaryPredicate predicate) Whether the values in each dimension satisfy a predicate, where the value in the current object is the left argument, and the corresponding value inpoint
forms the right argument.int
valueByDimension
(int dimensionIndex) A component of a tuple corresponding to a particular dimension by index.int
valueByDimension
(Axis axis) A component of a tuple corresponding to a particular axis.int
x()
X-axis component of the tuple.int
y()
Y-axis component of the tuple.int
z()
Z-axis component of the tuple.
-
Method Details
-
x
int x()X-axis component of the tuple.- Returns:
- the component value.
-
y
int y()Y-axis component of the tuple.- Returns:
- the component value.
-
z
int z()Z-axis component of the tuple.- Returns:
- the component value.
-
valueByDimension
A component of a tuple corresponding to a particular axis.- Parameters:
axis
- the axis.- Returns:
- the component of the tuple corresponding to that axis.
-
valueByDimension
int valueByDimension(int dimensionIndex) A component of a tuple corresponding to a particular dimension by index.- Parameters:
dimensionIndex
- the index corresponding to an axis, as perAxisConverter
.- Returns:
- the component of the tuple corresponding to that axis.
-
duplicateChangeZ
Creates a copy of the current tuple, but with a different Z-component value.- Parameters:
zValueToAssign
- the value to assign in the Z-axis.- Returns:
- a copy of the current object with changed Z-component value.
-
matchAllDimensions
Whether the values in all dimensions satisfy a predicate.- Parameters:
predicate
- the test applied to each dimension's value.- Returns:
- true if the values in all three dimensions satisfy the predicate, false otherwise.
-
matchAllDimensions
Whether the values in each dimension satisfy a predicate, where the value in the current object is the left argument, and the corresponding value inpoint
forms the right argument.- Parameters:
point
- the point that forms the second right-most value in the predicate.predicate
- the test applied to each dimension's value (and corresponding value inpoint
).- Returns:
- true if all three dimensions satisfy the predicate, false otherwise.
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ReadableTuple3i>
-