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 intcompareTo(ReadableTuple3i other) duplicateChangeZ(int zValueToAssign) Creates a copy of the current tuple, but with a different Z-component value.default booleanmatchAllDimensions(IntPredicate predicate) Whether the values in all dimensions satisfy a predicate.default booleanmatchAllDimensions(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 inpointforms the right argument.intvalueByDimension(int dimensionIndex) A component of a tuple corresponding to a particular dimension by index.intvalueByDimension(Axis axis) A component of a tuple corresponding to a particular axis.intx()X-axis component of the tuple.inty()Y-axis component of the tuple.intz()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 inpointforms 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:
compareToin interfaceComparable<ReadableTuple3i>
-