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

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

    Constructors 
    Constructor Description
    Tuple3i()  
  • Method Summary

    Modifier and Type Method Description
    void add​(ReadableTuple3i toAdd)
    Arithmetically adds a ReadableTuple3i's values across each dimension.
    protected boolean canEqual​(Object other)  
    void decrementX()
    Decrements the X component's value by one.
    void decrementX​(int shift)
    Decrements the X component's value by a shift.
    void decrementY()
    Decrements the Y component's value by one.
    void decrementY​(int shift)
    Decrements the Y component's value by a shift.
    void decrementZ()
    Decrements the Z component's value by one.
    void decrementZ​(int shift)
    Decrements the Z component's value by a shift.
    void divideBy​(int divisor)
    Arithmetically divide by a value across each dimension.
    boolean equals​(Object o)  
    int hashCode()  
    void incrementX()
    Increments the X component's value by one.
    void incrementX​(int shift)
    Increments the X component's value by a shift.
    void incrementY()
    Increments the Y component's value by one.
    void incrementY​(int shift)
    Increments the Y component's value by a shift.
    void incrementZ()
    Increments the Z component's value by one.
    void incrementZ​(int shift)
    Increments the Z component's value by a shift.
    Point3i max​(int value)
    Element-wise maximum between this point and a scalar.
    Point3i max​(ReadableTuple3i point)
    Element-wise maximum between this point and another.
    Point3i min​(ReadableTuple3i point)
    Element-wise minimum between this point and another.
    void scale​(double factor)
    Arithmetically multiplies by a value across each dimension.
    void scale​(int factor)
    Arithmetically multiplies by a value across each dimension.
    void scaleX​(double factor)
    Arithmetically multiplies the X-axis component by a value.
    void scaleXY​(double factor)
    Arithmetically multiplies the X- and Y-axis components by a value.
    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.
    void subtract​(int valueToSubtract)
    Arithmetically subtracts a value across each dimension.
    void subtract​(ReadableTuple3i valueToSubtract)
    Arithmetically subtracts a value across each dimension.
    String toString()  
    int valueByDimension​(int dimensionIndex)
    A component of a tuple corresponding to a particular dimension by index.
    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 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

  • 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.