Class Triple


  • public class Triple
    extends Object
    A triple is a tuple of length three. It represents an ordered list of three elements, written by convention as (x, y, z).

    This class is immutable.

    See Also:
    Wikipedia: Tuple
    • Constructor Detail

      • Triple

        public Triple​(double x,
                      double y,
                      double z)
        Creates a new triple with the given values.
        Parameters:
        x - the first element
        y - the second element
        z - the third element
    • Method Detail

      • x

        public double x()
        Return the value of the first element of the triple.
        Returns:
        the first element, x
      • y

        public double y()
        Return the value of the second element of the triple.
        Returns:
        the second element, y
      • z

        public double z()
        Return the value of the third element of the triple.
        Returns:
        the third element, z