Interface ReadableTuple3i

All Superinterfaces:
Comparable<ReadableTuple3i>, Serializable
All Known Implementing Classes:
Point3i, Tuple3i

public interface ReadableTuple3i extends Serializable, Comparable<ReadableTuple3i>
A tuple with three-values, respectively for the X, Y and Z dimensions.

This is convenient to provide non-mutable (read-only) access to a tuple's values.

A natural ordering is imposed by comparing the Z, Y, X values in that order.

Author:
Owen Feehan
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
     
    duplicateChangeZ(int zValueToAssign)
    Creates a copy of the current tuple, but with a different Z-component value.
    default boolean
    Whether the values in all dimensions satisfy a predicate.
    default boolean
    Whether the values in each dimension satisfy a predicate, where the value in the current object is the left argument, and the corresponding value in point forms the right argument.
    int
    valueByDimension(int dimensionIndex)
    A component of a tuple corresponding to a particular dimension by index.
    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.
  • Method Details

    • x

      int x()
      X-axis component of the tuple.
      Returns:
      the component value.
    • y

      int y()
      Y-axis component of the tuple.
      Returns:
      the component value.
    • z

      int z()
      Z-axis component of the tuple.
      Returns:
      the component value.
    • valueByDimension

      int valueByDimension(Axis axis)
      A component of a tuple corresponding to a particular axis.
      Parameters:
      axis - the axis.
      Returns:
      the component of the tuple corresponding to that axis.
    • valueByDimension

      int valueByDimension(int dimensionIndex)
      A component of a tuple corresponding to a particular dimension by index.
      Parameters:
      dimensionIndex - the index corresponding to an axis, as per AxisConverter.
      Returns:
      the component of the tuple corresponding to that axis.
    • duplicateChangeZ

      ReadableTuple3i duplicateChangeZ(int zValueToAssign)
      Creates a copy of the current tuple, but with a different Z-component value.
      Parameters:
      zValueToAssign - the value to assign in the Z-axis.
      Returns:
      a copy of the current object with changed Z-component value.
    • matchAllDimensions

      default boolean matchAllDimensions(IntPredicate predicate)
      Whether the values in all dimensions satisfy a predicate.
      Parameters:
      predicate - the test applied to each dimension's value.
      Returns:
      true if the values in all three dimensions satisfy the predicate, false otherwise.
    • matchAllDimensions

      default boolean matchAllDimensions(ReadableTuple3i point, IntBinaryPredicate predicate)
      Whether the values in each dimension satisfy a predicate, where the value in the current object is the left argument, and the corresponding value in point forms the right argument.
      Parameters:
      point - the point that forms the second right-most value in the predicate.
      predicate - the test applied to each dimension's value (and corresponding value in point).
      Returns:
      true if all three dimensions satisfy the predicate, false otherwise.
    • compareTo

      default int compareTo(ReadableTuple3i other)
      Specified by:
      compareTo in interface Comparable<ReadableTuple3i>