Class Tuple3i

Object
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:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
    X-axis component of the tuple.
    protected int
    Y-axis component of the tuple.
    protected int
    Z-axis component of the tuple.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    Arithmetically adds a ReadableTuple3i'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
     
    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.
    Element-wise maximum between this point and another.
    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.
     
    final int
    valueByDimension(int dimensionIndex)
    A component of a tuple corresponding to a particular dimension by index.
    final int
    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 x
      X-axis component of the tuple.
    • y

      protected int y
      Y-axis component of the tuple.
    • z

      protected int z
      Z-axis component of the tuple.
  • Constructor Details

    • Tuple3i

      public Tuple3i()
  • Method Details

    • add

      public final void add(ReadableTuple3i toAdd)
      Arithmetically adds a ReadableTuple3i'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

      public final void subtract(ReadableTuple3i valueToSubtract)
      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

      public Point3i min(ReadableTuple3i point)
      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

      public Point3i max(ReadableTuple3i point)
      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

      public Point3i max(int value)
      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 interface ReadableTuple3i
      Parameters:
      dimensionIndex - the index corresponding to an axis, as per AxisConverter.
      Returns:
      the component of the tuple corresponding to that axis.
    • valueByDimension

      public final int valueByDimension(Axis axis)
      Description copied from interface: ReadableTuple3i
      A component of a tuple corresponding to a particular axis.
      Specified by:
      valueByDimension in interface ReadableTuple3i
      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

      public String toString()
      Overrides:
      toString in class Object
    • x

      public int x()
      Description copied from interface: ReadableTuple3i
      X-axis component of the tuple.
      Specified by:
      x in interface ReadableTuple3i
      Returns:
      the component value.
    • y

      public int y()
      Description copied from interface: ReadableTuple3i
      Y-axis component of the tuple.
      Specified by:
      y in interface ReadableTuple3i
      Returns:
      the component value.
    • z

      public int z()
      Description copied from interface: ReadableTuple3i
      Z-axis component of the tuple.
      Specified by:
      z in interface ReadableTuple3i
      Returns:
      the component value.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • 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.