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 voidadd(ReadableTuple3i toAdd) Arithmetically adds aReadableTuple3i's values across each dimension.protected booleanfinal voidDecrements the X component's value by one.final voiddecrementX(int shift) Decrements the X component's value by a shift.final voidDecrements the Y component's value by one.final voiddecrementY(int shift) Decrements the Y component's value by a shift.final voidDecrements the Z component's value by one.final voiddecrementZ(int shift) Decrements the Z component's value by a shift.final voiddivideBy(int divisor) Arithmetically divide by a value across each dimension.booleaninthashCode()final voidIncrements the X component's value by one.final voidincrementX(int shift) Increments the X component's value by a shift.final voidIncrements the Y component's value by one.final voidincrementY(int shift) Increments the Y component's value by a shift.final voidIncrements the Z component's value by one.final voidincrementZ(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 voidscale(double factor) Arithmetically multiplies by a value across each dimension.final voidscale(int factor) Arithmetically multiplies by a value across each dimension.final voidscaleX(double factor) Arithmetically multiplies the X-axis component by a value.final voidscaleXY(double factor) Arithmetically multiplies the X- and Y-axis components by a value.final voidscaleY(double factor) Arithmetically multiplies the Y-axis component by a value.voidsetX(int x) X-axis component of the tuple.voidsetY(int y) Y-axis component of the tuple.voidsetZ(int z) Z-axis component of the tuple.final voidsubtract(int valueToSubtract) Arithmetically subtracts a value across each dimension.final voidsubtract(ReadableTuple3i valueToSubtract) Arithmetically subtracts a value across each dimension.toString()final intvalueByDimension(int dimensionIndex) A component of a tuple corresponding to a particular dimension by index.final 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.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
valueByDimensionin 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:ReadableTuple3iA component of a tuple corresponding to a particular axis.- Specified by:
valueByDimensionin 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:ReadableTuple3iX-axis component of the tuple.- Specified by:
xin interfaceReadableTuple3i- Returns:
- the component value.
-
y
public int y()Description copied from interface:ReadableTuple3iY-axis component of the tuple.- Specified by:
yin interfaceReadableTuple3i- Returns:
- the component value.
-
z
public int z()Description copied from interface:ReadableTuple3iZ-axis component of the tuple.- Specified by:
zin 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.
-