Package org.anchoranalysis.spatial.point
Class Tuple3i
Object
org.anchoranalysis.spatial.point.Tuple3i
- All Implemented Interfaces:
Serializable,Comparable<ReadableTuple3i>,ReadableTuple3i
- Direct Known Subclasses:
Point3i
public abstract class Tuple3i extends Object implements ReadableTuple3i
A three-dimensional tuple of int values.
- Author:
- Owen Feehan
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Tuple3i() -
Method Summary
Modifier and Type Method Description voidadd(ReadableTuple3i toAdd)Arithmetically adds aReadableTuple3i's values across each dimension.protected booleancanEqual(Object other)voiddecrementX()Decrements the X component's value by one.voiddecrementX(int shift)Decrements the X component's value by a shift.voiddecrementY()Decrements the Y component's value by one.voiddecrementY(int shift)Decrements the Y component's value by a shift.voiddecrementZ()Decrements the Z component's value by one.voiddecrementZ(int shift)Decrements the Z component's value by a shift.voiddivideBy(int divisor)Arithmetically divide by a value across each dimension.booleanequals(Object o)inthashCode()voidincrementX()Increments the X component's value by one.voidincrementX(int shift)Increments the X component's value by a shift.voidincrementY()Increments the Y component's value by one.voidincrementY(int shift)Increments the Y component's value by a shift.voidincrementZ()Increments the Z component's value by one.voidincrementZ(int shift)Increments the Z component's value by a shift.Point3imax(int value)Element-wise maximum between this point and a scalar.Point3imax(ReadableTuple3i point)Element-wise maximum between this point and another.Point3imin(ReadableTuple3i point)Element-wise minimum between this point and another.voidscale(double factor)Arithmetically multiplies by a value across each dimension.voidscale(int factor)Arithmetically multiplies by a value across each dimension.voidscaleX(double factor)Arithmetically multiplies the X-axis component by a value.voidscaleXY(double factor)Arithmetically multiplies the X- and Y-axis components by a value.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.voidsubtract(int valueToSubtract)Arithmetically subtracts a value across each dimension.voidsubtract(ReadableTuple3i valueToSubtract)Arithmetically subtracts a value across each dimension.StringtoString()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.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
-
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.
-