Package org.anchoranalysis.spatial.point
Class Tuple3i
Object
Tuple3i
- All Implemented Interfaces:
Serializable
,Comparable<ReadableTuple3i>
,ReadableTuple3i
- Direct Known Subclasses:
Point3i
A three-dimensional tuple of int values.
- Author:
- Owen Feehan
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
add
(ReadableTuple3i toAdd) Arithmetically adds aReadableTuple3i
's values across each dimension.protected boolean
final void
Decrements the X component's value by one.final void
decrementX
(int shift) Decrements the X component's value by a shift.final void
Decrements the Y component's value by one.final void
decrementY
(int shift) Decrements the Y component's value by a shift.final void
Decrements the Z component's value by one.final void
decrementZ
(int shift) Decrements the Z component's value by a shift.final void
divideBy
(int divisor) Arithmetically divide by a value across each dimension.boolean
int
hashCode()
final void
Increments the X component's value by one.final void
incrementX
(int shift) Increments the X component's value by a shift.final void
Increments the Y component's value by one.final void
incrementY
(int shift) Increments the Y component's value by a shift.final void
Increments the Z component's value by one.final void
incrementZ
(int shift) Increments the Z component's value by a shift.max
(int value) Element-wise maximum between this point and a scalar.max
(ReadableTuple3i point) Element-wise maximum between this point and another.min
(ReadableTuple3i point) Element-wise minimum between this point and another.final void
scale
(double factor) Arithmetically multiplies by a value across each dimension.final void
scale
(int factor) Arithmetically multiplies by a value across each dimension.final void
scaleX
(double factor) Arithmetically multiplies the X-axis component by a value.final void
scaleXY
(double factor) Arithmetically multiplies the X- and Y-axis components by a value.final void
scaleY
(double factor) Arithmetically multiplies the Y-axis component by a value.void
setX
(int x) X-axis component of the tuple.void
setY
(int y) Y-axis component of the tuple.void
setZ
(int z) Z-axis component of the tuple.final void
subtract
(int valueToSubtract) Arithmetically subtracts a value across each dimension.final void
subtract
(ReadableTuple3i valueToSubtract) Arithmetically subtracts a value across each dimension.toString()
final int
valueByDimension
(int dimensionIndex) A component of a tuple corresponding to a particular dimension by index.final 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.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.anchoranalysis.spatial.point.ReadableTuple3i
compareTo, duplicateChangeZ, matchAllDimensions, matchAllDimensions
-
Field Details
-
x
protected int xX-axis component of the tuple. -
y
protected int yY-axis component of the tuple. -
z
protected int zZ-axis component of the tuple.
-
-
Constructor Details
-
Tuple3i
public Tuple3i()
-
-
Method Details
-
add
Arithmetically adds aReadableTuple3i
's values across each dimension.- Parameters:
toAdd
- tuple to add to current state.
-
subtract
public final void subtract(int valueToSubtract) Arithmetically subtracts a value across each dimension.- Parameters:
valueToSubtract
- value to subtract.
-
subtract
Arithmetically subtracts a value across each dimension.- Parameters:
valueToSubtract
- value to subtract, for each respective dimension.
-
scale
public final void scale(int factor) Arithmetically multiplies by a value across each dimension.- Parameters:
factor
- value to multiply by.
-
scale
public final void scale(double factor) Arithmetically multiplies by a value across each dimension.- Parameters:
factor
- value to multiply by.
-
divideBy
public final void divideBy(int divisor) Arithmetically divide by a value across each dimension.- Parameters:
divisor
- value to divide by.
-
scaleX
public final void scaleX(double factor) Arithmetically multiplies the X-axis component by a value.- Parameters:
factor
- value to multiply by.
-
scaleY
public final void scaleY(double factor) Arithmetically multiplies the Y-axis component by a value.- Parameters:
factor
- value to multiply by.
-
scaleXY
public final void scaleXY(double factor) Arithmetically multiplies the X- and Y-axis components by a value.- Parameters:
factor
- value to multiply by.
-
min
Element-wise minimum between this point and another.- Parameters:
point
- the other point.- Returns:
- a new point containing the minimum of the X, Y, Z components.
-
max
Element-wise maximum between this point and another.- Parameters:
point
- the other point.- Returns:
- a new point containing the minimum of the X, Y, Z components.
-
max
Element-wise maximum between this point and a scalar.- Parameters:
value
- the scalar.- Returns:
- a new point containing the minimum of the X, Y, Z components.
-
valueByDimension
public final int valueByDimension(int dimensionIndex) A component of a tuple corresponding to a particular dimension by index.- Specified by:
valueByDimension
in interfaceReadableTuple3i
- Parameters:
dimensionIndex
- the index corresponding to an axis, as perAxisConverter
.- Returns:
- the component of the tuple corresponding to that axis.
-
valueByDimension
Description copied from interface:ReadableTuple3i
A component of a tuple corresponding to a particular axis.- Specified by:
valueByDimension
in interfaceReadableTuple3i
- Parameters:
axis
- the axis.- Returns:
- the component of the tuple corresponding to that axis.
-
incrementX
public final void incrementX()Increments the X component's value by one. -
incrementY
public final void incrementY()Increments the Y component's value by one. -
incrementZ
public final void incrementZ()Increments the Z component's value by one. -
incrementX
public final void incrementX(int shift) Increments the X component's value by a shift.- Parameters:
shift
- how much to increment by.
-
incrementY
public final void incrementY(int shift) Increments the Y component's value by a shift.- Parameters:
shift
- how much to increment by.
-
incrementZ
public final void incrementZ(int shift) Increments the Z component's value by a shift.- Parameters:
shift
- how much to increment by.
-
decrementX
public final void decrementX()Decrements the X component's value by one. -
decrementY
public final void decrementY()Decrements the Y component's value by one. -
decrementZ
public final void decrementZ()Decrements the Z component's value by one. -
decrementX
public final void decrementX(int shift) Decrements the X component's value by a shift.- Parameters:
shift
- how much to decrement by.
-
decrementY
public final void decrementY(int shift) Decrements the Y component's value by a shift.- Parameters:
shift
- how much to decrement by.
-
decrementZ
public final void decrementZ(int shift) Decrements the Z component's value by a shift.- Parameters:
shift
- how much to decrement by.
-
toString
-
x
public int x()Description copied from interface:ReadableTuple3i
X-axis component of the tuple.- Specified by:
x
in interfaceReadableTuple3i
- Returns:
- the component value.
-
y
public int y()Description copied from interface:ReadableTuple3i
Y-axis component of the tuple.- Specified by:
y
in interfaceReadableTuple3i
- Returns:
- the component value.
-
z
public int z()Description copied from interface:ReadableTuple3i
Z-axis component of the tuple.- Specified by:
z
in interfaceReadableTuple3i
- Returns:
- the component value.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
setX
public void setX(int x) X-axis component of the tuple. -
setY
public void setY(int y) Y-axis component of the tuple. -
setZ
public void setZ(int z) Z-axis component of the tuple.
-